Viewing 3 reply threads
  • Author
    Posts
    • #612

      I am pretty sure that I saw the ability to make a field “read-only” in your WordCamp NYC presentation but I cannot figure out how to implement it now.

      Is there a field parameter that can be set to make a field read only for a capability set or a role?

      Thank you.

    • #613
      Steve
      Keymaster

      @johnmcalester– I’ll try to write up a tutorial on this, but for now you can check out the code in the Piklist Demo Add-on.  All the meta boxes in the demo currently have this feature turned on.  To see it in action, change the Post Status of a Demo post to LOCK.

      Check out any file in this directory to see how this is done: add-ons/piklist-demos/parts/meta-boxes/

      The Parameter is on_post_status

      ,'on_post_status' => array(
      'value' => 'lock'
      )

    • #614

      @steve – Thanks!

    • #615
      Steve
      Keymaster

      @johnmcalester– Glad we could help.  Wrote the tutorial here.

      Also HTML has the readonly attribute, just not as flexible as on_post_status.  But this would work:


      ,'attributes' => array(
      'class' => 'small-text'
      ,'readonly' => 'readonly'
      )

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