mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Toolbar: Add a 'View Posts' link to the toolbar when on the post listing screen.
This adds a new link to visit the post type archive if the post type supports it. Also introduces a new `view_items` label to `get_post_type_labels()`. Props paulwilde, akibjorklund, swissspidy. Fixes #34113. git-svn-id: https://develop.svn.wordpress.org/trunk@38634 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -380,4 +380,31 @@ class Tests_AdminBar extends WP_UnitTestCase {
|
||||
$this->assertNull( $node_edit );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 34113
|
||||
*/
|
||||
public function test_admin_bar_contains_view_archive_link() {
|
||||
set_current_screen( 'edit-post' );
|
||||
|
||||
$wp_admin_bar = $this->get_standard_admin_bar();
|
||||
$node = $wp_admin_bar->get_node( 'archive' );
|
||||
|
||||
set_current_screen( 'front' );
|
||||
|
||||
$this->assertNotNull( $node );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 34113
|
||||
*/
|
||||
public function test_admin_bar_has_no_archives_link_for_post_types_without_archive() {
|
||||
set_current_screen( 'edit-page' );
|
||||
|
||||
$wp_admin_bar = $this->get_standard_admin_bar();
|
||||
$node = $wp_admin_bar->get_node( 'archive' );
|
||||
|
||||
set_current_screen( 'front' );
|
||||
|
||||
$this->assertNull( $node );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user