diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 4af1775b81..950ec13613 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -730,19 +730,49 @@ case 'sample-permalink': break; case 'inline-save': check_ajax_referer( 'inlineeditnonce', '_inline_edit' ); - - if ( ! isset($_POST['post_ID']) || ! ( $id = (int) $_POST['post_ID'] ) ) + + if ( ! isset($_POST['post_ID']) || ! ( $post_ID = (int) $_POST['post_ID'] ) ) exit; - if ( $last = wp_check_post_lock( $id ) ) { + if ( 'page' == $_POST['post_type'] ) { + if ( ! current_user_can( 'edit_page', $post_ID ) ) + die( __('You are not allowed to edit this page.') ); + } else { + if ( ! current_user_can( 'edit_post', $post_ID ) ) + die( __('You are not allowed to edit this post.') ); + } + + if ( $last = wp_check_post_lock( $post_ID ) ) { $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' ); - echo '
' . sprintf( $_POST['post_type'] == 'page' ? __( 'Saving is disabled: %s is currently editing this page.' ) : __( 'Saving is disabled: %s is currently editing this post.' ), wp_specialchars( $last_user_name ) ) . '
$edit | "; + $output .= "$edit";
+ $output .= ' ';
+ $output .= ' ' . attribute_escape( $category->name ) . ' ';
+ $output .= '' . $category->slug . ' ';
+ $output .= '' . $category->parent . ' | ';
break;
case 'description':
$output .= "$category->description | "; @@ -182,6 +187,86 @@ function _cat_row( $category, $level, $name_override = false ) { return apply_filters('cat_row', $output); } +/** + * {@internal Missing Short Description}} + * + * @since 2.7 + * + * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit. + * + * @param string $type "tag", "category" or "link-category" + * @return + */ +function inline_edit_term_row($type) { + + if ( ! current_user_can( 'manage_categories' ) ) + return; + + $is_tag = $type == 'tag'; + $columns = $is_tag ? get_column_headers('tag') : get_column_headers('category'); + $hidden = (array) get_user_option( "manage-$type-columns-hidden" ); ?> + + +name)) . "'>$name||
$edit | "; + $output .= "$edit";
+ $output .= ' ';
+ $output .= ' ' . attribute_escape( $category->name ) . ' ';
+ $output .= '' . $category->slug . ' ';
+ $output .= '' . $category->parent . ' | ';
break;
case 'description':
$output .= "$category->description | "; @@ -517,6 +607,7 @@ function _tag_row( $tag, $class = '' ) { $out .= '' . $name . ' '; $actions = array(); $actions['edit'] = '' . __('Edit') . ''; + $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; $actions['delete'] = "term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . ""; $action_count = count($actions); $i = 0; @@ -525,7 +616,9 @@ function _tag_row( $tag, $class = '' ) { ( $i == $action_count ) ? $sep = '' : $sep = ' | '; $out .= "$link$sep"; } - $out .= ' | ';
+ $out .= '$tag->slug | "; @@ -573,7 +666,7 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { $class = ''; $count = 0; foreach( $tags as $tag ) - $out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '' ); + $out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"' ); // filter and send to screen $out = apply_filters('tag_rows', $out); @@ -745,7 +838,7 @@ function get_column_headers($page) { 'posts' => __('Posts') ); return apply_filters('manage_users_columns', $columns); - default : + default : return apply_filters('manage_' . $page . '_columns', $columns); } @@ -799,9 +892,11 @@ function print_column_headers( $type, $id = true ) { /** * {@internal Missing Short Description}} * - * @since unknown + * Outputs the quick edit and bulk edit table rows + * + * @since 2.7 * - * @param unknown_type $type + * @param string $type 'post' or 'page' */ function inline_edit_row( $type ) { global $current_user, $mode; @@ -823,7 +918,7 @@ function inline_edit_row( $type ) { - +