関数 _wptexturize_pushpop_element()
2014/12/11
関数 _wptexturize_pushpop_element()
定義ファイル :/blog/wp-includes/formatting.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 | function _wptexturize_pushpop_element($text, &$stack, $disabled_elements) { // Is it an opening tag or closing tag? if ( '/' !== $text[1] ) { $opening_tag = true; $name_offset = 1; } elseif ( 0 == count( $stack ) ) { // Stack is empty. Just stop. return; } else { $opening_tag = false; $name_offset = 2; } // Parse out the tag name. $space = strpos( $text, ' ' ); if ( FALSE === $space ) { $space = -1; } else { $space -= $name_offset; } $tag = substr( $text, $name_offset, $space ); // Handle disabled tags. if ( in_array( $tag, $disabled_elements ) ) { if ( $opening_tag ) { array_push( $stack, $tag ); } elseif ( end( $stack ) == $tag ) { array_pop( $stack ); } } } |