• Resolved michaelrieder

    (@michaelrieder)


    Hi Chad

    I’m using customer fields and want to ask you how can I show it conditionaly. E.g. [wpmem_field field=”birth_date” is_empty=”true”] show this content [wpmem_field field=”birth_date” is_empty=”false”] show this content

    Best Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    Currently, that’s not an option. Note that the wpmem_field shortcode is for displaying the contents of the field (so in this case, the birthdate). It’s not used for displaying other content. But I get what you’re driving at. It’s not something that would be available in the current shortcodes. It would probably have to be something you customize in the content you display using a filter on WP’s the_content.

    Thread Starter michaelrieder

    (@michaelrieder)

    Thanks Chad. I posted the question a bit to fast. I found a solution via php.

    function tt_birth_date_text() {

    $tt_user_id=get_current_user_id();
    $tt_field=get_user_meta($tt_user_id, ‘birth_date’, true);

    if (empty ( $tt_field) ) {
    $result=”text…”;
    }
    return $result;
    }
    add_shortcode(‘birth_date_text’, ‘tt_birth_date_text’);

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘is empty’ is closed to new replies.