public/wordpress/wp-content/plugins/theme-my-login/admin/settings.php
/**
 * Add contextual help to settings pages.
 *
 * @since 7.0.5
 *
 * @param WP_Screen $srceen The current screen object.
 */
Add contextual help to settings pages.

@param WP_Screen $srceen The current screen object.
Add contextual help to settings pages . @param WP_Screen $srceen The current screen object .
function tml_admin_add_settings_help_tabs( $screen ) {
	global $plugin_page;
	$help_tabs = $sidebar_links = array();
	if ( ! theme_my_login_admin()->has_page( $plugin_page ) ) {
		return;
	}
	if ( 'theme-my-login' == $plugin_page ) {
		$help_tabs['overview'] = array(
			'id'      => 'theme-my-login-overview',
			'title'   => __( 'Overview' ),
			'content' => '<p>' . implode( '</p><p>', array(
				__( 'Welcome to Theme My Login!', 'theme-my-login' ),
				__( 'Below, you can configure how you would like users to register and log in to your site.', 'theme-my-login' ),
				__( 'Additionally, you can change the slugs that are used to generate the URLs that represent specific actions.', 'theme-my-login' ),
				__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ),
			) ) . '</p>',
		);
		$sidebar_links['documentation'] = array(
			'title' => __( 'View Documentation', 'theme-my-login' ),
			'url'   => 'https://docs.thememylogin.com',
		);
		$sidebar_links['support'] = array(
			'title' => __( 'Get Support', 'theme-my-login' ),
			'url'   => 'https://wordpress.org/support/plugin/theme-my-login',
		);
	} elseif ( 'theme-my-login-licenses' == $plugin_page ) {
		$help_tabs['overview'] = array(
			'id'      => 'theme-my-login-licenses-overview',
			'title'   => __( 'Overview' ),
			'content' => '<p>' . implode( '</p><p>', array(
				__( 'When you purchase extensions for Theme My Login, you will enter your license keys on this page.', 'theme-my-login' ),
				__( 'After you enter your license keys and click the Save Changes button at the bottom of the screen, you will see a new button next to each field with a license in it.', 'theme-my-login' ),
				__( 'If you have not yet activated your license, this button will say "Activate". Click this button to activate your license.', 'theme-my-login' ),
				__( 'If you have already activated your license, this button will say "Deactivate". Click this button to deactivate your license.', 'theme-my-login' ),
			) ) . '</p>',
		);
		$sidebar_links['documentation'] = array(
			'title' => __( 'View Documentation', 'theme-my-login' ),
			'url'   => 'https://docs.thememylogin.com/article/59-how-do-i-install-an-extension',
		);
		$sidebar_links['support'] = array(
			'title' => __( 'Get Support', 'theme-my-login' ),
			'url'   => 'https://thememylogin.com/support',
		);
	} elseif ( 'theme-my-login-extensions' == $plugin_page ) {
		$help_tabs['overview'] = array(
			'id'      => 'theme-my-login-extensions-overview',
			'title'   => __( 'Overview' ),
			'content' => '<p>' . implode( '</p><p>', array(
				__( 'This page shows you all of the extensions available to purchase for Theme My Login.', 'theme-my-login' ),
				__( 'Once you purchase an extension, you download it from your email receipt or your account page on our website. Then, you install it just like a normal WordPress plugin.', 'theme-my-login' ),
			) ) . '</p>',
		);
		$sidebar_links['documentation'] = array(
			'title' => __( 'View Documentation', 'theme-my-login' ),
			'url'   => 'https://docs.thememylogin.com/article/59-how-do-i-install-an-extension',
		);
		$sidebar_links['store'] = array(
			'title' => __( 'Go to the Extensions Store', 'theme-my-login' ),
			'url'   => 'https://thememylogin.com/extensions',
		);
		$sidebar_links['account'] = array(
			'title' => __( 'View your Theme My Login account', 'theme-my-login' ),
			'url'   => 'https://thememylogin.com/your-account',
		);
	} elseif ( $extension = tml_get_extension( $plugin_page ) ) {
		$help_tabs['overview'] = array(
			'id'      => $plugin_page . '-overview',
			'title'   => __( 'Overview' ),
			'content' => '<p>' . implode( '</p><p>', array(
				sprintf(
					__( 'On this page, you can configure the settings for the Theme My Login %s extension.', 'theme-my-login' ),
					$extension->get_title()
				),
				__( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ),
			) ) . '</p>',
		);
		if ( $documentation_url = $extension->get_documentation_url() ) {
			$sidebar_links['documentation'] = array(
				'title' => __( 'View Documentation', 'theme-my-login' ),
				'url'   => $documentation_url,
			);
		}
		if ( $support_url = $extension->get_support_url() ) {
			$sidebar_links['support'] = array(
				'title' => __( 'Get Support', 'theme-my-login' ),
				'url'   => $support_url,
			);
		}
		$settings_page = $extension->get_settings_page_args();
		if ( ! empty( $settings_page['help_tabs'] ) ) {
			$help_tabs = array_merge( $help_tabs, $settings_page['help_tabs'] );
		}
		if ( ! empty( $settings_page['help_sidebar_links'] ) ) {
			$sidebar_links = array_merge( $sidebar_links, $settings_page['help_sidebar_links'] );
		}
	}
	if ( ! empty( $help_tabs ) ) {
		foreach ( $help_tabs as $help_tab ) {
			$screen->add_help_tab( $help_tab );
		}
	}
	if ( ! empty( $sidebar_links ) ) {
		$sidebar_content = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
		foreach ( $sidebar_links as $sidebar_link ) {
			$sidebar_content .= sprintf( '<p><a href="%s">%s</a></p>',
				$sidebar_link['url'],
				$sidebar_link['title']
			);
		}
		$screen->set_help_sidebar( $sidebar_content );
	}
}
function tml_admin_add_settings_help_tabs ( $ screen ) { global $ plugin_page ; $ help_tabs = $ sidebar_links = array ( ) ; if ( ! theme_my_login_admin ( ) -> has_page ( $ plugin_page ) ) { return ; } if ( 'theme-my-login' == $ plugin_page ) { $ help_tabs [ 'overview' ] = array ( 'id' => 'theme-my-login-overview' , 'title' => __ ( 'Overview' ) , 'content' => '<p>' . implode ( '</p><p>' , array ( __ ( 'Welcome to Theme My Login!' , 'theme-my-login' ) , __ ( 'Below, you can configure how you would like users to register and log in to your site.' , 'theme-my-login' ) , __ ( 'Additionally, you can change the slugs that are used to generate the URLs that represent specific actions.' , 'theme-my-login' ) , __ ( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) , ) ) . '</p>' , ) ; $ sidebar_links [ 'documentation' ] = array ( 'title' => __ ( 'View Documentation' , 'theme-my-login' ) , 'url' => 'https://docs.thememylogin.com' , ) ; $ sidebar_links [ 'support' ] = array ( 'title' => __ ( 'Get Support' , 'theme-my-login' ) , 'url' => 'https://wordpress.org/support/plugin/theme-my-login' , ) ; } elseif ( 'theme-my-login-licenses' == $ plugin_page ) { $ help_tabs [ 'overview' ] = array ( 'id' => 'theme-my-login-licenses-overview' , 'title' => __ ( 'Overview' ) , 'content' => '<p>' . implode ( '</p><p>' , array ( __ ( 'When you purchase extensions for Theme My Login, you will enter your license keys on this page.' , 'theme-my-login' ) , __ ( 'After you enter your license keys and click the Save Changes button at the bottom of the screen, you will see a new button next to each field with a license in it.' , 'theme-my-login' ) , __ ( 'If you have not yet activated your license, this button will say "Activate". Click this button to activate your license.' , 'theme-my-login' ) , __ ( 'If you have already activated your license, this button will say "Deactivate". Click this button to deactivate your license.' , 'theme-my-login' ) , ) ) . '</p>' , ) ; $ sidebar_links [ 'documentation' ] = array ( 'title' => __ ( 'View Documentation' , 'theme-my-login' ) , 'url' => 'https://docs.thememylogin.com/article/59-how-do-i-install-an-extension' , ) ; $ sidebar_links [ 'support' ] = array ( 'title' => __ ( 'Get Support' , 'theme-my-login' ) , 'url' => 'https://thememylogin.com/support' , ) ; } elseif ( 'theme-my-login-extensions' == $ plugin_page ) { $ help_tabs [ 'overview' ] = array ( 'id' => 'theme-my-login-extensions-overview' , 'title' => __ ( 'Overview' ) , 'content' => '<p>' . implode ( '</p><p>' , array ( __ ( 'This page shows you all of the extensions available to purchase for Theme My Login.' , 'theme-my-login' ) , __ ( 'Once you purchase an extension, you download it from your email receipt or your account page on our website. Then, you install it just like a normal WordPress plugin.' , 'theme-my-login' ) , ) ) . '</p>' , ) ; $ sidebar_links [ 'documentation' ] = array ( 'title' => __ ( 'View Documentation' , 'theme-my-login' ) , 'url' => 'https://docs.thememylogin.com/article/59-how-do-i-install-an-extension' , ) ; $ sidebar_links [ 'store' ] = array ( 'title' => __ ( 'Go to the Extensions Store' , 'theme-my-login' ) , 'url' => 'https://thememylogin.com/extensions' , ) ; $ sidebar_links [ 'account' ] = array ( 'title' => __ ( 'View your Theme My Login account' , 'theme-my-login' ) , 'url' => 'https://thememylogin.com/your-account' , ) ; } elseif ( $ extension = tml_get_extension ( $ plugin_page ) ) { $ help_tabs [ 'overview' ] = array ( 'id' => $ plugin_page . '-overview' , 'title' => __ ( 'Overview' ) , 'content' => '<p>' . implode ( '</p><p>' , array ( sprintf ( __ ( 'On this page, you can configure the settings for the Theme My Login %s extension.' , 'theme-my-login' ) , $ extension -> get_title ( ) ) , __ ( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) , ) ) . '</p>' , ) ; if ( $ documentation_url = $ extension -> get_documentation_url ( ) ) { $ sidebar_links [ 'documentation' ] = array ( 'title' => __ ( 'View Documentation' , 'theme-my-login' ) , 'url' => $ documentation_url , ) ; } if ( $ support_url = $ extension -> get_support_url ( ) ) { $ sidebar_links [ 'support' ] = array ( 'title' => __ ( 'Get Support' , 'theme-my-login' ) , 'url' => $ support_url , ) ; } $ settings_page = $ extension -> get_settings_page_args ( ) ; if ( ! empty ( $ settings_page [ 'help_tabs' ] ) ) { $ help_tabs = array_merge ( $ help_tabs , $ settings_page [ 'help_tabs' ] ) ; } if ( ! empty ( $ settings_page [ 'help_sidebar_links' ] ) ) { $ sidebar_links = array_merge ( $ sidebar_links , $ settings_page [ 'help_sidebar_links' ] ) ; } } if ( ! empty ( $ help_tabs ) ) { foreach ( $ help_tabs as $ help_tab ) { $ screen -> add_help_tab ( $ help_tab ) ; } } if ( ! empty ( $ sidebar_links ) ) { $ sidebar_content = '<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' ; foreach ( $ sidebar_links as $ sidebar_link ) { $ sidebar_content .= sprintf ( '<p><a href="%s">%s</a></p>' , $ sidebar_link [ 'url' ] , $ sidebar_link [ 'title' ] ) ; } $ screen -> set_help_sidebar ( $ sidebar_content ) ; } }
Add contextual help to settings pages.
Add contextual help to settings pages .
// Core page // Licenses page // Extensions page // Extension page // Add the help tabs // Add the sidebar links