Filter uncanny-learndash-toolkit

uo_show_support_link_toolkit_pro

Filters whether the Toolkit Pro support link should be displayed within the WordPress admin.

add_filter( 'uo_show_support_link_toolkit_pro', $callback, 10, 1 );

Description

Control whether the Pro version support link is displayed in the Uncanny Toolkit admin area. Return `false` to hide the link, or `true` (default) to show it. This hook allows fine-grained control over the Pro support link's visibility.


Usage

add_filter( 'uo_show_support_link_toolkit_pro', 'your_function_name', 10, 1 );

Return Value

The filtered value.


Examples

<?php
/**
 * Conditionally hide the "Submit a Ticket" link based on user role.
 *
 * This filter allows administrators to hide the support ticket link for
 * specific user roles, preventing non-administrative users from submitting
 * support requests directly through the toolkit's admin interface.
 *
 * @param bool $show_support_link The current value determining if the link should be shown.
 * @return bool True to show the link, false to hide it.
 */
add_filter( 'uo_show_support_link_toolkit_pro', function( $show_support_link ) {
	// Only hide the link for non-administrators.
	if ( ! current_user_can( 'manage_options' ) ) {
		return false;
	}
	return $show_support_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:32

if ( isset( $_GET['submit-a-ticket'] ) || isset( $_GET['amp;submit-a-ticket'] ) ) {
			include( 'admin-help.php' );
		} else {
			include( 'admin-kb.php' );

			if ( Boot::is_pro_active() ) {

				$show_support_link = apply_filters( 'uo_show_support_link_toolkit_pro', true );

				if ( $show_support_link ) {
					?>
					<p class="uo-get-help">
						<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>


Scroll to Top