Yoast_Form::get_disabled_note()protectedYoast 1.0

Gets the explanation note to print if a given control is disabled.

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

Хуков нет.

Возвращает

Строку. Explanation note HTML string, or empty string if no note necessary.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_disabled_note( $variable, $custom_note );
$variable(строка) (обязательный)
The variable within the option to print a disabled note for.
$custom_note(строка)
An optional custom note to print instead.
По умолчанию: ''

Код Yoast_Form::get_disabled_note() Yoast 19.7.1

protected function get_disabled_note( $variable, $custom_note = '' ) {
	if ( $custom_note === '' && ! $this->is_control_disabled( $variable ) ) {
		return '';
	}
	$disabled_message = esc_html__( 'This feature has been disabled by the network admin.', 'wordpress-seo' );

	// The explanation to show when disabling the Usage tracking feature for multisite subsites.
	if ( $this->is_tracking_on_subsite( $variable ) ) {
		$disabled_message = esc_html__( 'This feature has been disabled since subsites never send tracking data.', 'wordpress-seo' );
	}

	if ( $custom_note ) {
		$disabled_message = esc_html( $custom_note );
	}

	return '<p class="disabled-note">' . $disabled_message . '</p>';
}