Tagged: ,

Viewing 5 reply threads
  • Author
    Posts
    • #1938
      zanedickens
      Member

      Hi All,

      I was able to get my custom post statuses to work and thus all the dependant functionality fairly easily. I then did something. Now none of them are showing up and for the life of me I cannot find the issue in the CPT declaration.

      Is there anything wrong with the following (it’s part of a merged array of CPTs as per example in docs):

      
      ,'company_community' => array(
            'labels' => piklist('post_type_labels', 'Community Award Entry')
            ,'supports' => array(
              'revisions',
            )
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communityaward'
            )
           ,'edit_columns' => array(
              'title' => __('Community Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
              ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )           
    • #1940
      Steve
      Keymaster

      This works for me. I see all post statuses in the meta box dropdown.

    • #1943
      zanedickens
      Member

      Thanks Steve – at least I can hunt elsewhere now 🙂 Is the issue most likely then in my merged array or some sort of plugin conflict?

      1. The posts are created and everything there works (although occasionally I have a doubling of field boxes)
      2. I’ve tried disabling all but piklist and my own but no luck in isolating further

    • #1944
      zanedickens
      Member

      Hi I’m going to post the full code now – apologies for the length. It has to be something in here, as all plugins off, changed themes etc none of that made a difference. It was working before but now not.

      
      
      add_filter('piklist_post_types', 'awards_post_types');
      function awards_post_types($post_types)
      {
        $post_types = array_merge($post_types, array(
          'company_skills' => array(
            'labels' => piklist('post_type_labels', 'Skills Development Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'companyskills'
            )
            ,'edit_columns' => array(
              'title' => __('Skills Development Award Entry')
              ,'author' => __('Entered by')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                               // Community Award Entry
          ,'company_community' => array(
            'labels' => piklist('post_type_labels', 'Community Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communityaward'
            )
           ,'edit_columns' => array(
              'title' => __('Community Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
              ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                                                   // Innovation Award Entry
          ,'company_innovation' => array(
            'labels' => piklist('post_type_labels', 'World Design Capital 2014 Innovation Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communityinnovation'
            )
           ,'edit_columns' => array(
              'title' => __('Innovation Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )         
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
              
           ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
          )                                               // Job Creation Award Entry
          ,'company_jobs' => array(
            'labels' => piklist('post_type_labels', 'Job Creation Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
                                  'slug' => 'communityjobs'
                                  )
            ,'edit_columns' => array(
                                      'title' => __('Job Creation Award Entry')
                                      ,'author' => __('Entered by')
                                      ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
                                      'quick-edit'
                                      ,'view'
                                      ,'open-in-visual-editor'
            )
          )                                               // Best Outsourced Contact Centre Award Entry
          ,'company_outsourced' => array(
            'labels' => piklist('post_type_labels', 'Best Outsourced Contact Centre Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communityoutsourced'
            )
            ,'edit_columns' => array(
              'title' => __('Best Outsourced Contact Centre Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                               // Best Captive Contact Centre Award Entry
          ,'company_captive' => array(
            'labels' => piklist('post_type_labels', 'Best Captive Contact Centre Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communitycaptive'
            )
            ,'edit_columns' => array(
              'title' => __('Best Captive Contact Centre Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                               // Best External Support Services
          ,'company_external' => array(
            'labels' => piklist('post_type_labels', 'Best External Support Services')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communityexternal'
            )
            ,'edit_columns' => array(
              'title' => __('Best External Support Services')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                                   // Wellness in the Workplace Award 9/9
           ,'company_support' => array(
            'labels' => piklist('post_type_labels', 'Support Services Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communitysupport'
            )
            ,'edit_columns' => array(
              'title' => __('Support Services Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                                   // Wellness in the Workplace Award 9/9
          ,'company_wellness' => array(
            'labels' => piklist('post_type_labels', 'Wellness in the Workplace Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'communitywellness'
            )
            ,'edit_columns' => array(
              'title' => __('Wellness in the Workplace Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                               // Manager of the Year Entry 1/4
          ,'individual_manager' => array(
            'labels' => piklist('post_type_labels', 'Manager of the Year Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'individual-manager'
            )
            ,'edit_columns' => array(
              'title' => __('Manager of the Year Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                               // Supervisor / Team Leader of the Year Entry 2/4
          ,'individualsupervisor' => array(
            'labels' => piklist('post_type_labels', 'Supervisor / Team Leader of the Year Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'individual-supervisor'
            )
            ,'edit_columns' => array(
              'title' => __('Supervisor / Team Leader of the Year Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                               // Agent / Customer Service Representative Award Entry 3/4
          ,'individual_agent' => array(
            'labels' => piklist('post_type_labels', 'Agent / Customer Service Representative Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'individual-agent'
            )
            ,'edit_columns' => array(
              'title' => __('Agent / Customer Service Representative Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )                                               // Support Services Award Entry 4/4
          ,'individual_support' => array(
            'labels' => piklist('post_type_labels', 'Support Services Individual Award Entry')
            ,'public' => true
            ,'has_archive' => true
            ,'rewrite' => array(
              'slug' => 'individual-support'
            )
            ,'edit_columns' => array(
              'title' => __('Support Services Individual Award Entry')
              ,'author' => __('Entered by')
              ,'status' => __('Entry Status')
            )
            ,'post_states' => true
            ,'status' => array(
              'draft' => array(
                'label' => 'Completed'
                ,'public' => true
              )
              ,'locked' => array(
                'label' => 'Locked'
                ,'public' => true
              )
              ,'scored' => array(
                'label' => 'Scored'
                ,'public' => true
              )
              ,'audited' => array(
                'label' => 'Audited'
                ,'public' => true
              )
            )
            ,'hide_post_row_actions' => array(
              'quick-edit'
              ,'view'
              ,'open-in-visual-editor'
            )
          )
        ));
       
        return $post_types;
      }

      Thanks in advance 🙂

    • #1956
      Steve
      Keymaster

      @zanedickens– You seem to have found a very odd bug. Custom Post Statuses do not work unless hide_meta_box is set. You can even pass a fake meta box and it will work.

      Obviously, we’ll work on a fix but for now try adding this to your post types:

      ,'hide_meta_box' => array(
       'notreal'
      )
      
    • #2014
      zanedickens
      Member

      Thanks Steve! That was driving me nuts – happy to have found a bug – that will be my first 🙂 Now if only there were badges for that kind of thing 😉

      Just a note – for some reason I didn’t get an email notification of your second reply? Got the first one but not the second one. Either way thanks again.

Viewing 5 reply threads
  • The topic ‘Custom Post Statuses Not Working Anymore’ is closed to new replies.