WordPress.org

Support

Support » WP-Advanced » [Plugin: shortcodes] select menu shortcode

[Plugin: shortcodes] select menu shortcode

  • Hi i just want a little help. i’m making this shortcode.

    The problem is i don’t know where to place the <select> tag.

    function jumptoCourse($atts, $content = null)
    {
    	extract(shortcode_atts(array('value' => '#'), $atts));
    	return '<option value="'.$value.'"> '.do_shortcode($content).' </option>';
    }
    add_shortcode('jump', 'jumptoCourse');

    I do it this way placing the <select> tag.

    return '<select><option value="'.$value.'"> '.do_shortcode($content).' </option></select>';

    and its not right coz it will generate the select tag per value.

    I’m just a starter on learning this shortcodes. Please help

    http://wordpress.org/extend/plugins/shortcodes/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Are you trying to parse a nested shortcode tag? Can you provide your shortcode?

    Yes i’m thinking of parsing a nested shortcode since i don’t know where to place the <select> tag on the fuction jumptoCourse(). So i think of nested parsing. But i think their is also a way of doing that without being nested i guess.

    function selectCourse($content = null) {
    	return '<select id="dynamic_select">'.do_shortcode($content).'</select>';
    }
    add_shortcode('select', 'selectCourse');
    
    function jumptoCourse($atts, $content = null) {
    	extract(shortcode_atts(array('value' => '#'), $atts));
    	return '<option value="'.$value.'"> '.do_shortcode($content).' </option>';
    }
    add_shortcode('jump', 'jumptoCourse');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: shortcodes] select menu shortcode’ is closed to new replies.