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?
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"]';
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.