Improve some post_status-related documentation.

Props ericlewis.
See #30230.


git-svn-id: https://develop.svn.wordpress.org/trunk@30155 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-11-01 20:19:26 +00:00
parent c171bb4aae
commit c8acddfdc8
7 changed files with 33 additions and 18 deletions

View File

@@ -62,9 +62,12 @@ if ( $doaction ) {
$sendback = admin_url($post_new_file);
if ( 'delete_all' == $doaction ) {
// Prepare for deletion of all posts with a specified post status (i.e. Empty trash).
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['post_status']);
if ( get_post_status_object($post_status) ) // Check the post status exists first
// Validate the post status exists.
if ( get_post_status_object( $post_status ) ) {
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
}
$doaction = 'delete';
} elseif ( isset( $_REQUEST['media'] ) ) {
$post_ids = $_REQUEST['media'];

View File

@@ -56,6 +56,7 @@ get_current_screen()->set_help_sidebar(
'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
// If the 'download' URL parameter is set, a WXR export file is baked and returned.
if ( isset( $_GET['download'] ) ) {
$args = array();

View File

@@ -1142,6 +1142,9 @@ function wp_ajax_add_meta() {
wp_die( -1 );
if ( isset($_POST['metakeyselect']) && '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) )
wp_die( 1 );
// If the post is an autodraft, save the post as a draft and then
// attempt to save the meta.
if ( $post->post_status == 'auto-draft' ) {
$save_POST = $_POST; // Backup $_POST
$_POST = array(); // Make it empty for edit_post()
@@ -1486,7 +1489,7 @@ function wp_ajax_sample_permalink() {
}
/**
* Ajax handler for quick edit saving for a post.
* Ajax handler for Quick Edit saving a post from a list table.
*
* @since 3.1.0
*/
@@ -1617,7 +1620,9 @@ function wp_ajax_inline_save_tax() {
}
/**
* Ajax handler for finding posts.
* Ajax handler for querying posts for the Find Posts modal.
*
* @see window.findPosts
*
* @since 3.1.0
*/
@@ -2147,7 +2152,7 @@ function wp_ajax_get_attachment() {
}
/**
* Ajax handler for querying for attachments.
* Ajax handler for querying attachments.
*
* @since 3.5.0
*/
@@ -2193,7 +2198,7 @@ function wp_ajax_query_attachments() {
}
/**
* Ajax handler for saving attachment attributes.
* Ajax handler for updating attachment attributes.
*
* @since 3.5.0
*/

View File

@@ -16,11 +16,11 @@
define( 'WXR_VERSION', '1.2' );
/**
* Generates the WXR export file for download
* Generates the WXR export file for download.
*
* @since 2.1.0
*
* @param array $args Filters defining what should be included in the export
* @param array $args Filters defining what should be included in the export.
*/
function export_wp( $args = array() ) {
global $wpdb, $post;