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

WPSEO_Config_Field_Suggestions{} Yoast 1.0

Holds the suggestions for the 'You might also like' page in the wizard.

Хуков нет.

Возвращает

Null. Ничего.

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

$WPSEO_Config_Field_Suggestions = new WPSEO_Config_Field_Suggestions();
// use class methods

Методы

  1. __construct()
  2. add_suggestion( $title, $copy, $button, array $video = [] )

Код WPSEO_Config_Field_Suggestions{} Yoast 15.1.1

<?php
class WPSEO_Config_Field_Suggestions extends WPSEO_Config_Field {

	/**
	 * WPSEO_Config_Field_Suggestions constructor.
	 */
	public function __construct() {
		parent::__construct( 'suggestions', 'Suggestions' );

		$this->properties['suggestions'] = [];
	}

	/**
	 * Adds a suggestion to the properties.
	 *
	 * @param string $title  The title of the choice.
	 * @param string $copy   The text explaining the choice.
	 * @param array  $button The button details.
	 * @param array  $video  URL and title of the video accompanying the choice.
	 */
	public function add_suggestion( $title, $copy, $button, array $video = [] ) {
		$suggestion = [
			'title'  => $title,
			'copy'   => $copy,
			'button' => $button,
		];

		if ( ! empty( $video ) ) {
			$suggestion['video'] = $video;
		}

		$this->properties['suggestions'][] = $suggestion;
	}
}