Skip Navigation

[Resolved] get_term_data_custom returns the code string instead of interpreting the code

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 1 voice.

Last updated by davidm-13 5 days, 2 hours ago.

Assisted by: Minesh.

Author
Posts
#2796514
ts-scrn-shot.JPG

I have the following <div>
<div class="lft">
<h3> List of plants that include </h3>
[wpv-conditional if="('[wpv-search-term param='wpv-complaint-search-key']' ne '0' )"]
<u><span style="font-size: 18px">Medicinal Complaint / Use</span></u>:<p><b> [get_term_data_custom parameter="wpv-complaint-search-key" taxonomy="complaint-search-key"]</b></p>
[/wpv-conditional]
[wpv-conditional if="('[wpv-search-term param='wpv-system']' ne '0' )"]
<u><span style="font-size: 18px">System / State</span></u>:<p><b>[get_term_data_custom parameter="wpv-system" taxonomy="system"]</b></p>
[/wpv-conditional]
[wpv-conditional if="('[wpv-search-term param='wpv-action-medicinal']' ne '0' )"]
<u><span style="font-size: 18px">Activity / Interpretation</span></u>:<p><b>[get_term_data_custom parameter="wpv-action-medicinal" taxonomy="action-medicinal"]</b></p>
[/wpv-conditional]
<h3>In their Medicinal Complaints/ Other Uses</h3>
</div>

which returns the code string (see uploaded image) instead of the search term.
Please can you help me resolve this.

Thanks

#2796519

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please check where the custom shortcode "get_term_data_custom" is added? if its added using code snippet the code snippet is activated or if the custom shortcode missing you should try to restore the "get_term_data_custom" shortcode.

#2796535

Thanks Minesh for your prompt reply.
I think you've identified the problem.
My problem is the snippet no longer exists - so I don't know what to do.
I'll check if I have any old backups that contain this snippet.
Will let you know.
Your help is very much appreciated

#2796536

I found this PHP code snippet:

<?php
add_shortcode( 'get_term_data_custom', 'get_term_data_custom_func');
function get_term_data_custom_func($atts){
$parameter = $atts['parameter'];
$taxonomy = $atts['taxonomy'];

if ( (!empty($parameter)) && (!empty($taxonomy)) && (!empty($_GET[$parameter])) ) {
$category = get_term_by('slug', $_GET[$parameter], $taxonomy, 'ARRAY_A');
if($category) {
return $category['name'];
}
}
}

So what do I need to do now?

Thanks for your help

#2796539

I opened the database and ran SQL:

SELECT * FROM wps8_posts WHERE post_content LIKE '%[plant-complaint-search]%';

got: MySQL returned an empty result set (i.e. zero rows). (Query took 0.0072 seconds.)

#2796541

Thanks Minesh for identifying the problem.
I inserted this into the page I was getting the error:

[xyz-ips snippet="plant-complaint-search"]
[wpv-view name="search-by-complaint" view_display="layout"]

and it solved the problem.
Couldn't have done it without you
Much appreciated
Thanks