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

Yoast_License_Manager::get_successful_activation_message() protected Yoast 1.0

Determine what message should be shown for a successful license activation

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

Хуков нет.

Возвращает

Строку.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_successful_activation_message( $result );
$result(объект) (обязательный)
Result of a request.

Код Yoast_License_Manager::get_successful_activation_message() Yoast 15.1.1

<?php
protected function get_successful_activation_message( $result ) {
	// Get expiry date.
	if ( isset( $result->expires ) ) {
		$this->set_license_expiry_date( $result->expires );
		$expiry_date = strtotime( $result->expires );
	} else {
		$expiry_date = false;
	}

	// Always show that it was successful.
	$message = sprintf( __( "Your %s license has been activated. ", $this->product->get_text_domain() ), $this->product->get_item_name() );

	// Show a custom notice it is an unlimited license.
	if ( $result->license_limit == 0 ) {
		$message .= __( "You have an unlimited license. ", $this->product->get_text_domain() );
	} else {
		$message .= sprintf( _n( "You have used %d/%d activation. ", "You have used %d/%d activations. ", $result->license_limit, $this->product->get_text_domain() ), $result->site_count, $result->license_limit );
	}

	// add upgrade notice if user has less than 3 activations left
	if ( $result->license_limit > 0 && ( $result->license_limit - $result->site_count ) <= 3 ) {
		$message .= sprintf( __( '<a href="%s">Did you know you can upgrade your license?</a> ', $this->product->get_text_domain() ), $this->product->get_extension_url( 'license-nearing-limit-notice' ) );
	}

	if ( $expiry_date !== false && $expiry_date < strtotime( "+1 month" ) ) {
		// Add extend notice if license is expiring in less than 1 month.
		$days_left = round( ( $expiry_date - time() ) / 86400 );
		$message .= sprintf( _n( '<a href="%s">Your license is expiring in %d day, would you like to extend it?</a> ', '<a href="%s">Your license is expiring in %d days, would you like to extend it?</a> ', $days_left, $this->product->get_text_domain() ), $this->product->get_extension_url( 'license-expiring-notice' ), $days_left );
	}

	return $message;
}