WPSEO_Config_Field_Suggestions

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

Defined (1)

The class is defined in the following location(s).

/admin/config-ui/fields/class-field-suggestions.php  
  1. class WPSEO_Config_Field_Suggestions extends WPSEO_Config_Field { 
  2.  
  3. /** 
  4. * WPSEO_Config_Field_Suggestions constructor. 
  5. */ 
  6. public function __construct() { 
  7. parent::__construct( 'suggestions', 'Suggestions' ); 
  8.  
  9. $this->properties['suggestions'] = array(); 
  10.  
  11. /** 
  12. * Adds a suggestion to the properties 
  13. * @param string $title The title of the choice. 
  14. * @param string $copy The text explaining the choice. 
  15. * @param array $button The button details. 
  16. * @param null|string $video The video accompanying the choice. 
  17. */ 
  18. public function add_suggestion( $title, $copy, $button, $video = null ) { 
  19. $suggestion = array( 
  20. 'title' => $title,  
  21. 'copy' => $copy,  
  22. 'button' => $button,  
  23. ); 
  24.  
  25. if ( ! empty( $video ) ) { 
  26. $suggestion['video'] = $video; 
  27.  
  28. $this->properties['suggestions'][] = $suggestion;