Custom Fields
Re-Envisioned
Support General Similar ID not work in different meta boxes and page templates

  • Creator
    Topic
  • #1710
    Saqib
    Participant

    Hi,

    My 1st piece of code can be viewed in this screenshot http://jmp.sh/GRZraKC and 2nd one can be viewed in following http://jmp.sh/MUfG7mg

    Now, The 1st field with id “{$prefix}page_banner_image” in 1st screenshot does not work but 2nd one with same id works fine. Looks like the field with later declaration works.

    I think both should work fine as I am separating them using show hide extension. It is very important for my project as I want to centralise given fields between multiple locations.

    Any help in this regard will highly appreciated.

    Thanks & Regards

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #1719
    Anh Tran
    Keymaster

    Hi Saquib,

    The Show/Hide extension doesn’t remove the input from the edit screen. It only toggles the input using CSS. That means both the inputs are there and that makes the browser users the latest value to send to PHP.

    In this case, I suggest you use the Include/Exclude extension. This extension works similar to the Show/Hide, but it removes the input completely from the screen (if it’s not included).

    The other way is using different ID and then you can add a simple condition in the frontend to get the correct meta value.

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Similar ID not work in different meta boxes and page templates’ is closed to new replies.