| @@ -13,28 +13,20 @@ | ||
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -extract( shortcode_atts( array( 'id' => "", 'title' => '', ), $atts ) ); | |
| 18 | - | |
| 19 | -if ( ! empty( $atts['id'] ) ) { | |
| 20 | - $id = absint( $atts['id'] ); | |
| 21 | -} | |
| 22 | - | |
| 17 | +extract( shortcode_atts( array( 'id' => "" ), $atts ) ); | |
| 23 | 18 | global $wpdb; |
| 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 | -} | |
| 19 | +$table = $wpdb->prefix . 'wow_' . $this->plugin_pref; | |
| 20 | +$sSQL = $wpdb->prepare( "select * from $table WHERE id = %d", $id ); | |
| 32 | 21 | $result = $wpdb->get_results( $sSQL ); |
| 33 | 22 | if ( count( $result ) > 0 ) { |
| 34 | 23 | foreach ( $result as $key => $val ) { |
| 35 | - $param = unserialize( $val->param ); | |
| 36 | - $content = do_shortcode( $param['content_html'] ); | |
| 24 | + $param = unserialize( $val->param ); | |
| 25 | + ob_start(); | |
| 26 | + include( 'partials/public.php' ); | |
| 27 | + $content = ob_get_contents(); | |
| 28 | + ob_end_clean(); | |
| 37 | 29 | $path_style = $this->basedir . 'style-' . $val->id . '.css'; |
| 38 | 30 | $path_script = $this->basedir . 'script-' . $val->id . '.js'; |
| 39 | 31 | $file_style = $this->plugin_dir . 'admin/partials/generator/style.php'; |
| 40 | 32 | $file_script = $this->plugin_dir . 'admin/partials/generator/script.php'; |