PHP Class MC4WP_Dynamic_Content_Tags

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

Public Properties

Property Type Description
$context string

Protected Properties

Property Type Description
$escape_mode The escape mode for replacement values.
$tags Array of registered dynamic content tags

Public Methods

Method Description
__construct ( string $context, $tags = [] )
all ( ) : array Return all registered tags
replace ( string $string, string $escape_mode = '' ) : string
replace_in_attributes ( string $string ) : string
replace_in_html ( string $string ) : string
replace_in_url ( string $string ) : string

Protected Methods

Method Description
escape_value ( $value ) : mixed
escape_value_attributes ( $value ) : string
escape_value_html ( $value ) : string
escape_value_url ( $value ) : string
replace_tag ( $matches ) : string

Method Details

__construct() public method

public __construct ( string $context, $tags = [] )
$context string

all() public method

Return all registered tags
public all ( ) : array
return array

escape_value() protected method

protected escape_value ( $value ) : mixed
$value
return mixed

escape_value_attributes() protected method

protected escape_value_attributes ( $value ) : string
$value
return string

escape_value_html() protected method

protected escape_value_html ( $value ) : string
$value
return string

escape_value_url() protected method

protected escape_value_url ( $value ) : string
$value
return string

replace() public method

public replace ( string $string, string $escape_mode = '' ) : string
$string string The string containing dynamic content tags.
$escape_mode string Escape mode for the replacement value. Leave empty for no escaping.
return string

replace_in_attributes() public method

public replace_in_attributes ( string $string ) : string
$string string
return string

replace_in_html() public method

public replace_in_html ( string $string ) : string
$string string
return string

replace_in_url() public method

public replace_in_url ( string $string ) : string
$string string
return string

replace_tag() protected method

protected replace_tag ( $matches ) : string
$matches
return string

Property Details

$context public property

public string $context
return string

$escape_mode protected property

The escape mode for replacement values.
protected $escape_mode

$tags protected property

Array of registered dynamic content tags
protected $tags