Support » Plugins » Hacks » problems with nesting shortcodes

  • Resolved wotto


    i hope this is the right board to ask this question in….so here goes. I am creating custom shortcodes for a website that registers customer for PT/OT courses. one is called ‘tuition’ which displays a table containing the title of the course, prices, etc. there is a second shortcode called ‘register’, which displays a button which when clicked will take the user to the appropriate registration page, based off which course page they came from. i need these ‘register’ shortcode buttons placed inside of the ‘tuition’ table, which led me to nested shortcodes. The problem is that depending on the course there may be different registration options (exam only, reading material and exam, etc) and each of these buttons need to be placed at a different times so that they are in the corresponding row. i was trying to use something like:

    [tuition type=’sr’][register][/tuition] (for course with one option)

    [tuition type=’sr’][register][register exam=’1′][/tuition] (for course with two options)

    and executing do_shortcode($content) but it wasnt really working. im guessing its because there is no way to distinguish between the two [register] tags but im not entirely sure. im open to any suggestions, any help would be greatly appreciated !

Viewing 1 replies (of 1 total)
  • figured it out, made explicit call



    do_shortcode(‘[register exam=\’1\’]’);

    and it worked like a charm. topic being closed.

Viewing 1 replies (of 1 total)
  • The topic ‘problems with nesting shortcodes’ is closed to new replies.