$this->info= new PostInfo( 1 ); // Info records of post with id = 1
$this->info->option1= "blah"; // set info record with name "option1" to value "blah"
$info_value= $this->info->option1; // get value of info record with name "option1" into variable $info_value
if ( isset ( $this->info->option1 ) ) // test for existence of "option1"
unset ( $this->info->option1 ); // delete "option1" info record
Afficher le fichier
Open project: habari/system
Class Usage Examples
Свойство | Type | Description | |
---|---|---|---|
$post_status_list | static variables to hold post status and post type values | ||
$post_type_list_active | |||
$post_type_list_all | |||
$schema |
Свойство | Type | Description | |
---|---|---|---|
$url_args |
Méthode | Description | |
---|---|---|
__call ( string $name, array $args ) : mixed | Handle calls to this Post object that are implemented by plugins | |
__construct ( array $paramarray = [] ) | Constructor for the Post class. | |
__get ( string $name ) : mixed | Overrides QueryRecord __get to implement custom object properties | |
__isset ( string $name ) : boolean | Overrides QueryRecord __isset to implement custom object properties | |
__set ( string $name, mixed $value ) : mixed | Overrides QueryRecord __set to implement custom object properties | |
__static ( ) | Register plugin hooks | |
activate_post_type ( string $type ) : boolean | Activate an existing post type | |
add_new_status ( string $status, boolean $internal = false ) | inserts a new post status into the database, if it doesn't exist | |
add_new_type ( string $type, boolean $active = true ) | inserts a new post type into the database, if it doesn't exist | |
add_tokens ( array | string $tokens ) | Add a token to a post | |
ascend ( null $params = null ) : |
Returns the ascending post, relative to this post, according to params | |
comment_form ( string $context = 'public' ) : |
Manage this post's comment form | |
content_type ( ) : array | Return the content type of this object | |
create ( array $paramarray ) : |
Create a post and save it. | |
create_default_tokens ( ) | Adds the default tokens to this post when it's saved | |
css_class ( string | array $append = [] ) : string | Returns a list of CSS classes for the post | |
deactivate_post_type ( string $type ) : boolean | Deactivate a post type | |
default_fields ( ) : array | Return the defined database columns for a Post. | |
delete ( ) : boolean | Deletes this post instance | |
delete_post_status ( string $status ) | Delete a post status | |
delete_post_type ( string $type ) : boolean | removes a post type from the database, if it exists and there are no posts of the type | |
delete_tokens ( ) | Deletes all tokens from a post | |
descend ( $params = null ) : |
Returns the descending post, relative to this post, according to params | |
field_load ( string $key ) : mixed | Loads form values from this post | |
field_save ( string $key, mixed $value ) | Stores a form value into this post's info records | |
filter_post_get_7 ( string $content, string $field, |
Filter post content and titles for shortcodes | |
filter_post_status_display_4 ( string $status ) : string | How to display the built-in post statuses. | |
filter_post_type_display_4 ( string $type, string $foruse ) : string | How to display the built-in post types. | |
form_publish_delete ( |
The on_success handler for the delete button on the post editing form | |
form_publish_success ( |
Called when the publish form is successfully submitted | |
get ( array $paramarray = [] ) : |
Return a single requested post. | |
get_access ( |
Returns an access Bitmask for the given user on this post | |
get_form ( string $context ) : |
Returns a form for editing this post | |
get_revision_data ( |
Get the fields of the post that differ from what is stored by date | |
get_schema_map ( ) : array | Get the schema data for this post | |
get_tokens ( ) : array | Returns an array of token ids that are associated with this post Also initializes the internal token array for use by other token operations | |
get_url_args ( ) : array | Returns a set of properties used by URL::get to create URLs | |
has_tokens ( mixed $tokens ) : mixed | Checks if this post has one or more tokens | |
insert ( ) : integer | null | Saves a new post to the posts table | |
list_active_post_types ( boolean $refresh = false ) : array | returns an associative array of active post types | |
list_all_post_types ( boolean $refresh = false ) : array | returns an associative array of all post types | |
list_post_statuses ( mixed $all = true, boolean $refresh = false ) : array | returns an associative array of post statuses | |
list_revisions ( ) : array | List the stored revisions of this post by date and user id | |
publish ( ) : boolean | Updates an existing post to published status | |
remove_tokens ( array | string $tokens ) | Deletes tokens from a post | |
set_revision ( |
Set this post to have the same data as the post on the specified date | |
set_tokens ( mixed $tokens ) | Applies a new set of specific tokens to a post | |
status ( string | integer $name ) : integer | boolean | returns the integer value of the specified post status, or false | |
status_name ( string | integer $status ) : string | null | returns the friendly name of a post status, or null | |
type ( string | integer $name ) : boolean | integer | returns the integer value of the specified post type, or false | |
type_name ( string | integer $type ) : string | returns the friendly name of a post type, or null | |
update ( boolean $minor = true ) : boolean | Updates an existing post in the posts table |
Méthode | Description | |
---|---|---|
get_author ( ) : |
private function get_author() returns a User object for the author of this post | |
get_comment_feed_link ( ) : string | private function get_comment_feed_link Returns the permalink for this post's comments Atom feed | |
get_comments ( ) : |
Gets the comments for the post | |
get_editlink ( ) : string | Returns a URL for the ->editlink property of this class. | |
get_info ( ) : |
function get_info Gets the info object for this post, which contains data from the postinfo table related to this post. | |
get_permalink ( ) : string | Returns a URL for the ->permalink property of this class. | |
get_tags ( ) : |
function get_tags Gets the tags for the post | |
save_tags ( ) : boolean | Save the tags associated to this post into the terms and object_terms tables | |
setguid ( ) | Generate the GUID for the new post. | |
setslug ( ) : string | Generate a new slug for the post. | |
setstatus ( string | integer $value ) : integer | boolean | Sets the status for a post, given a string or integer. |
public __construct ( array $paramarray = [] ) | ||
$paramarray | array | an associative array of initial Post field values. |
public static activate_post_type ( string $type ) : boolean | ||
$type | string | The post type to activate |
Résultat | boolean | True on success |
public static add_new_status ( string $status, boolean $internal = false ) | ||
$status | string | The name of the new post status |
$internal | boolean | Whether this status is for internal use only. If true, this status will NOT be presented to the user |
public static add_new_type ( string $type, boolean $active = true ) | ||
$type | string | The name of the new post type |
$active | boolean | Whether the new post type is active or not |
public add_tokens ( array | string $tokens ) | ||
$tokens | array | string | The name of the permission to add, or an array of permissions to add |
public comment_form ( string $context = 'public' ) : |
||
$context | string | The context in which the form is used, used to facilitate plugin alteration of the comment form in different circumstances |
Résultat | The comment form for this post |
public content_type ( ) : array | ||
Résultat | array | An array of content types that this object represents, starting with the most specific |
public create_default_tokens ( ) |
public static deactivate_post_type ( string $type ) : boolean | ||
$type | string | The post type to deactivate |
Résultat | boolean | True on success |
public static default_fields ( ) : array | ||
Résultat | array | Array of columns in the Post table |
public static delete_post_status ( string $status ) | ||
$status | string | The name of the status to delete |
public static delete_post_type ( string $type ) : boolean | ||
$type | string | The post type name |
Résultat | boolean | true if post type has been deleted false if it has not been deleted (does not exist or there are posts using this content type) |
public descend ( $params = null ) : |
||
$params | The params by which to work out what is the descending post | |
Résultat | The descending post |
public field_load ( string $key ) : mixed | ||
$key | string | The name of a form component that will be loaded |
Résultat | mixed | The stored value returned |
public field_save ( string $key, mixed $value ) | ||
$key | string | The name of a form component that will be stored |
$value | mixed | The value of the form component to store |
public static filter_post_status_display_4 ( string $status ) : string | ||
$status | string | The built-in status name |
Résultat | string | The translated status name, or the built-in name if there is no translation |
public form_publish_delete ( |
||
$form | The submitted post editing form |
public form_publish_success ( |
||
$form |
$post= Post::get( array( 'slug' => 'wooga' ) );
public get_access ( |
||
$user | The user mask to fetch | |
Résultat |
public get_schema_map ( ) : array | ||
Résultat | array | An array of schema data for this post |
public get_tokens ( ) : array | ||
Résultat | array | An array of token ids |
public get_url_args ( ) : array | ||
Résultat | array | Properties of this post used to build a URL |
public has_tokens ( mixed $tokens ) : mixed | ||
$tokens | mixed | A single token string or an array of tokens |
Résultat | mixed | false if no tokens match, an array of matching token ids if any match |
public static list_active_post_types ( boolean $refresh = false ) : array | ||
$refresh | boolean | whether to force a refresh of the cached values |
Résultat | array | An array of post type names => integer values |
public static list_all_post_types ( boolean $refresh = false ) : array | ||
$refresh | boolean | whether to force a refresh of the cached values |
Résultat | array | An array of post type names => (integer values, active values) |
public static list_post_statuses ( mixed $all = true, boolean $refresh = false ) : array | ||
$all | mixed | true to list all statuses, not just external ones, Post to list external and any that match the Post status |
$refresh | boolean | true to force a refresh of the cached values |
Résultat | array | An array of post statuses names => integer values |
public list_revisions ( ) : array | ||
Résultat | array |
public remove_tokens ( array | string $tokens ) | ||
$tokens | array | string | The name of the permission to remove, or an array of permissions to remove |
public set_revision ( |
||
$date | The date to fetch the revision of |
public set_tokens ( mixed $tokens ) | ||
$tokens | mixed | A string token, or an array of tokens to apply to this post |
static public $post_status_list |