• asgsoft

    (@asgsoft)


    Hey guys,

    I’ve been trying to use do_shortcode() through a plugin I am coding but it just prints out the shortcode as opposed to processing it.

    Any thoughts?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Michael

    (@alchymyth)

    it just prints out the shortcode as opposed to processing it.

    what shortcode are you trying?

    be aware that some things in square brackets are not shortcode.

    Thread Starter asgsoft

    (@asgsoft)

    I am trying to use http://wordpress.org/extend/plugins/mombly-review-rating/

    I’m pretty sure [Rating:2/5] is a shortcode :S

    Michael

    (@alchymyth)

    if you look at the general syntax of WordPress shortcodes – http://codex.wordpress.org/Shortcode_API – I am quite sure that your example is not shortcode.

    try to contact the plugin author directly – as suggested in the plugin’s FAQ http://wordpress.org/extend/plugins/mombly-review-rating/faq/

    luckdragon

    (@luckdragon)

    actually alchymyth, in this situation, that IS a shortcode that the guy has defined. quoting his readme: “The format to add a rating is simply just [Rating:3.5/5]”

    what asgsoft neglected to mention is that he’s trying to use the shortcode of one plugin in the output of another plugin. the easiest way to do that is to call the function that the “shortcode” is supposed to call.

    In This instance.. he should create the output as he is, then, before he echos it, call: $output = mombly_rating_addRating($output);

    then echo it.

    luckdragon

    (@luckdragon)

    also, asg, this forum is hard enough to get around in, creating multiple topics for the same problem doesn’t make it any easier

    Michael

    (@alchymyth)

    @luckdragon
    once and for all – it is NOT shortcode. (full stop)

    please read the WordPress ‘shortcode API’ as linked already in one of my replies.

    the plugin uses filter functions:

    add_filter('the_content', 'mombly_rating_addRating', 1);
    add_filter('the_excerpt', 'mombly_rating_addRating', 1);

    with preg_match:

    $matchint = preg_match_all("/\[Rating:(\d+\.?\d*)\/(\d+\.?\d*)\]/", $content, $matches, PREG_SET_ORDER);

    there is no add_shortcode() or anything like it in the plugin code.

    however, you have a valid point with your suggestion to try and use the function code directly.

    Michael

    (@alchymyth)

    [I am closing this topic as a duplicate of http://wordpress.org/support/topic/an-issue-with-a-wordpress-plugin-calling-external-shortcodes?replies=14 – please continue with that topic]

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘do_shortcode prints the shortcode’ is closed to new replies.