Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Jason 3 years ago.

  • Author
    Posts
  • #6869

    unleashed
    Participant

    How to show metabox only by condition?
    For example show metabox only if checkbox on settings page is checked.

  • #6871

    Jason
    Keymaster

    Hi @unleashed!

    To do something conditionally outside of the comment parameters, you’ll need to use the piklist_part_process filter. I just put together the doc for this: https://piklist.com/learn/doc/piklist_part_process/

    Hope this helps! 🙂

    • #6874

      unleashed
      Participant

      Thanks @jason!
      Looks like exactly what I needed.
      But I have a small question about $part parameter also.
      What information this array contains?
      Everything in comment section of a part or all information about fields too?
      Can it be useful for example to dinamically update fields value(s) ?

    • #6876

      Jason
      Keymaster

      Hi @unleashed!

      Glad that helps!

      Yup! There’s some internal properties (e.g. id, path to file, etc.) but one of the elements is $part['data'] which contains everything that was in the comment section (and everything that wasn’t). This hooks is the perfect place to change those dynamically.

You must be logged in to reply to this topic.