PHP Class MC4WP_Forms_Admin

显示文件 Open project: dannyvankooten/mailchimp-for-wordpress Class Usage Examples

Protected Properties

Property Type Description
$mailchimp MC4WP_MailChimp
$messages MC4WP_Admin_Messages

Public Methods

Method Description
__construct ( MC4WP_Admin_Messages $messages, MC4WP_MailChimp $mailchimp )
add_hooks ( ) Add hooks
add_menu_item ( $items ) : mixed
enqueue_assets ( string $suffix, string $page = '' )
prepare_form_preview ( ) Prepares a Form Preview
process_add_form ( ) Act on the "add form" form
process_save_form ( ) Saves a form
redirect_to_form_action ( ) Redirect to correct form action
register_shortcake_ui ( ) Registers UI for when shortcake is activated
sanitize_form_data ( array $data ) : array
save_form ( array $data ) : integer Saves a form to the database
show_add_page ( ) Shows the "Add Form" page
show_edit_page ( ) Show the "Edit Form" page
show_forms_page ( ) Show the Forms Settings page
tab_url ( $tab ) : string Get URL for a tab on the current page.
update_form_stylesheets ( ) Goes through each form and aggregates array of stylesheet slugs to load.

Private Methods

Method Description
set_default_form_id ( integer $form_id )

Method Details

__construct() public method

public __construct ( MC4WP_Admin_Messages $messages, MC4WP_MailChimp $mailchimp )
$messages MC4WP_Admin_Messages
$mailchimp MC4WP_MailChimp

add_hooks() public method

Add hooks
public add_hooks ( )

add_menu_item() public method

public add_menu_item ( $items ) : mixed
$items
return mixed

enqueue_assets() public method

public enqueue_assets ( string $suffix, string $page = '' )
$suffix string
$page string

prepare_form_preview() public method

Prepares a Form Preview

process_add_form() public method

Act on the "add form" form
public process_add_form ( )

process_save_form() public method

Saves a form
public process_save_form ( )

redirect_to_form_action() public method

Redirect to correct form action

register_shortcake_ui() public method

Registers UI for when shortcake is activated

sanitize_form_data() public method

public sanitize_form_data ( array $data ) : array
$data array
return array

save_form() public method

Saves a form to the database
public save_form ( array $data ) : integer
$data array
return integer

show_add_page() public method

Shows the "Add Form" page
public show_add_page ( )

show_edit_page() public method

Show the "Edit Form" page
public show_edit_page ( )

show_forms_page() public method

Show the Forms Settings page
public show_forms_page ( )

tab_url() public method

Get URL for a tab on the current page.
Since: 3.0
public tab_url ( $tab ) : string
$tab
return string

update_form_stylesheets() public method

Goes through each form and aggregates array of stylesheet slugs to load.

Property Details

$mailchimp protected_oe property

protected MC4WP_MailChimp $mailchimp
return MC4WP_MailChimp

$messages protected_oe property

protected MC4WP_Admin_Messages $messages
return MC4WP_Admin_Messages