• Resolved amatorPL

    (@amatorpl)


    Hi,

    It’s possible to show messages only sent by current logged user? Something like:

    [acf7db form_id=’1′ display=’table’ search=’current_user_email’]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Vsourz Digital

    (@vsourz1td)

    Thread Starter amatorPL

    (@amatorpl)

    Hi @vsourz1td

    I want register it as shotcode and show it somewhere on a page.

    function show_history() {
    
    $user = wp_get_current_user();
    $user_email = $user->user_email;
    
    $show_history = '[acf7db form_id="1174018" search="'.$user_email.'” show="url, price, submit_time"]';
    $history =  do_shortcode($show_history);
    
    return $history;
    }
    
    add_shortcode('show_history', 'show_history'); 

    This return me all e-mails, not only from current logged user. Where I made mistake? Can you help me with that?

    Plugin Author Vsourz Digital

    (@vsourz1td)

    Please replace below line and check the output once.
    $show_history = '[acf7db form_id="1174018" search="'.$user_email.'" show="url, price, submit_time"]';

    If this still not works then i suggest to enter particular email address which have any entry. something like this:
    $show_history = '[acf7db form_id="1174018" search="[email protected]" show="url, price, submit_time"]';

    Thread Starter amatorPL

    (@amatorpl)

    Thank you. Here is working code if anyone need this

    function show_history() {
    
    $user = wp_get_current_user();
    $user_email = $user->user_email;
    
    $show_history = '[acf7db form_id="1174018" search="'.$user_email.'" show="1174018.title, 1174018.url, 1174018.price, 1174018.submit_time" display="table"]';
    $history =  do_shortcode($show_history);
    
    return $history;
    }
    
    add_shortcode('show_history', 'show_history'); 

    Then we can use [show_history] shortag where we need it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘shortcode + search current user e-mail’ is closed to new replies.