PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.2.7
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.2.7
2.7.7 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 All 28 releases
← All changes | includes/shortcodes/shortcodes.php +15 -7 2.1.912.2.7 View file →
@@ -1,12 +1,17 @@
1 1 <?php
2 -
3 2 /**
4 3 * A base shortcode for all lockers
5 4 *
6 5 * @since 1.0.0
7 6 */
8 -class WINP_SnippetShortcode extends Wbcr_FactoryShortcodes325_Shortcode {
7 +
8 +// Exit if accessed directly
9 +if ( ! defined( 'ABSPATH' ) ) {
10 + exit;
11 +}
12 +
13 +class WINP_SnippetShortcode extends Wbcr_FactoryShortcodes329_Shortcode {
9 14
10 15 public $shortcode_name = 'wbcr_php_snippet';
11 16
12 17 /**
@@ -105,15 +110,17 @@
105 110
106 111 /**
107 112 * Get snippet content
108 113 *
109 - * @param $snippet_meta
110 - * @param $id
114 + * @param WP_Post $snippet
115 + * @param array $snippet_meta
116 + * @param int $id
111 117 *
112 118 * @return null|string
113 119 */
114 - public function getSnippetContent( $snippet_meta, $id ) {
115 - return isset( $snippet_meta[ $this->plugin->getPrefix() . 'snippet_code' ] ) ? WINP_Plugin::app()->getExecuteObject()->prepareCode( $snippet_meta[ $this->plugin->getPrefix() . 'snippet_code' ][0], $id ) : null;
120 + public function getSnippetContent( $snippet, $snippet_meta, $id ) {
121 + $snippet_code = WINP_Helper::get_snippet_code($snippet);
122 + return WINP_Plugin::app()->getExecuteObject()->prepareCode( $snippet_code, $id );
116 123 }
117 124
118 125 /**
119 126 * Content render
@@ -119,10 +126,11 @@
119 126 * Content render
120 127 *
121 128 * @param array $attr
122 129 * @param string $content
130 + * @param string $tag
123 131 */
124 - public function html( $attr, $content ) {
132 + public function html( $attr, $content, $tag ) {
125 133
126 134 }
127 135
128 136 }