Property | Type | Description | |
---|---|---|---|
$ID | The form ID, matches the underlying post its ID | ||
$config | array | ||
$content | The form HTML content | ||
$errors | Array of error codes | ||
$instances | Array of instantiated form objects. | ||
$is_submitted | Was this form submitted? | ||
$messages | Array of message codes that will show when this form renders | ||
$name | The form name | ||
$post | The internal post object that represents this form. | ||
$raw_data | Array of the raw form data that was submitted. | ||
$settings | Array of settings |
Property | Type | Description | |
---|---|---|---|
$post_meta | Raw array or post_meta values. |
Method | Description | |
---|---|---|
__construct ( integer $id ) | ||
__get ( string $name ) : mixed | ||
__toString ( ) : string | Output this form | |
add_error ( string $error_code ) | Add an error to this form | |
add_message ( $key ) | ||
get_action ( ) : string | Get the form action | |
get_data ( ) : array | ||
get_element ( string $element_id = 'mc4wp-form', array $config = [] ) : MC4WP_Form_element | ||
get_email_type ( ) : string | Get "email_type" setting for new MailChimp subscribers added by this form. | |
get_field_types ( ) : array | Get an array of field types which are present in this form. | |
get_html ( string $element_id = 'mc4wp-form', array $config = [] ) : string | Get HTML string for this form. | |
get_instance ( integer | WP_Post $form_id ) : MC4WP_Form | Get a shared form instance. | |
get_lists ( ) : array | Get MailChimp lists this form subscribes to | |
get_message ( string $key ) : MC4WP_Form_Message | Get message object | |
get_message_html ( string $key ) : string | Get HTML string for a message, including wrapper element. | |
get_redirect_url ( ) : string | Get "redirect to url after success" setting for this form | |
get_required_fields ( ) : array | Get array of name attributes for the required fields in this form. | |
get_response_html ( ) : string | Gets the form response string | |
get_stylesheet ( ) : string | Gets the filename of the stylesheet to load for this form. | |
handle_request ( MC4WP_Request $request ) : void | Handle an incoming request. Should be called before calling validate() method. | |
has_errors ( ) : boolean | Does this form have errors? | |
has_field_type ( $type ) : boolean | Does this form has a field of the given type? | |
set_config ( array $config ) : array | Update configuration for this form | |
validate ( ) : boolean | Is this form valid? |
Method | Description | |
---|---|---|
load_messages ( ) : array | ||
load_settings ( ) : array | ||
parse_request_data ( MC4WP_Request $request ) : array | Parse a request for data which should be binded to $data property. |
public get_action ( ) : string | ||
return | string |
public get_element ( string $element_id = 'mc4wp-form', array $config = [] ) : MC4WP_Form_element | ||
$element_id | string | |
$config | array | |
return | MC4WP_Form_element |
public get_email_type ( ) : string | ||
return | string |
public get_field_types ( ) : array | ||
return | array |
public static get_instance ( integer | WP_Post $form_id ) : MC4WP_Form | ||
$form_id | integer | WP_Post | |
return | MC4WP_Form |
public get_message ( string $key ) : MC4WP_Form_Message | ||
$key | string | |
return | MC4WP_Form_Message |
public get_message_html ( string $key ) : string | ||
$key | string | |
return | string |
public get_redirect_url ( ) : string | ||
return | string |
public get_required_fields ( ) : array | ||
return | array |
public get_response_html ( ) : string | ||
return | string |
public get_stylesheet ( ) : string | ||
return | string |
public handle_request ( MC4WP_Request $request ) : void | ||
$request | MC4WP_Request | |
return | void |
public has_errors ( ) : boolean | ||
return | boolean |
public has_field_type ( $type ) : boolean | ||
$type | ||
return | boolean |
protected parse_request_data ( MC4WP_Request $request ) : array | ||
$request | MC4WP_Request | |
return | array |
public set_config ( array $config ) : array | ||
$config | array | |
return | array |
public static $instances |
public $messages |