Beispiel #1
0
<?php

/**
 * Edit Posts Administration Panel.
 *
 * @package WordPress
 * @subpackage Administration
 */
/** WordPress Administration Bootstrap */
require_once './admin.php';
require_once './includes/default-list-tables.php';
$wp_list_table = new WP_Posts_Table();
$wp_list_table->check_permissions();
// Back-compat for viewing comments of an entry
if ($_redirect = intval(max(@$_REQUEST['p'], @$_REQUEST['attachment_id'], @$_REQUEST['page_id']))) {
    wp_redirect(admin_url('edit-comments.php?p=' . $_redirect));
    exit;
} else {
    unset($_redirect);
}
// Handle bulk actions
if (isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) || isset($_REQUEST['bulk_edit'])) {
    check_admin_referer('bulk-posts');
    $sendback = remove_query_arg(array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer());
    if (strpos($sendback, 'post.php') !== false) {
        $sendback = admin_url($post_new_file);
    }
    if (isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) {
        $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['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';
Beispiel #2
0
     // status
     if (isset($data['keep_private']) && 'private' == $data['keep_private']) {
         $data['post_status'] = 'private';
     } else {
         $data['post_status'] = $data['_status'];
     }
     if (empty($data['comment_status'])) {
         $data['comment_status'] = 'closed';
     }
     if (empty($data['ping_status'])) {
         $data['ping_status'] = 'closed';
     }
     // update the post
     edit_post();
     require_once './includes/default-list-tables.php';
     $wp_list_table = new WP_Posts_Table();
     $mode = $_POST['post_view'];
     $wp_list_table->display_rows(array(get_post($_POST['post_ID'])));
     exit;
     break;
 case 'inline-save-tax':
     check_ajax_referer('taxinlineeditnonce', '_inline_edit');
     require_once './includes/default-list-tables.php';
     $wp_list_table = new WP_Terms_Table();
     $wp_list_table->check_permissions('edit');
     if (!isset($_POST['tax_ID']) || !($id = (int) $_POST['tax_ID'])) {
         die(-1);
     }
     $tag = get_term($id, $taxonomy);
     $_POST['description'] = $tag->description;
     $updated = wp_update_term($id, $taxonomy, $_POST);