PHP Class Give_Shortcode_Generator, Give

Show file Open project: wordimpress/give Class Usage Examples

Public Properties

Property Type Description
$self The current class name
$shortcode The current shortcode
$shortcode_tag The current shortcode tag

Protected Properties

Property Type Description
$errors Shortcode field errors
$required Required shortcode fields

Public Methods

Method Description
__construct ( string $shortcode ) Class constructor
define_fields ( ) : false | array Define the shortcode attribute fields
init ( ) Kick things off for the shortcode generator
return_textbox_value ( $value ) : boolean Validate Textbox Value

Protected Methods

Method Description
generate_container ( array $field ) : array | false Generate a TinyMCE container field
generate_fields ( array $defined_fields ) : array Generate the shortcode dialog fields
generate_listbox ( array $field ) : array | false Generate a TinyMCE listbox field
generate_post ( array $field ) : array | false Generate a TinyMCE listbox field for a post_type
generate_textbox ( array $field ) : array | false Generate a TinyMCE textbox field
get_fields ( ) : array Get the generated shortcode dialog fields
validate ( array $field ) : boolean Perform validation for a single field

Method Details

__construct() public method

Class constructor
Since: 1.0
public __construct ( string $shortcode )
$shortcode string The shortcode tag

define_fields() public method

Define the shortcode attribute fields
Since: 1.0
public define_fields ( ) : false | array
return false | array

generate_container() protected method

Generate a TinyMCE container field
Since: 1.0
protected generate_container ( array $field ) : array | false
$field array
return array | false

generate_fields() protected method

Generate the shortcode dialog fields
Since: 1.0
protected generate_fields ( array $defined_fields ) : array
$defined_fields array
return array

generate_listbox() protected method

Generate a TinyMCE listbox field
Since: 1.0
protected generate_listbox ( array $field ) : array | false
$field array
return array | false

generate_post() protected method

Generate a TinyMCE listbox field for a post_type
Since: 1.0
protected generate_post ( array $field ) : array | false
$field array
return array | false

generate_textbox() protected method

Generate a TinyMCE textbox field
Since: 1.0
protected generate_textbox ( array $field ) : array | false
$field array
return array | false

get_fields() protected method

Get the generated shortcode dialog fields
Since: 1.0
protected get_fields ( ) : array
return array

init() public method

Kick things off for the shortcode generator
Since: 1.3.0.2
public init ( )

return_textbox_value() public method

Validate Textbox Value
public return_textbox_value ( $value ) : boolean
$value
return boolean

validate() protected method

Returns true or false depending on whether the field has a 'name' attribute. This method also populates the shortcode's $errors and $required arrays.
Since: 1.0
protected validate ( array $field ) : boolean
$field array
return boolean

Property Details

$errors protected property

Shortcode field errors
Since: 1.0
protected $errors

$required protected property

Required shortcode fields
Since: 1.0
protected $required

$self public property

The current class name
Since: 1.0
public $self

$shortcode public property

The current shortcode
Since: 1.0
public $shortcode

$shortcode_tag public property

The current shortcode tag
Since: 1.0
public $shortcode_tag