Add to group with click

[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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer