_wptexturize_pushpop_element [ WordPress Function ]
_wptexturize_pushpop_element ( $text, $stack, $disabled_elements, $opening = '<', $closing = '>' )
| Access: |
|
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wptexturize, wp_unschedule_event, wp_get_current_commenter, wp_untrash_post_comments
Search for disabled element tags. Push element to stack on tag open and pop on tag close. Assumes first character of $text is tag opening.
Source
<?php
function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
// Check if it is a closing tag -- otherwise assume opening tag
if (strncmp($opening . '/', $text, 2)) {
// Opening? Check $text+1 against disabled elements
if (preg_match('/^' . $disabled_elements . '\b/', substr($text, 1), $matches)) {
/*
* This disables texturize until we find a closing tag of our type
* (e.g. <pre>) even if there was invalid nesting before that
*
* Example: in the case <pre>sadsadasd</code>"baba"</pre>
* "baba" won't be texturize
*/
array_push($stack, $matches[1]);
}
} else {
// Closing? Check $text+2 against disabled elements
$c = preg_quote($closing, '/');
if (preg_match('/^' . $disabled_elements . $c . '/', substr($text, 2), $matches)) {
$last = array_pop($stack);
// Make sure it matches the opening tag
if ($last != $matches[1])
array_push($stack, $last);
}
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- _wptexturize_pushpop_element() WordPress function reference ...
Search for disabled element tags. Push element to stack on tag open and pop on tag close. Assumes first character of $text is tag opening.
queryposts.com - php /** * Main WordPress Formatting API. - WordPress SVN
Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ( $textarr as &$curl ) { if ( empty( $curl ) ) continue; // Only call _wptexturize_pushpop_element if first ...
core.svn.wordpress.org - wp-includes/formatting.php source - yukei.net
'$1', '’$1', '$1×$2'); 61 } 62 63 // Transform into regexp sub- expression used in _wptexturize_pushpop_element 64 // Must do this everytime in case ...
lab.yukei.net - PHPXref.com - WordPress 3.0.1 - /wp-includes/formatting.php source
Aug 19, 2010... Transform into regexp sub-expression used in _wptexturize_pushpop_element 66 // Must do this everytime in case plugins use these filters in ...
phpxref.com