PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.4.8
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.4.8
2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 2.7.1 All 27 releases
insert-php / includes / shortcodes / shortcode-insert-php.php

shortcode-insert-php.php in Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts 2.4.8, at includes/shortcodes/shortcode-insert-php.php

38 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Note: This plugin requires WordPress version 3.3.1 or higher.
4
5 Information about the Insert PHP plugin can be found here:
6 http://www.willmaster.com/software/WPplugins/go/iphphome_iphplugin
7
8 Instructions and examples can be found here:
9 http://www.willmaster.com/software/WPplugins/go/iphpinstructions_iphplugin
10 */
11
12 // todo: This is the code of the old version of the plugin, left unchanged for compatibility. Delete in the new major version of the plugin
13 if ( ! function_exists( 'will_bontrager_insert_php' ) ) {
14
15 function will_bontrager_insert_php( $content ) {
16 if ( WINP_Helper::is_safe_mode() ) {
17 return $content;
18 }
19
20 $will_bontrager_content = $content;
21 preg_match_all( '!\[insert_php[^\]]*\](.*?)\[/insert_php[^\]]*\]!is', $will_bontrager_content, $will_bontrager_matches );
22 $will_bontrager_nummatches = count( $will_bontrager_matches[0] );
23 for ( $will_bontrager_i = 0; $will_bontrager_i < $will_bontrager_nummatches; $will_bontrager_i ++ ) {
24 ob_start();
25 eval( $will_bontrager_matches[1][ $will_bontrager_i ] );
26 $will_bontrager_replacement = ob_get_contents();
27 ob_clean();
28 ob_end_flush();
29 $will_bontrager_content = preg_replace( '/' . preg_quote( $will_bontrager_matches[0][ $will_bontrager_i ], '/' ) . '/', $will_bontrager_replacement, $will_bontrager_content, 1 );
30 }
31
32 return $will_bontrager_content;
33 } # function will_bontrager_insert_php()
34
35 add_filter( 'the_content', 'will_bontrager_insert_php', 9 );
36 } # if( ! function_exists('will_bontrager_insert_php') )
37
38