WPDK
1.5.0
WordPress Development Kit
|
Public Member Functions | |
__construct ($tag_name) | |
addData ($name, $value) | |
Add data attribute. More... | |
addClass ($class) | |
Add CSS Class. More... | |
display () | |
Display. More... | |
html () | |
Return the HTML markup for this tag. More... | |
draw () | |
Draw. More... | |
setPropertiesByArray ($properties=array()) | |
Set properties by array. More... | |
Public Member Functions inherited from WPDKObject | |
__className () | |
Returns the class object. More... | |
__parentClass () | |
Returns the class object for the receiver’s superclass. More... | |
__isClass ($class) | |
Brief. More... | |
__isSubclassOfClass ($class) | |
Return TRUE if the receiving class is a subclass of —or identical to— $class, otherwise FALSE. More... | |
Static Public Member Functions | |
static | sanitizeAttributes ($attributes) |
Sanitize attributes. More... | |
static | sanitizeData ($attributes) |
Sanitize data attributes. More... | |
static | sanitizeClasses ($classes) |
Sanitize CSS Classes list. More... | |
static | sanitizeStyles ($styles) |
Sanitize CSS Classes list. More... | |
static | attributeInline ($attributes, $additional_attributes=false) |
Inline Data attribute. More... | |
static | dataInline ($data, $additional_data=false) |
Inline Data attribute. More... | |
static | classInline ($classes, $additional_classes=false) |
Inline CSS class. More... | |
static | styleInline ($styles, $additional_styles=false) |
Inline CSS class. More... | |
static | mergeClasses ($class, $class2=null, $_=null) |
Merge. More... | |
Static Public Member Functions inherited from WPDKObject | |
static | __delta ($last_version, $old_version) |
Object delta compare for combine. More... | |
static | delta ($last_version, $old_version) |
static | __dump ($var, $monitor=false) |
Dump a variable. More... | |
Data Fields | |
$__version = '1.1.1' | |
Version. More... | |
$accesskey = '' | |
$class = array() | |
$content = '' | |
Content. More... | |
$contenteditable | |
$contextmenu | |
$data = array() | |
Data attribute. More... | |
$dir | |
$draggable | |
$dropzone | |
$hidden | |
$id | |
$lang | |
$onclick | |
$spellcheck | |
$style | |
$tabindex | |
$tagName | |
Tag name. More... | |
$title | |
Data Fields inherited from WPDKObject | |
$__version = '1.0.0' | |
The version number assigned to the class. More... | |
Protected Member Functions | |
beforeContent () | |
Before content. More... | |
afterContent () | |
After content. More... | |
Protected Attributes | |
$attributes = array() | |
Attributes list. More... | |
$close | |
Close tag. More... | |
$open | |
Open tag. More... | |
Generic HTML model. This class is sub class from above class. Thanks to http://www.w3schools.com/tags/default.asp for definitions
Definition at line 13 of file wpdk-html-tag.php.
__construct | ( | $tag_name | ) |
Create an instance of WPDKHTMLTag class
string | $tag_name |
Definition at line 125 of file wpdk-html-tag.php.
addClass | ( | $class | ) |
Add CSS Class.
Utility to add a class. You can access directly to class
array property instead
string | $class |
Definition at line 173 of file wpdk-html-tag.php.
addData | ( | $name, | |
$value | |||
) |
Add data attribute.
Utility to add a data attribute. You can access directly to data
array property instead
string | $name | Data attribute name |
string | $value | Data attribute value |
Definition at line 158 of file wpdk-html-tag.php.
|
protected |
After content.
Override this method to display anything after the content output
Definition at line 289 of file wpdk-html-tag.php.
|
static |
Inline Data attribute.
Return a inline generic attribute
$data = array( 'color' => 'red', 'size' => 12 ); echo self::attributeInline( $data, array( 'modal' => "true" ) ); // 'color="red" size="12" modal="true"'
array | $attributes | Key value pairs array with data attribute list |
array | bool | $additional_attributes | Optional. Additional data |
Definition at line 478 of file wpdk-html-tag.php.
|
protected |
Before content.
Override this method to display anything before the content output
Definition at line 267 of file wpdk-html-tag.php.
|
static |
Inline CSS class.
Return a sanitize and inline list of css classes
$classes = array( 'color', 'modal', ); echo self::classInline( $classes, array( 'modal', 'hide' ) ); // 'color modal hide' echo self::classInline( $classes, 'delta modal' ); // 'color delta modal'
array | string | $classes | List of css classes |
array | bool | $additional_classes | Optional. Additional classes |
Definition at line 546 of file wpdk-html-tag.php.
|
static |
Inline Data attribute.
Return a inline data attribute
$data = array( 'color' => 'red', 'size' => 12 ); echo self::dataInline( $data, array( 'modal' => "true" ) ); // 'data-color="red" data-size="12" data-modal="true"'
array | $data | Key value pairs array with data attribute list |
array | bool | $additional_data | Optional. Additional data |
Definition at line 511 of file wpdk-html-tag.php.
display | ( | ) |
draw | ( | ) |
Draw.
Draw the content of tag
Definition at line 279 of file wpdk-html-tag.php.
html | ( | ) |
Return the HTML markup for this tag.
Return the HTML markup for this tag
Definition at line 197 of file wpdk-html-tag.php.
|
static |
Merge.
Merge one or more class
array | string | $class | Initial string or array class to merge |
array | string | $class2 | Optional. |
array | string | $_ | Optional. |
Definition at line 619 of file wpdk-html-tag.php.
|
static |
Sanitize attributes.
Return a key value pairs array with generic attribute list
self::sanitizeAttributes( 'modal="false" modal="true" color=red' ); // array(2) { ["modal"]=> string(5) "true" ["color"]=> string(3) "red" }
string | $attributes | Attribute inline |
Definition at line 327 of file wpdk-html-tag.php.
|
static |
Sanitize CSS Classes list.
Return key value pairs array unique with css class list. In this way you can unset a secified class. If the input is a string (space separate strings) will return an array with css classes.
$class = 'a b c c'; echo self::sanitizeClasses( $class ); array( 'a' => 'a', 'b' => 'b', 'c' => 'c', )
string | array | $classes | Any string or array with classes |
Definition at line 403 of file wpdk-html-tag.php.
|
static |
Sanitize data attributes.
Return a key value pairs array with data attribute list
self::sanitizeAttributes( 'data-modal="false" modal="true" data-color=red' ); // array(2) { ["modal"]=> string(5) "true" ["color"]=> string(3) "red" }
string | $attributes | Data attribute inline |
Definition at line 357 of file wpdk-html-tag.php.
|
static |
Sanitize CSS Classes list.
Return key value pairs array unique with css styke list. In this way you can unset a secified class. If the input is a string (space separate strings) will return an array with css classes.
$style = 'display:block;position:absolute'; echo self::sanitizeStyles( $style ); array( 'display' => 'block', 'position' => 'absolute', )
string | array | $styles | Any string or array with styles |
Definition at line 438 of file wpdk-html-tag.php.
setPropertiesByArray | ( | $properties = array() | ) |
Set properties by array.
Set one or more WPDKHTMLTag properties by an array.
array | $properties | A key value pairs array with the property (key) and its value |
Definition at line 301 of file wpdk-html-tag.php.
|
static |
Inline CSS class.
Return a sanitize and inline list of css styles
$styles = array( 'position' => 'absolute', 'top' => 0, ); echo self::styleInline( $styles, array( 'left' => 0, 'display' => 'block' ) ); // 'position:absolute;top:0;left:0;display:block' echo self::styleInline( $styles, 'display:block' ); // 'position:absolute;top:0;display:block'
array | string | $styles | List of css styles |
array | bool | $additional_styles | Optional. Additional styles |
Definition at line 583 of file wpdk-html-tag.php.
string $__version = '1.1.1' |
$accesskey = '' |
Here there are all late binding tag attributes. Image...
charset coords href classs ...
Definition at line 37 of file wpdk-html-tag.php.
|
protected |
Attributes list.
Override. List of tag attributes that can be used on any HTML element.
Definition at line 89 of file wpdk-html-tag.php.
$class = array() |
Definition at line 38 of file wpdk-html-tag.php.
|
protected |
string $content = '' |
$contenteditable |
Definition at line 48 of file wpdk-html-tag.php.
$contextmenu |
Definition at line 49 of file wpdk-html-tag.php.
array $data = array() |
Data attribute.
Key value pairs array Attribute data: data-attribute = value
Definition at line 58 of file wpdk-html-tag.php.
$dir |
Definition at line 59 of file wpdk-html-tag.php.
$draggable |
Definition at line 60 of file wpdk-html-tag.php.
$dropzone |
Definition at line 61 of file wpdk-html-tag.php.
$hidden |
Definition at line 62 of file wpdk-html-tag.php.
$id |
Definition at line 63 of file wpdk-html-tag.php.
$lang |
Definition at line 64 of file wpdk-html-tag.php.
$onclick |
Definition at line 65 of file wpdk-html-tag.php.
|
protected |
$spellcheck |
Definition at line 66 of file wpdk-html-tag.php.
$style |
Definition at line 67 of file wpdk-html-tag.php.
$tabindex |
Definition at line 68 of file wpdk-html-tag.php.
WPDKHTMLTagName $tagName |
$title |
Definition at line 80 of file wpdk-html-tag.php.