I am using two plugins one of which is Thumbs Rating which have have a shortcode like this for example in order to display the thumbs rating option:
The code bellow is to be used in the templates files but I would like to have the option of using functions like the bellow and related ones inside posts using a shortcode if possible.
<?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?>
I add this into my post but it doesnt show instead gets parsed as normal text.
Is there a way to convert the code above into a shortcode something like [thumbsrating] which I can use in my posts. ( I want to paste the shortcode at a specific spot inside my post this is the reason for doing this )
Edit: Here is the code I had created with shortcode API but it didnt work:
function rating_function() {
return '=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''';
}
add_shortcode('rating', 'rating_function');
The result I got by adding the shortcode [rating] in my post was the return as text and not executed as PHP.
Any suggestions? Thanks