Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Nesting Shortcode for Event ID | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Nesting Shortcode for Event ID

Nesting Shortcode for Event ID

Posted: January 15, 2014 at 2:52 pm

Viewing 2 reply threads


novaopen

January 15, 2014 at 2:52 pm

I’m trying to nest a shortcode within [ESPRESSO_CART_LINK event_id=”[SHOW_EVENT_ID]-312″ anchor=”Add to Cart”] to automatically select the current record event_ID. The second value is a constant.

<code>//Returns event_id value for the current record.
//Best used nested with other shortcodes

//[SHOW_EVENT_ID]
function show_event_id_func( $atts ){
	return $event_id;
}
add_shortcode(&#039;SHOW_EVENT_ID&#039;, &#039;show_event_id_func&#039;);</code>

Tried it a lot of ways (e.g., echo, enclosed in <?php ?>. I think I’m calling the wrong value since it doesn’t work as a standalone either.

NOTE: I started a thread on this at http://staging.eventespresso.com/topic/replacing-add-to-cart-link/ but the subject has changed quite a bit. I hadn’t heard back so I have reposted.


novaopen

January 15, 2014 at 2:55 pm

The last line is actually:

add_shortcode(‘SHOW_EVENT_ID’, ‘show_event_id_func’);


Josh

January 15, 2014 at 7:17 pm

Hi Michael,

You’ll need to define your $event_id variable in your custom function, or use your cart shortcode in a do_shortcode and use $event_id within the loop ($event_id is already defined for the loop in registration_page.php).

Viewing 2 reply threads

The support post ‘Nesting Shortcode for Event ID’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server