[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

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

WordPress Post Administration API.

File Size: 2425 lines (75 kb)
Included or required: 2 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.

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

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

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

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

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

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.

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

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.

return: WP_Post Post object containing all the default post data as attributes
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.

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

return: int Post ID if post exists, 0 otherwise.
param: string $title   Post title.
param: string $content Optional post content.
param: string $date    Optional post date.
param: string $type    Optional post type.

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

return: int|WP_Error

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

return: int|null

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

return: int|bool
param: int $post_ID

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

return: bool
param: int $mid

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

return: mixed

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

return: object|bool
param: int $mid

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

return: mixed
param: int $postid

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

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

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

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

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

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

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

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

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

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

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.

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

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

return: string Space-separated string of class names.
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.

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

return: array Array containing the sample permalink with placeholder for the post name, and the post name.
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.

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

return: string The HTML of the sample permalink slug editor.
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.

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

return: string html
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.

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

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

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

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

_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.

return: none

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

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

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

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

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

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.

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

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

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

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

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

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.

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

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

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

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.

return: array An associative array of registered block data.

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


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

param: WP_Post $post Current post object.



Generated: Sun Sep 22 08:20:01 2019 Cross-referenced by PHPXref 0.7