[wp-trac] [WordPress Trac] #34113: Add a 'View Archive' link to admin bar for post types.

WordPress Trac noreply at wordpress.org
Mon Sep 5 17:12:51 UTC 2016


#34113: Add a 'View Archive' link to admin bar for post types.
---------------------------------------+-----------------------------
 Reporter:  paulwilde                  |       Owner:
     Type:  enhancement                |      Status:  new
 Priority:  normal                     |   Milestone:  4.7
Component:  Toolbar                    |     Version:  4.4
 Severity:  normal                     |  Resolution:
 Keywords:  has-patch has-screenshots  |     Focuses:  administration
---------------------------------------+-----------------------------

Comment (by swissspidy):

 Replying to [comment:16 akibjorklund]:
 > @swissspidy: What is the purpose of setting the current screen to
 `front` before the assertions? Since `$wp_admin_bar->get_node()` will
 clone the node, there should not be any effect on the content of the node.

 That is being done for cleanup purposes. The screen is changed at the
 beginning of the method, and needs to changed back afterwards. It's before
 the assertion because otherwise the cleanup doesn't happen when the
 assertion fails.
 Without a cleanup, this self-contained test will potentially have an
 impact on other tests, which is far from ideal.

 > Oh and renaming `$node_view` variables to `$node_archive` to match the
 change in node ID would make sense.

 Good catch. Simply `$node` is preferable in this case.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34113#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list