WPSEO_Config_Field_Configuration_Choices

Holds the choices for the Configuration method to be chosen in the first step of the wizard.

Defined (1)

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

/admin/config-ui/fields/class-field-configuration-choices.php  
  1. class WPSEO_Config_Field_Configuration_Choices extends WPSEO_Config_Field { 
  2.  
  3. /** 
  4. * WPSEO_Config_Field_Choice constructor. 
  5. */ 
  6. public function __construct() { 
  7. parent::__construct( 'configurationChoices', 'ConfigurationChoices' ); 
  8.  
  9. $this->properties['choices'] = array(); 
  10.  
  11. /** 
  12. * Adds a choice 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 $image The image accompanying the choice. 
  17. */ 
  18. public function add_choice( $title, $copy, $button, $image = null ) { 
  19. $choice = array( 
  20. 'title' => $title,  
  21. 'copy' => $copy,  
  22. 'button' => $button,  
  23. ); 
  24.  
  25. if ( ! empty( $image ) ) { 
  26. $choice['image'] = $image; 
  27.  
  28. $this->properties['choices'][] = $choice;