Custom Fields
Re-Envisioned
Support General Color picker rwmb arguments

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 2 months, 2 weeks ago.

  • Creator
    Topic
  • #15586
    Resolved
    FED
    Participant

    I was trying to get the value of a color picker, where I needed to pass the ID of the post.

    The following did not work, even though I’m using this technique to get other meta fields from this particular page.

    $background = rwmb_meta('guide_color_picker', $child->ID);
    

    I had to pass an empty array to the $args field in order to get the value. Otherwise I was getting an empty stting.

    $background = rwmb_meta('guide_color_picker', array(), $child->ID);
    
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #15597

    Anh Tran
    Keymaster

    Yes, that’s right. If you need to pass the value for the 3rd parameter, you have to pass a value for the 2nd parameter. It’s just how params in PHP function work.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.