Viewing 3 reply threads
  • Author
    Posts
    • #2671
      ajayphp
      Member

      with custom post type, do not want the post new item created as Auto-draft mode, save post only if Save button submitted , how to?

      in my project with custom post type, i have to save record only if save ,
      not required as auto draft, the problem is wordpress is that it consider every post type is post,, lots of time we do not want auto draft and auto save.

    • #2678
      Steve
      Keymaster

      @ajayphp– Please paste the code you used to register your post type. Piklist enhances the standard WordPress register_post_type function, it does not replace it.

    • #2687
      ajayphp
      Member

      Still i am learning the hw to use piklist:

      add_filter(‘piklist_post_types’, ‘supercode_post_types’);

      function supercode_post_types($post_types)
      {
      $post_types[‘supercode’] = array(
      ‘labels’ => piklist(‘post_type_labels’, ‘Keywords’)
      ,’title’ => __(‘Enter Keyword Title’)
      ,’supports’ => array(
      ‘title’
      ,’editor’
      )
      ,’public’ => true
      ,’rewrite’ => array(
      ‘slug’ => ‘keywords’
      )
      ,’capability_type’ => ‘post’
      ,’edit_columns’ => array(
      ‘title’ => __(‘Keyword’)
      ,’author’ => __(‘User’)
      )
      ,’hide_post_row_actions’ => array(
      ‘trash’
      ,’edit’
      ,’quick-edit’
      )
      ,’hide_meta_box’ => array(
      ‘slug’
      ,’author’
      )
      ,’menu_icon’ => plugins_url(‘supercode/parts/img/cell-icon.png’)
      ,’page_icon’ => plugins_url(‘supercode/parts/img/mobile-icon.png’)
      ,’admin_body_class’ => array (
      ‘piklist-demonstration’
      ,’piklist-sample’
      )
      ,’status’ => array(
      ‘draft’ => array(
      ‘label’ => ‘Pending Save’
      )
      ,’estimate’ => array(
      ‘label’ => ‘Request for Estimate’
      )
      ,’quoted’ => array(
      ‘label’ => ‘Quoted’
      )
      )
      );

      return $post_types;
      }

    • #2714
      Steve
      Keymaster

      @ajayphp– Thank you for posting your code. I don’t see a bug. If you want to disable “post revisions” and “autosave”, this is the WordPress way to do it >

Viewing 3 reply threads
  • You must be logged in to reply to this topic.