PHP Class WPDKPostMeta

Since: 1.5.13
Author: =undo= ([email protected])
Afficher le fichier Open project: wpxtreme/wpdk

Méthodes publiques

Свойство Type Description
$meta array List of meta key with property and label info.
$post WPDKPost An instance of WPDKPost class.

Méthodes publiques

Méthode 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 méthode

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

add() public méthode

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.
Résultat array

mapToPost() public méthode

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.
Résultat WPDKPost

meta() public méthode

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

update() public méthode

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

updateWithArray() public static méthode

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
Résultat array

$post public_oe property

An instance of WPDKPost class.
public WPDKPost $post
Résultat WPDKPost