PHP Class MC4WP_Integration

Afficher le fichier Open project: dannyvankooten/mailchimp-for-wordpress Class Usage Examples

Méthodes publiques

Свойство Type Description
$description Description
$name Name of this integration.
$options Array of settings
$slug Slug, used as an unique identifier for this integration.

Protected Properties

Свойство Type Description
$checkbox_name Name attribute for the checkbox element. Will be created from slug if empty.

Méthodes publiques

Méthode Description
__construct ( string $slug, array $options ) Constructor
checkbox_was_checked ( ) : boolean Was the integration checkbox checked?
get_checkbox_html ( ) : string Get HTML for the checkbox
get_data ( ) : array Get the data for this integration request
get_label_text ( ) : string Get the text for the label element
get_lists ( ) : array Get the selected MailChimp lists
get_object_link ( integer $object_id ) : string Return a string to the admin settings page for this object (if any)
get_ui_elements ( ) : array Which UI elements should we show on the settings page for this integration?
has_ui_element ( $element ) : boolean Does integration have the given UI element?
initialize ( ) Initialize the integration
is_installed ( ) : boolean Are the required dependencies for this integration installed?
output_checkbox ( ) Outputs a checkbox
print_css_reset ( ) Print CSS reset
triggered ( integer $object_id = null ) : boolean Was integration triggered?

Méthodes protégées

Méthode Description
add_hooks ( ) Adds the hooks which are specific to this integration
add_required_hooks ( ) Adds the required hooks for core functionality, like adding checkbox reset CSS.
get_api ( ) : MC4WP_API_v3
get_checkbox_attributes ( ) : string Get a string of attributes for the checkbox element.
get_default_options ( ) : array Return array of default options
get_log ( ) : MC4WP_Debug_Log
get_request ( ) : MC4WP_Request
parse_options ( array $options ) : array
subscribe ( array $data, integer $related_object_id ) : boolean Makes a subscription request

Method Details

__construct() public méthode

Constructor
public __construct ( string $slug, array $options )
$slug string
$options array

add_hooks() abstract protected méthode

Adds the hooks which are specific to this integration
abstract protected add_hooks ( )

add_required_hooks() protected méthode

Adds the required hooks for core functionality, like adding checkbox reset CSS.
protected add_required_hooks ( )

checkbox_was_checked() public méthode

Was the integration checkbox checked?
public checkbox_was_checked ( ) : boolean
Résultat boolean

get_api() protected méthode

protected get_api ( ) : MC4WP_API_v3
Résultat MC4WP_API_v3

get_checkbox_attributes() protected méthode

Get a string of attributes for the checkbox element.
protected get_checkbox_attributes ( ) : string
Résultat string

get_checkbox_html() public méthode

Get HTML for the checkbox
public get_checkbox_html ( ) : string
Résultat string

get_data() public méthode

By default, this will return a combination of all $_GET and $_POST parameters. Override this method if you need data from somewhere else. This data should contain the value of the checkbox (required) and the lists to which should be subscribed (optional)
See also: MC4WP_Integration::$checkbox_name
See also: MC4WP_Integration::get_lists
See also: MC4WP_Integration::checkbox_was_checked
public get_data ( ) : array
Résultat array

get_default_options() protected méthode

Return array of default options
protected get_default_options ( ) : array
Résultat array

get_label_text() public méthode

Get the text for the label element
public get_label_text ( ) : string
Résultat string

get_lists() public méthode

Get the selected MailChimp lists
public get_lists ( ) : array
Résultat array Array of List ID's

get_log() protected méthode

protected get_log ( ) : MC4WP_Debug_Log
Résultat MC4WP_Debug_Log

get_request() protected méthode

protected get_request ( ) : MC4WP_Request
Résultat MC4WP_Request

get_ui_elements() public méthode

Which UI elements should we show on the settings page for this integration?
public get_ui_elements ( ) : array
Résultat array

has_ui_element() public méthode

Does integration have the given UI element?
public has_ui_element ( $element ) : boolean
$element
Résultat boolean

initialize() public méthode

Initialize the integration
public initialize ( )

is_installed() public méthode

Are the required dependencies for this integration installed?
public is_installed ( ) : boolean
Résultat boolean

output_checkbox() public méthode

Outputs a checkbox
public output_checkbox ( )

parse_options() protected méthode

protected parse_options ( array $options ) : array
$options array
Résultat array

print_css_reset() public méthode

Print CSS reset
public print_css_reset ( )

subscribe() protected méthode

Makes a subscription request
protected subscribe ( array $data, integer $related_object_id ) : boolean
$data array
$related_object_id integer
Résultat boolean

triggered() public méthode

Will always return true when integration is implicit. Otherwise, will check value of checkbox.
public triggered ( integer $object_id = null ) : boolean
$object_id integer Useful when overriding method. (optional)
Résultat boolean

Property Details

$checkbox_name protected_oe property

Name attribute for the checkbox element. Will be created from slug if empty.
protected $checkbox_name

$description public_oe property

Description
public $description

$name public_oe property

Name of this integration.
public $name

$options public_oe property

Array of settings
public $options

$slug public_oe property

Slug, used as an unique identifier for this integration.
public $slug