uo_show_support_link_toolkit_free
Filters whether the support link should be shown in the toolkit for the free version.
add_filter( 'uo_show_support_link_toolkit_free', $callback, 10, 1 );
Description
Filters whether to display the support link in the Uncanny Toolkit free version. Developers can return `false` to hide the link. This hook is ideal for controlling the visibility of the free version's support prompt.
Usage
add_filter( 'uo_show_support_link_toolkit_free', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
<?php
/**
* Example of how to filter the 'uo_show_support_link_toolkit_free' hook.
* This example hides the support link if the user has a specific capability.
*
* @param bool $show_link The default value indicating whether to show the link.
* @return bool Whether the support link should be displayed.
*/
add_filter( 'uo_show_support_link_toolkit_free', function( $show_link ) {
// Only show the support link if the current user has the 'manage_options' capability.
// If they don't, we'll hide it.
if ( ! current_user_can( 'manage_options' ) ) {
return false;
}
// Otherwise, return the original value (which is true by default).
return $show_link;
}, 10, 1 );
?>
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/templates/admin-support.php:44
<a href="<?php echo admin_url( 'admin.php?page=uncanny-toolkit-kb&submit-a-ticket=1' ); ?>"><?php _e( 'I can't find the answer to my question.', 'uncanny-learndash-toolkit' ) ?></a>
</p>
<?php
}
} else {
$show_support_link = apply_filters( 'uo_show_support_link_toolkit_free', true );
if ( $show_support_link ) {
?>
<p class="uo-get-help">
<a href="https://wordpress.org/support/plugin/uncanny-learndash-toolkit"
target="_blank"><?php _e( 'I can't find the answer to my question.', 'uncanny-learndash-toolkit' ) ?></a>