PHP Class Crunion_Contact_Form_Shortcode, jetpack

Does nothing other than store structured data and output the shortcode as a string Not very general - specific to Grunion.
Show file Open project: automattic/jetpack Class Usage Examples

Public Properties

Property Type Description
$attributes key => value pairs for the shortcode's attributes: [$shortcode_name key="value" ... /]
$body The HTML of the parsed inner "child" shortcodes". Null for selfclosing shortcodes.
$content Null for selfclosing shortcodes. Hhe inner content of otherwise: [$shortcode_name]$content[/$shortcode_name]
$defaults key => value pair for attribute defaults
$fields Associative array of inner "child" shortcodes equivalent to the $content: [$shortcode_name][child 1/][child 2/][/$shortcode_name]
$shortcode_name the name of the shortcode: [$shortcode_name /]

Public Methods

Method Description
__construct ( array $attributes, null | string $content = null )
__toString ( ) Generates the shortcode
esc_attr ( $value )
get_attribute ( string $key ) : mixed Returns the value of the requested attribute.
parse_content ( string $content ) Processes the shortcode's inner content for "child" shortcodes
unesc_attr ( $value )

Method Details

__construct() public method

public __construct ( array $attributes, null | string $content = null )
$attributes array An associative array of shortcode attributes. @see shortcode_atts()
$content null | string Null for selfclosing shortcodes. The inner content otherwise.

__toString() public method

Generates the shortcode
public __toString ( )

esc_attr() public method

public esc_attr ( $value )

get_attribute() public method

Returns the value of the requested attribute.
public get_attribute ( string $key ) : mixed
$key string The attribute to retrieve
return mixed

parse_content() public method

Processes the shortcode's inner content for "child" shortcodes
public parse_content ( string $content )
$content string The shortcode's inner content: [shortcode]$content[/shortcode]

unesc_attr() public method

public unesc_attr ( $value )

Property Details

$attributes public property

key => value pairs for the shortcode's attributes: [$shortcode_name key="value" ... /]
public $attributes

$body public property

The HTML of the parsed inner "child" shortcodes". Null for selfclosing shortcodes.
public $body

$content public property

Null for selfclosing shortcodes. Hhe inner content of otherwise: [$shortcode_name]$content[/$shortcode_name]
public $content

$defaults public property

key => value pair for attribute defaults
public $defaults

$fields public property

Associative array of inner "child" shortcodes equivalent to the $content: [$shortcode_name][child 1/][child 2/][/$shortcode_name]
public $fields

$shortcode_name public property

the name of the shortcode: [$shortcode_name /]
public $shortcode_name