Ticket #12905: tmpl-argument-for-the-title-attribute.diff
File tmpl-argument-for-the-title-attribute.diff, 927 bytes (added by , 15 years ago) |
---|
-
wp-includes/post-template.php
77 77 if ( strlen($title) == 0 ) 78 78 return; 79 79 80 $defaults = array('before' => '', 'after' => '', 'echo' => true); 81 $r = wp_parse_args($args, $defaults); 80 $defaults = array('before' => '', 'after' => '', 'echo' => true, 'text' => '%s'); 81 82 if ( is_string( $args) && !preg_match( '/^('.implode( '|', array_keys( $defaults ) ).')=/', $args ) ) 83 $r = array_merge( $defaults, array( 'text' => $args ) ); 84 else 85 $r = wp_parse_args( $args, $defaults ); 86 82 87 extract( $r, EXTR_SKIP ); 83 88 84 89 85 $title = $before . $title. $after;86 $title = esc_attr( strip_tags($title));90 $title = $before . sprintf( $text, $title ) . $after; 91 $title = esc_attr( strip_tags( $title ) ); 87 92 88 93 if ( $echo ) 89 94 echo $title;