mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Update trash and right now links for pages. fixes #11958
git-svn-id: https://develop.svn.wordpress.org/trunk@12783 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -40,7 +40,7 @@ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php ech
|
||||
</script>
|
||||
<?php
|
||||
|
||||
if ( in_array( $pagenow, array('post.php', 'post-new.php', 'page.php') ) ) {
|
||||
if ( in_array( $pagenow, array('post.php', 'post-new.php') ) ) {
|
||||
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
|
||||
wp_enqueue_script('quicktags');
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet
|
||||
$post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else {
|
||||
wp_redirect( admin_url('edit.php') );
|
||||
wp_redirect( admin_url("edit.php?post_type=$post_type") );
|
||||
}
|
||||
|
||||
switch ( $doaction ) {
|
||||
@@ -127,7 +127,7 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet
|
||||
}
|
||||
|
||||
if ( isset($_GET['action']) )
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );
|
||||
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
@@ -198,7 +198,7 @@ if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Item moved to the trash.', '%s items moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
unset($_GET['trashed']);
|
||||
}
|
||||
|
||||
|
||||
@@ -252,8 +252,8 @@ function wp_dashboard_right_now() {
|
||||
$num = number_format_i18n( $num_pages->publish );
|
||||
$text = _n( 'Page', 'Pages', $num_pages->publish );
|
||||
if ( current_user_can( 'edit_pages' ) ) {
|
||||
$num = "<a href='edit-pages.php'>$num</a>";
|
||||
$text = "<a href='edit-pages.php'>$text</a>";
|
||||
$num = "<a href='edit.php?post_type=page'>$num</a>";
|
||||
$text = "<a href='edit.php?post_type=page'>$text</a>";
|
||||
}
|
||||
echo '<td class="first b b_pages">' . $num . '</td>';
|
||||
echo '<td class="t pages">' . $text . '</td>';
|
||||
|
||||
@@ -1605,6 +1605,7 @@ function display_page_row( $page, $level = 0 ) {
|
||||
$posts_columns = get_column_headers( $current_screen );
|
||||
$hidden = get_hidden_columns( $current_screen );
|
||||
$title = _draft_or_post_title();
|
||||
$post_type = $page->post_type;
|
||||
?>
|
||||
<tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit">
|
||||
<?php
|
||||
@@ -1669,11 +1670,11 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
|
||||
}
|
||||
if ( current_user_can('delete_page', $page->ID) ) {
|
||||
if ( $post->post_status == 'trash' )
|
||||
$actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
|
||||
$actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=untrash&post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
|
||||
elseif ( EMPTY_TRASH_DAYS )
|
||||
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
|
||||
if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
}
|
||||
if ( in_array($post->post_status, array('pending', 'draft')) ) {
|
||||
if ( current_user_can('edit_page', $page->ID) )
|
||||
|
||||
Reference in New Issue
Block a user