PHP Class MC4WP_Form_Element

Since: 3.0
Show file Open project: dannyvankooten/mailchimp-for-wordpress Class Usage Examples

Public Properties

Property Type Description
$ID string
$config array Can be used to set element-specific config settings. Accepts the following keys. - lists: Customized number of MailChimp list ID's to subscribe to. - email_type: The email type
$form MC4WP_Form
$is_submitted boolean

Public Methods

Method Description
__construct ( MC4WP_Form $form, string $ID, $config = [] )
generate_html ( array $config = null ) : string
get_response_html ( boolean $force_show = false ) : string Gets the form response string

Protected Methods

Method Description
get_css_classes ( ) : string Get a space separated list of CSS classes for this form
get_form_element_attributes ( ) : string Get all HTMl attributes for the form element
get_hidden_fields ( ) : string
get_html_after_fields ( ) : string Get HTML to be added _after_ the HTML of the form fields.
get_html_before_fields ( ) : string Get HTML to be added _before_ the HTML of the form fields.
get_message_html ( string $key ) : string Get HTML string for a message, including wrapper element.
get_response_position ( ) : string
get_visible_fields ( ) : string

Method Details

__construct() public method

public __construct ( MC4WP_Form $form, string $ID, $config = [] )
$form MC4WP_Form
$ID string
$config array

generate_html() public method

public generate_html ( array $config = null ) : string
$config array Use this to override the configuration for this form element
return string

get_css_classes() protected method

Get a space separated list of CSS classes for this form
protected get_css_classes ( ) : string
return string

get_form_element_attributes() protected method

Get all HTMl attributes for the form element
protected get_form_element_attributes ( ) : string
return string

get_hidden_fields() protected method

protected get_hidden_fields ( ) : string
return string

get_html_after_fields() protected method

Get HTML to be added _after_ the HTML of the form fields.
protected get_html_after_fields ( ) : string
return string

get_html_before_fields() protected method

Get HTML to be added _before_ the HTML of the form fields.
protected get_html_before_fields ( ) : string
return string

get_message_html() protected method

Get HTML string for a message, including wrapper element.
protected get_message_html ( string $key ) : string
$key string
return string

get_response_html() public method

Gets the form response string
public get_response_html ( boolean $force_show = false ) : string
$force_show boolean
return string

get_response_position() protected method

protected get_response_position ( ) : string
return string

get_visible_fields() protected method

protected get_visible_fields ( ) : string
return string

Property Details

$ID public property

public string $ID
return string

$config public property

Can be used to set element-specific config settings. Accepts the following keys. - lists: Customized number of MailChimp list ID's to subscribe to. - email_type: The email type
public array $config
return array

$form public property

public MC4WP_Form $form
return MC4WP_Form

$is_submitted public property

public bool $is_submitted
return boolean