Tagged: 

Viewing 4 reply threads
  • Author
    Posts
    • #674

      Is it possible to apply the locked field feature to multiple status of a CPT.  I have tried adding more values to the on_post_status array  but only the last entry seems to take effect.  I also tried just adding another array but that did not work either.  Alternatively can a fieldjust be made read only all the time?

    • #677
      Steve
      Keymaster

      @johnmcalester–  I updated this tutorial to explain how to show values on a group or range of post statuses.  Let me know if you need further clarification.

      Yes, a field can be set to always read-only by including all post statuses in the range.

    • #679

      Thanks Steve.  That makes sense.  However, no matter what I try I cannot get this to apply to more than the first status.  Which ever status I list first is the only one that is recognized.  Does the status have to be a custom status defined in the CPT parameters?

      I am using WP 3.5.1 and PikList 0.7.1

      I’m stumped.

      Thanks.

    • #680

      Here is a pastebin of my code if that helps:

      http://pastebin.com/aHh9p2km

      Thanks,

      John.

    • #681
      Steve
      Keymaster

      John– You definitely found a bug. I believe you have to register your statuses with Piklist for this to work.   Within your TICKET CPT, add the register post status code.  It can be an exact duplicate of the WordPress defaults.  Try adding this when you register the TICKET CPT.  You can see the full format here.


      ,'status' => array(
      'draft' => array(
      'label' => 'Draft'
      )
      ,'auto-draft' => array(
      'label' => 'auto-draft'
      )
      ,'pending' => array(
      'label' => 'Pending'
      )
      ,'future' => array(
      'label' => 'Scheduled'
      )
      ,'publish' => array(
      'label' => 'Published'
      )
      ,'private' => array(
      'label' => 'Private'
      )
      ,'trash' => array(
      'label' => 'Trash'
      )
      ,'inherit' => array(
      'label' => 'inherit'
      )
      )

      Let us know if this works.

       

       

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