[wp-trac] [WordPress Trac] #28505: Allow button manipulation in `get_sample_permalink_html()`
WordPress Trac
noreply at wordpress.org
Fri Jun 20 21:48:14 UTC 2014
#28505: Allow button manipulation in `get_sample_permalink_html()`
-------------------------+-----------------------------
Reporter: ericmann | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.0
Component: Editor | Version: 3.9.1
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: administration
-------------------------+-----------------------------
Changes (by DrewAPicture):
* keywords: => needs-patch
Comment:
This looks like a pretty good start, though there's still a bit of work to
do here.
For instance, the 'Get Shortlink' button is actually appended to the end
of the `get_sample_permalink_html()`
[https://core.trac.wordpress.org/browser/trunk/src/wp-admin/edit-form-
advanced.php#L450 output in edit-form-advanced.php]. So I'd suggest
bringing that logic into `get_sample_permalink_html()` so the button is
included with the filter.
Also, this is just a readability nitpick, but the multi-conditional and
subsequent link buttons string, could probably be broken up into multiple
lines, a la:
{{{
#!php
<?php
if ( '' == get_option( 'permalink_structure' )
&& current_user_can( 'manage_options' )
&& ! ( 'page' == get_option('show_on_front') && $id ==
get_option('page_on_front') )
) {
$link_buttons['change-permalinks'] = '<span id="change-
permalinks">';
$link_buttons['change-permalinks'] .= '<a href="options-
permalink.php" class="button button-small" target="_blank">' . __( 'Change
Permalinks' ) . '</a>';
$link_buttons['change-permalinks'] .= "</span>\n";
}
}}}
Last, not sure what if any concerns the accessibility team might have with
keeping or removing the target=blank on that link, either. Seems like
lately we've been in the habit of removing blank targets on links in the
back-end.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28505#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list