Eliminate use of `extract()` in `the_title_attribute()`.

See #22400.

Built from https://develop.svn.wordpress.org/trunk@28383


git-svn-id: http://core.svn.wordpress.org/trunk@28211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-13 04:48:15 +00:00
parent ef8b813682
commit 92d2c60a65
1 changed files with 10 additions and 9 deletions

View File

@ -69,22 +69,23 @@ function the_title($before = '', $after = '', $echo = true) {
* @return string|null Null on failure or display. String when echo is false.
*/
function the_title_attribute( $args = '' ) {
$defaults = array('before' => '', 'after' => '', 'echo' => true, 'post' => get_post() );
$r = wp_parse_args($args, $defaults);
extract( $r, EXTR_SKIP );
$defaults = array( 'before' => '', 'after' => '', 'echo' => true, 'post' => get_post() );
$r = wp_parse_args( $args, $defaults );
$title = get_the_title( $post );
$title = get_the_title( $r['post'] );
if ( strlen($title) == 0 )
if ( strlen( $title ) == 0 ) {
return;
}
$title = $before . $title . $after;
$title = esc_attr(strip_tags($title));
$title = $r['before'] . $title . $r['after'];
$title = esc_attr( strip_tags( $title ) );
if ( $echo )
if ( $r['echo'] ) {
echo $title;
else
} else {
return $title;
}
}
/**