[ad_1]
Plugin Author
Kento
(@proaktion)
Hi!
You can use either of these approaches which rely on the actual implementation of the shortcode in templates:
a) Use do_shortcode() to render the output in a template, for example, to render the button that allows to join the “Premium” group:
<?php echo do_shortcode( '[groups_join group="Premium"]'); ?>To render the button that allows to leave that group:
<?php echo do_shortcode( '[groups_leave group="Premium"]'); ?>b) Use Groups’ underlying API functions directly in a template:
Button to join the “Premium” group:
<?php echo Groups_Shortcodes::groups_join( array( 'group' => 'Premium' ) ); ?>… button to leave it:
<?php echo Groups_Shortcodes::groups_leave( array( 'group' => 'Premium' ) ); ?>In this way, you still have the benefit of the shortcode that provides the functionality, without being limited to use it directly on the page content.
