Custom HTML Field

Support MB Views Custom HTML Field

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38364
    Wojtek PiskorzWojtek Piskorz
    Participant

    Hi.
    I want to have a per-populated text field from some funciton. To make it eazy let's say I want to have a custom field that will have current post ID as it's value.

    With Custom HTML it's possible, I just need to use callback with get_the_ID as it's value.

    But I can't use Custom HTML inside MB Views.

    Is there any way to populate text field from get_the_ID or is there a way to utilise Custom HTML field inside MB Views?

    #38366
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The field custom_HTML actually is not a standard custom field, it only helps you to display HTML code in the meta box and does not save value to the database so it will not work with MB Views.

    In this case, you can use the action hook rwmb_after_save_field to update a field value after saving the post. Please read more on the documentation https://docs.metabox.io/actions/rwmb-after-save-field/

    Refer to this topic https://support.metabox.io/topic/adding-post-id-as-a-field/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.