Layouts Shortcodes

toolset-plugin-active

Description

Checks if some other Toolset plugin is active or not.

Arguments
  • plugins. List of the plugin you want to check. Separate the names of plugins with a comma sign. You can use the following values: views, types, cred, access and maps. It is possible to extend usage to other plugins with additional filter code:


    add_filter('layouts_shortcodes_register_list_of_plugins', 'register_plugins',30,1 );
    function register_plugins($plugins){
    $plugins['parameter_for_shortcode'] = 'Plugin_Main_class_name'; // eg. $plugins['views'] = 'WP_Views',
    return $plugins;
    }

  • active. The value should be set to true or false. Use true to show content inside shortcode when all plugins from plugins shortcode parameter are active you have to enter true, otherwise false.

Output

More Usage examples

Example

[toolset-plugin-active plugins="types,views" active="true"]Show this text only when Views and Types are active[/toolset-plugin-active]

[toolset-plugin-active plugins="types,views" active="false"]Show this text only when Views and Types are NOT active[/toolset-plugin-active]

toolset-user-role-condition

Description

Checks if the user role is assigned to the user.

Arguments
  • roles. One or more roles that you want to check. List of roles can be found at https://codex.wordpress.org/Roles_and_Capabilities

  • status. If the user must have one of the roles asigned set the value true. If the user should not belong to listed role set the value to false

Output

More Usage examples

Example

[toolset-user-role-condition roles="administrator" status="true"]
This user is an administrator, show this content
[/toolset-user-role-condition]

[toolset-user-role-condition roles="administrator,guest" status="true"]
This user is an administrator or guest, show this content
[/toolset-user-role-condition]

[toolset-user-role-condition roles="guest" status="false"]
This user is not a guest, show this content
[/toolset-user-role-condition]

[toolset-user-role-condition roles="administrator" status="false"]
This user is not an administrator, show this content
[/toolset-user-role-condition]