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

Yoast_License_Manager::display_admin_notices() public Yoast 1.0

Display license specific admin notices, namely:

  • License for the product isn't activated
  • External requests are blocked through WP_HTTP_BLOCK_EXTERNAL

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

Хуков нет.

Возвращает

Null. Ничего.

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

$Yoast_License_Manager = new Yoast_License_Manager();
$Yoast_License_Manager->display_admin_notices();

Код Yoast_License_Manager::display_admin_notices() Yoast 15.1.1

<?php
public function display_admin_notices() {

	if ( ! current_user_can( 'manage_options' ) ) {
		return;
	}

	// show notice if license is invalid
	if ( $this->show_license_notice() && ! $this->license_is_valid() ) {
		if ( $this->get_license_key() == '' ) {
			$message = __( '<b>Warning!</b> You didn\'t set your %s license key yet, which means you\'re missing out on updates and support! <a href="%s">Enter your license key</a> or <a href="%s" target="_blank">get a license here</a>.' );
		} else {
			$message = __( '<b>Warning!</b> Your %s license is inactive which means you\'re missing out on updates and support! <a href="%s">Activate your license</a> or <a href="%s" target="_blank">get a license here</a>.' );
		}
		?>
                <div class="notice notice-error yoast-notice-error">
                    <p><?php printf( __( $message, $this->product->get_text_domain() ), $this->product->get_item_name(), $this->product->get_license_page_url(), $this->product->get_tracking_url( 'activate-license-notice' ) ); ?></p>
                </div>
		<?php
	}

	// show notice if external requests are blocked through the WP_HTTP_BLOCK_EXTERNAL constant
	if ( defined( "WP_HTTP_BLOCK_EXTERNAL" ) && WP_HTTP_BLOCK_EXTERNAL === true ) {

		// check if our API endpoint is in the allowed hosts
		$host = parse_url( $this->product->get_api_url(), PHP_URL_HOST );

		if ( ! defined( "WP_ACCESSIBLE_HOSTS" ) || stristr( WP_ACCESSIBLE_HOSTS, $host ) === false ) {
			?>
                    <div class="notice notice-error yoast-notice-error">
                        <p><?php printf( __( '<b>Warning!</b> You\'re blocking external requests which means you won\'t be able to get %s updates. Please add %s to %s.', $this->product->get_text_domain() ), $this->product->get_item_name(), '<strong>' . $host . '</strong>', '<code>WP_ACCESSIBLE_HOSTS</code>' ); ?></p>
                    </div>
			<?php
		}

	}
}