PHP Class WPDKPostMeta

Since: 1.5.13
Author: =undo= ([email protected])
Datei anzeigen Open project: wpxtreme/wpdk

Public Properties

Property Type Description
$meta array List of meta key with property and label info.
$post WPDKPost An instance of WPDKPost class.

Public Methods

Method Description
__construct ( WPDKPost $post = null ) : WPDKPostMeta Create aninstance of WPDKPostMeta class
add ( string $meta_key, string $property = '', mixed $default = false, string $label = '' ) : array Add a meta key.
mapToPost ( boolean $create_property = true ) : WPDKPost Map the post meta property (if defined) to post.
meta ( ) : array Register meta keys. Use
update ( ) Update post meta by using WPDKPost object properties.
updateWithArray ( integer $post_id, array $values ) Update post meta by using an array.

Method Details

__construct() public method

Create aninstance of WPDKPostMeta class
public __construct ( WPDKPost $post = null ) : WPDKPostMeta
$post WPDKPost Optional. An instance of WPDKPost class.
return WPDKPostMeta

add() public method

Add a meta key.
public add ( string $meta_key, string $property = '', mixed $default = false, string $label = '' ) : array
$meta_key string Meta key.
$property string Optional. Object proprty name.
$default mixed Optional. Default value.
$label string Optional. Label definition.
return array

mapToPost() public method

Map the post meta property (if defined) to post.
public mapToPost ( boolean $create_property = true ) : WPDKPost
$create_property boolean Optional. Default TRUE when in the target object the property doesn't exists then it is dynamically created. Set FALSE to map only the existing properties.
return WPDKPost

meta() public method

$this->add( self::META_KEY_BANNER_EXTERNAL_URL, 'banner_external_url', '', __( 'External URL', WPXBANNERIZE_TEXTDOMAIN ) );
public meta ( ) : array
return array

update() public method

Update post meta by using WPDKPost object properties.
public update ( )

updateWithArray() public static method

Update post meta by using an array.
public static updateWithArray ( integer $post_id, array $values )
$post_id integer The post ID.
$values array A key value pairs array with key as post meta key and value as post meta value.

Property Details

$meta public_oe property

List of meta key with property and label info.
public array $meta
return array

$post public_oe property

An instance of WPDKPost class.
public WPDKPost $post
return WPDKPost