• Resolved s

    (@sdnazdi)


    Hi,

    I do not know if you already have this option in your field setting. In options or advanced tab when defining each custom field, add a ‘checkbox’ like this ‘Hide for empty fields’ or ‘Show this for empty fields’.

    I mean when using dynamic tag in page builder like Elementor pro, and we define text (for example Phone: ) for ‘before’, ‘after”, when there is value for specific field, it shows this text, if there is no value for that field, do not show this text. this is the case now, but I like to have such option to be choosable.

    https://ibb.co/cbtMK3p

    • This topic was modified 1 month, 1 week ago by s.
    • This topic was modified 1 month, 1 week ago by s.
    • This topic was modified 1 month, 1 week ago by s.
    • This topic was modified 1 month, 1 week ago by s.
    • This topic was modified 1 month, 1 week ago by s.
    • This topic was modified 1 month, 1 week ago by s.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter s

    (@sdnazdi)

    I tried ‘Fallback’ to solve this, and it worked.

    Plugin Support Paul Clark

    (@pdclark)

    Glad to hear you found an easy solution.

    There is also the global get_{$meta_type}_metadata filter.

    For a post_meta named text_field as a Code Snippet:

    add_filter(
    'get_post_metadata',
    function( $value, $post_id, $meta_key, $single, $meta_type ) {
    if ( 'text_field' === $meta_key && empty( $value ) ) {
    return '...Default Value...';
    }
    return $value;
    },
    20,
    5
    );
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.