Changeset 30270
- Timestamp:
- 11/07/2014 04:45:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/functions.php
r30233 r30270 303 303 304 304 /** 305 * Encode email address of mailto: links in social navigation 306 * 307 * @since Twenty Fifteen 1.0 308 * 309 * @param array $atts HTML attributes in an associative array 310 * @param WP_Post $item Menu item object 311 * @param array $args Array containing config with desired markup of nav 312 * 313 * @return array HTML attributes for Menu item 314 */ 315 function twentyfifteen_nav_encode_email( $atts, $item, $args ) { 316 if ( 'social' == $args->theme_location ) { 317 if ( preg_match( '/^mailto:(.+)/', $atts['href'], $match ) ) { 318 $atts['href'] = 'mailto:' . antispambot( $match[1] ); 319 } 320 } 321 return $atts; 322 } 323 add_filter( 'nav_menu_link_attributes', 'twentyfifteen_nav_encode_email', 10, 3 ); 324 325 /** 305 326 * Add a `screen-reader-text` class to the search form's submit button. 306 327 *
Note: See TracChangeset
for help on using the changeset viewer.