PHP Class MC4WP_Admin

Datei anzeigen Open project: dannyvankooten/mailchimp-for-wordpress Class Usage Examples

Protected Properties

Property Type Description
$ads MC4WP_Admin_Ads
$mailchimp MC4WP_MailChimp
$messages MC4WP_Admin_Messages
$plugin_file The relative path to the main plugin file from the plugins dir
$tools MC4WP_Admin_Tools

Public Methods

Method Description
__construct ( MC4WP_Admin_Tools $tools, MC4WP_Admin_Messages $messages, MC4WP_MailChimp $mailchimp ) Constructor
add_hooks ( ) Registers all hooks
add_menu_item ( array $item )
build_menu ( ) Register the setting pages and their menu items
customize_admin_texts ( ) Customize texts throughout WP Admin
dismiss_api_key_notice ( ) Dismisses the API key notice for 1 week
empty_debug_log ( ) Empties the log file
enqueue_assets ( ) : boolean Load scripts and stylesheet on MailChimp for WP Admin pages
initialize ( ) Initializes various stuff used in WP Admin
listen_for_actions ( ) Listen for _mc4wp_action requests
register_dashboard_widgets ( ) Register dashboard widgets
renew_lists_cache ( ) Renew MailChimp lists cache
save_general_settings ( array $settings ) : array Validates the General settings
show_api_key_notice ( ) Shows a notice when API key is not set.
show_generals_setting_page ( ) Show the API Settings page
show_other_setting_page ( ) Show the Other Settings page
sort_menu_items_by_position ( $a, $b ) : integer

Protected Methods

Method Description
get_api ( ) : MC4WP_API_v3
get_log ( ) : MC4WP_Debug_Log

Private Methods

Method Description
init_upgrade_routines ( ) Upgrade routine
load_translations ( ) Load the plugin translations

Method Details

__construct() public method

Constructor
public __construct ( MC4WP_Admin_Tools $tools, MC4WP_Admin_Messages $messages, MC4WP_MailChimp $mailchimp )
$tools MC4WP_Admin_Tools
$messages MC4WP_Admin_Messages
$mailchimp MC4WP_MailChimp

add_hooks() public method

Registers all hooks
public add_hooks ( )

add_menu_item() public method

public add_menu_item ( array $item )
$item array

build_menu() public method

Register the setting pages and their menu items
public build_menu ( )

customize_admin_texts() public method

Customize texts throughout WP Admin

dismiss_api_key_notice() public method

Dismisses the API key notice for 1 week

empty_debug_log() public method

Empties the log file
public empty_debug_log ( )

enqueue_assets() public method

Load scripts and stylesheet on MailChimp for WP Admin pages
public enqueue_assets ( ) : boolean
return boolean

get_api() protected method

protected get_api ( ) : MC4WP_API_v3
return MC4WP_API_v3

get_log() protected method

protected get_log ( ) : MC4WP_Debug_Log
return MC4WP_Debug_Log

initialize() public method

- Registers settings
public initialize ( )

listen_for_actions() public method

Listen for _mc4wp_action requests
public listen_for_actions ( )

register_dashboard_widgets() public method

Register dashboard widgets

renew_lists_cache() public method

Renew MailChimp lists cache
public renew_lists_cache ( )

save_general_settings() public method

Validates the General settings
public save_general_settings ( array $settings ) : array
$settings array
return array

show_api_key_notice() public method

Shows a notice when API key is not set.
public show_api_key_notice ( )

show_generals_setting_page() public method

Show the API Settings page

show_other_setting_page() public method

Show the Other Settings page

sort_menu_items_by_position() public method

public sort_menu_items_by_position ( $a, $b ) : integer
$a
$b
return integer

Property Details

$ads protected_oe property

protected MC4WP_Admin_Ads $ads
return MC4WP_Admin_Ads

$mailchimp protected_oe property

protected MC4WP_MailChimp $mailchimp
return MC4WP_MailChimp

$messages protected_oe property

protected MC4WP_Admin_Messages $messages
return MC4WP_Admin_Messages

$plugin_file protected_oe property

The relative path to the main plugin file from the plugins dir
protected $plugin_file

$tools protected_oe property

protected MC4WP_Admin_Tools $tools
return MC4WP_Admin_Tools