PluginProbe
WP Coder – Insert & Manage Code Snippets / 2.5.4
WP Coder – Insert & Manage Code Snippets v2.5.4
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
← All changes | public/shortcode.php +16 -8 2.4.12.5.4 View file →
@@ -13,20 +13,28 @@
13 13 if ( ! defined( 'ABSPATH' ) ) {
14 14 exit;
15 15 }
16 16
17 -extract( shortcode_atts( array( 'id' => "" ), $atts ) );
17 +extract( shortcode_atts( array( 'id' => "", 'title' => '', ), $atts ) );
18 +
19 +if ( ! empty( $atts['id'] ) ) {
20 + $id = absint( $atts['id'] );
21 +}
22 +
18 23 global $wpdb;
19 -$table = $wpdb->prefix . 'wow_' . $this->plugin_pref;
20 -$sSQL = $wpdb->prepare( "select * from $table WHERE id = %d", $id );
24 +$table = $wpdb->prefix . 'wow_' . $this->plugin_pref;
25 +if ( ! empty( $id ) ) {
26 + $sSQL = $wpdb->prepare( "select * from $table WHERE id = %d", $id );
27 +} elseif ( ! empty( $atts['title'] ) ) {
28 + $sSQL = $wpdb->prepare( "select * from $table WHERE title = %s", $atts['title'] );
29 +} else {
30 + return false;
31 +}
21 32 $result = $wpdb->get_results( $sSQL );
22 33 if ( count( $result ) > 0 ) {
23 34 foreach ( $result as $key => $val ) {
24 - $param = unserialize( $val->param );
25 - ob_start();
26 - include( 'partials/public.php' );
27 - $content = ob_get_contents();
28 - ob_end_clean();
35 + $param = unserialize( $val->param );
36 + $content = do_shortcode( $param['content_html'] );
29 37 $path_style = $this->basedir . 'style-' . $val->id . '.css';
30 38 $path_script = $this->basedir . 'script-' . $val->id . '.js';
31 39 $file_style = $this->plugin_dir . 'admin/partials/generator/style.php';
32 40 $file_script = $this->plugin_dir . 'admin/partials/generator/script.php';