WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
функция не описана

WPSEO_Admin::add_action_link() public Yoast 1.0

Adds links to Premium Support and FAQ under the plugin in the plugin overview page.

{} Это метод класса: WPSEO_Admin{}

Хуков нет.

Возвращает

Массив. $links

Использование

$WPSEO_Admin = new WPSEO_Admin();
$WPSEO_Admin->add_action_link( $links, $file );
$links(массив) (обязательный)
Array of links for the plugins, adapted when the current plugin is found.
$file(строка) (обязательный)
The filename for the current plugin, which the filter loops through.

Заметки

  • Static. Строка. $this_plugin Holds the directory & filename for the plugin.

Код WPSEO_Admin::add_action_link() Yoast 16.2

<?php
public function add_action_link( $links, $file ) {
	if ( WPSEO_BASENAME === $file && WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) {
		if ( is_network_admin() ) {
			$settings_url = network_admin_url( 'admin.php?page=' . self::PAGE_IDENTIFIER );
		}
		else {
			$settings_url = admin_url( 'admin.php?page=' . self::PAGE_IDENTIFIER );
		}
		$settings_link = '<a href="' . esc_url( $settings_url ) . '">' . __( 'Settings', 'wordpress-seo' ) . '</a>';
		array_unshift( $links, $settings_link );
	}

	// Add link to docs.
	$faq_link = '<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/1yc' ) ) . '" target="_blank">' . __( 'FAQ', 'wordpress-seo' ) . '</a>';
	array_unshift( $links, $faq_link );

	$addon_manager = new WPSEO_Addon_Manager();
	if ( YoastSEO()->helpers->product->is_premium() ) {

		// Remove Free 'deactivate' link if Premium is active as well. We don't want users to deactivate Free when Premium is active.
		unset( $links['deactivate'] );
		$no_deactivation_explanation = '<span style="color: #32373c">' . sprintf(
			/* translators: %s expands to Yoast SEO Premium. */
			__( 'Required by %s', 'wordpress-seo' ),
			'Yoast SEO Premium'
		) . '</span>';

		array_unshift( $links, $no_deactivation_explanation );

		if ( $addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG ) ) {
			return $links;
		}

		// Add link to where premium can be activated.
		$activation_link = '<a style="font-weight: bold;" href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/activate-my-yoast' ) ) . '" target="_blank">' . __( 'Activate your subscription', 'wordpress-seo' ) . '</a>';
		array_unshift( $links, $activation_link );

		return $links;
	}

	// Add link to premium landing page.
	$premium_link = '<a style="font-weight: bold;" href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/1yb' ) ) . '" target="_blank">' . __( 'Get Premium', 'wordpress-seo' ) . '</a>';
	array_unshift( $links, $premium_link );

	return $links;
}