• Is it possible to use shortcodes in recipes? I want to have link to another post/recipe in Instruction section, but shortcodes doesn’t seem to work as expected. I tried to insert:
    [su_permalink id=”1499″ target=”self” title=”my title” rel=”” class=””]
    It’s provided by https://getshortcodes.com/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Przemo

    (@przemof)

    Adding do_shortcode [1] in includes/class-blossom-recipe-hook-functions.php
    solves the problem. Can you add it to the master code?

    [1] https://developer.wordpress.org/reference/functions/do_shortcode/

    `diff –git a/includes/class-blossom-recipe-hook-functions.php b/includes/class-blossom-recipe-hook-functions.php
    index 3633a19..4a8831c 100644
    — a/includes/class-blossom-recipe-hook-functions.php
    +++ b/includes/class-blossom-recipe-hook-functions.php
    @@ -584,7 +584,7 @@ class Blossom_Recipe_Maker_Hook_Functions {
    <?php
    }
    ?>
    – <?php echo ‘<span class=”instruction_description”>’ . html_entity_decode( $instruction[‘description’] ) .'</span>’;
    + <?php echo ‘<span class=”instruction_description”>’ . html_entity_decode( do_shortcode( $instruction[‘description’] ) ) .'</span>’;^M
    ?>

    Thread Starter Przemo

    (@przemof)

    Plese take a look here, that might save you some work if you’re planning to add the nested shortcodes [1]

    [1] https://gitlab.com/PrzemoF/veggee-recipe-maker/-/commit/9acb9e7dc9e9a94d6504618ebe07e58a21ac48ba

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcodes in recipes’ is closed to new replies.