クラス WP_Theme::sanitize_header()
2014/12/17
WP_Theme::sanitize_header()
WP_Theme::定義ファイル : /blog/wp-includes/class-wp-theme.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | private function sanitize_header( $header, $value ) { switch ( $header ) { case 'Status' : if ( ! $value ) { $value = 'publish'; break; } // Fall through otherwise. case 'Name' : static $header_tags = array( 'abbr' => array( 'title' => true ), 'acronym' => array( 'title' => true ), 'code' => true, 'em' => true, 'strong' => true, ); $value = wp_kses( $value, $header_tags ); break; case 'Author' : // There shouldn't be anchor tags in Author, but some themes like to be challenging. case 'Description' : static $header_tags_with_a = array( 'a' => array( 'href' => true, 'title' => true ), 'abbr' => array( 'title' => true ), 'acronym' => array( 'title' => true ), 'code' => true, 'em' => true, 'strong' => true, ); $value = wp_kses( $value, $header_tags_with_a ); break; case 'ThemeURI' : case 'AuthorURI' : $value = esc_url_raw( $value ); break; case 'Tags' : $value = array_filter( array_map( 'trim', explode( ',', strip_tags( $value ) ) ) ); break; } return $value; } |