properties['choices'] = array(); } /** * Adds a choice 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 null|string $image The image accompanying the choice. */ public function add_choice( $title, $copy, $button, $image = null ) { $choice = array( 'title' => $title, 'copy' => $copy, 'button' => $button, ); if ( ! empty( $image ) ) { $choice['image'] = $image; } $this->properties['choices'][] = $choice; } }