Color picker rwmb arguments

Support General Color picker rwmb argumentsResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15586
    FEDFED
    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);
    
    #15597
    Anh TranAnh 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 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.