[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> post.php (summary)

WordPress Post Administration API.

File Size: 2425 lines (75 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 38 functions

  _wp_translate_postdata()
  _wp_get_allowed_postdata()
  edit_post()
  bulk_edit_posts()
  get_default_post_to_edit()
  post_exists()
  wp_write_post()
  write_post()
  add_meta()
  delete_meta()
  get_meta_keys()
  get_post_meta_by_id()
  has_meta()
  update_meta()
  _fix_attachment_links()
  get_available_post_statuses()
  wp_edit_posts_query()
  wp_edit_attachments_query_vars()
  wp_edit_attachments_query()
  postbox_classes()
  get_sample_permalink()
  get_sample_permalink_html()
  _wp_post_thumbnail_html()
  wp_check_post_lock()
  wp_set_post_lock()
  _admin_notice_post_locked()
  wp_create_post_autosave()
  post_preview()
  wp_autosave()
  redirect_post()
  taxonomy_meta_box_sanitize_cb_checkboxes()
  taxonomy_meta_box_sanitize_cb_input()
  use_block_editor_for_post()
  use_block_editor_for_post_type()
  get_block_categories()
  get_block_editor_server_block_settings()
  the_block_editor_meta_boxes()
  the_block_editor_meta_box_post_form_hidden_fields()

Functions
Functions that are not part of a class:

_wp_translate_postdata( $update = false, $post_data = null )   X-Ref
Rename $_POST data from form names to DB post columns.

Manipulates $_POST directly.

since: 2.6.0
param: bool $update Are we updating a pre-existing post?
param: array $post_data Array of post data. Defaults to the contents of $_POST.
return: object|bool WP_Error on failure, true on success.

_wp_get_allowed_postdata( $post_data = null )   X-Ref
Returns only allowed post data fields

since: 5.0.1
param: array $post_data Array of post data. Defaults to the contents of $_POST.
return: object|bool WP_Error on failure, true on success.

edit_post( $post_data = null )   X-Ref
Update an existing post with values provided in $_POST.

since: 1.5.0
param: array $post_data Optional.
return: int Post ID.

bulk_edit_posts( $post_data = null )   X-Ref
Process the post data for the bulk editing of posts.

Updates all bulk edited posts/pages, adding (but not removing) tags and
categories. Skips pages when they would be their own parent or child.

since: 2.7.0
param: array $post_data Optional, the array of post data to process if not provided will use $_POST superglobal.
return: array

get_default_post_to_edit( $post_type = 'post', $create_in_db = false )   X-Ref
Default post information to use when populating the "Write Post" form.

since: 2.0.0
param: string $post_type    Optional. A post type string. Default 'post'.
param: bool   $create_in_db Optional. Whether to insert the post into database. Default false.
return: WP_Post Post object containing all the default post data as attributes

post_exists( $title, $content = '', $date = '', $type = '' )   X-Ref
Determines if a post exists based on title, content, date and type.

since: 2.0.0
since: 5.2.0 Added the `$type` parameter.
param: string $title   Post title.
param: string $content Optional post content.
param: string $date    Optional post date.
param: string $type    Optional post type.
return: int Post ID if post exists, 0 otherwise.

wp_write_post()   X-Ref
Creates a new post from the "Write Post" form using $_POST information.

since: 2.1.0
return: int|WP_Error

write_post()   X-Ref
Calls wp_write_post() and handles the errors.

since: 2.0.0
return: int|null

add_meta( $post_ID )   X-Ref
Add post meta data defined in $_POST superglobal for post with given ID.

since: 1.2.0
param: int $post_ID
return: int|bool

delete_meta( $mid )   X-Ref
Delete post meta data by meta ID.

since: 1.2.0
param: int $mid
return: bool

get_meta_keys()   X-Ref
Get a list of previously defined keys.

since: 1.2.0
return: mixed

get_post_meta_by_id( $mid )   X-Ref
Get post meta data by meta ID.

since: 2.1.0
param: int $mid
return: object|bool

has_meta( $postid )   X-Ref
Get meta data for the given post ID.

since: 1.2.0
param: int $postid
return: mixed

update_meta( $meta_id, $meta_key, $meta_value )   X-Ref
Update post meta data by meta ID.

since: 1.2.0
param: int    $meta_id
param: string $meta_key Expect Slashed
param: string $meta_value Expect Slashed
return: bool

_fix_attachment_links( $post )   X-Ref
Replace hrefs of attachment anchors with up-to-date permalinks.

since: 2.3.0
param: int|object $post Post ID or post object.
return: void|int|WP_Error Void if nothing fixed. 0 or WP_Error on update failure. The post ID on update success.

get_available_post_statuses( $type = 'post' )   X-Ref
Get all the possible statuses for a post_type

since: 2.5.0
param: string $type The post_type you want the statuses for
return: array As array of all the statuses for the supplied post type

wp_edit_posts_query( $q = false )   X-Ref
Run the wp query to fetch the posts for listing on the edit posts page

since: 2.5.0
param: array|bool $q Array of query variables to use to build the query or false to use $_GET superglobal.
return: array

wp_edit_attachments_query_vars( $q = false )   X-Ref
Get the query variables for the current attachments request.

since: 4.2.0
param: array|false $q Optional. Array of query variables to use to build the query or false
return: array The parsed query vars.

wp_edit_attachments_query( $q = false )   X-Ref
Executes a query for attachments. An array of WP_Query arguments
can be passed in, which will override the arguments set by this function.

since: 2.5.0
param: array|false $q Array of query variables to use to build the query or false to use $_GET superglobal.
return: array

postbox_classes( $box_id, $screen_id )   X-Ref
Returns the list of classes to be used by a meta box.

since: 2.5.0
param: string $box_id    Meta box ID (used in the 'id' attribute for the meta box).
param: string $screen_id The screen on which the meta box is shown.
return: string Space-separated string of class names.

get_sample_permalink( $id, $title = null, $name = null )   X-Ref
Get a sample permalink based off of the post name.

since: 2.5.0
param: int    $id    Post ID or post object.
param: string $title Optional. Title to override the post's current title when generating the post name. Default null.
param: string $name  Optional. Name to override the post name. Default null.
return: array Array containing the sample permalink with placeholder for the post name, and the post name.

get_sample_permalink_html( $id, $new_title = null, $new_slug = null )   X-Ref
Returns the HTML of the sample permalink slug editor.

since: 2.5.0
param: int    $id        Post ID or post object.
param: string $new_title Optional. New title. Default null.
param: string $new_slug  Optional. New slug. Default null.
return: string The HTML of the sample permalink slug editor.

_wp_post_thumbnail_html( $thumbnail_id = null, $post = null )   X-Ref
Output HTML for the post thumbnail meta-box.

since: 2.9.0
param: int $thumbnail_id ID of the attachment used for thumbnail
param: mixed $post The post ID or object associated with the thumbnail, defaults to global $post.
return: string html

wp_check_post_lock( $post_id )   X-Ref
Check to see if the post is currently being edited by another user.

since: 2.5.0
param: int $post_id ID of the post to check for editing.
return: int|false ID of the user with lock. False if the post does not exist, post is not locked,

wp_set_post_lock( $post_id )   X-Ref
Mark the post as currently being edited by the current user

since: 2.5.0
param: int $post_id ID of the post being edited.
return: array|false Array of the lock time and user ID. False if the post does not exist, or

_admin_notice_post_locked()   X-Ref
Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.

since: 2.8.5
return: none

wp_create_post_autosave( $post_data )   X-Ref
Creates autosave data for the specified post from $_POST data.

since: 2.6.0
param: mixed $post_data Associative array containing the post data or int post ID.
return: mixed The autosave revision ID. WP_Error or 0 on error.

post_preview()   X-Ref
Saves a draft or manually autosaves for the purpose of showing a post preview.

since: 2.7.0
return: string URL to redirect to show the preview.

wp_autosave( $post_data )   X-Ref
Save a post submitted with XHR

Intended for use with heartbeat and autosave.js

since: 3.9.0
param: array $post_data Associative array of the submitted post data.
return: mixed The value 0 or WP_Error on failure. The saved post ID on success.

redirect_post( $post_id = '' )   X-Ref
Redirect to previous page.

param: int $post_id Optional. Post ID.

taxonomy_meta_box_sanitize_cb_checkboxes( $taxonomy, $terms )   X-Ref
Sanitizes POST values from a checkbox taxonomy metabox.

since: 5.1.0
param: mixed $terms Raw term data from the 'tax_input' field.
return: array

taxonomy_meta_box_sanitize_cb_input( $taxonomy, $terms )   X-Ref
Sanitizes POST values from an input taxonomy metabox.

since: 5.1.0
param: mixed $terms Raw term data from the 'tax_input' field.
return: array

use_block_editor_for_post( $post )   X-Ref
Return whether the post can be edited in the block editor.

since: 5.0.0
param: int|WP_Post $post Post ID or WP_Post object.
return: bool Whether the post can be edited in the block editor.

use_block_editor_for_post_type( $post_type )   X-Ref
Return whether a post type is compatible with the block editor.

The block editor depends on the REST API, and if the post type is not shown in the
REST API, then it won't work with the block editor.

since: 5.0.0
param: string $post_type The post type.
return: bool Whether the post type can be edited with the block editor.

get_block_categories( $post )   X-Ref
Returns all the block categories that will be shown in the block editor.

since: 5.0.0
param: WP_Post $post Post object.
return: array Array of block categories.

get_block_editor_server_block_settings()   X-Ref
Prepares server-registered blocks for the block editor.

Returns an associative array of registered block data keyed by block name. Data includes properties
of a block relevant for client registration.

since: 5.0.0
return: array An associative array of registered block data.

the_block_editor_meta_boxes()   X-Ref
Renders the meta boxes forms.

since: 5.0.0

the_block_editor_meta_box_post_form_hidden_fields( $post )   X-Ref
Renders the hidden form required for the meta boxes form.

since: 5.0.0
param: WP_Post $post Current post object.



Generated: Wed Jul 24 01:00:02 2019 Cross-referenced by PHPXref 0.7.1