| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin shortcode |
| 4 |
* |
| 5 |
* @package Wow_Plugin |
| 6 |
* @subpackage Public/Shortcode |
| 7 |
* @author Wow-Company <yoda@wow-company.com> |
| 8 |
* @copyright 2019 Wow-Company |
| 9 |
* @license GNU Public License |
| 10 |
* @version 1.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
extract( shortcode_atts( array( 'id' => "" ), $atts ) ); |
| 18 |
|
| 19 |
global $wpdb; |
| 20 |
$table = $wpdb->prefix . 'wow_' . $this->plugin['prefix']; |
| 21 |
$sSQL = $wpdb->prepare( "select * from $table WHERE id = %d", $id ); |
| 22 |
$result = $wpdb->get_results( $sSQL ); |
| 23 |
|
| 24 |
if ( count( $result ) > 0 ) { |
| 25 |
|
| 26 |
foreach ( $result as $key => $val ) { |
| 27 |
$param = unserialize( $val->param ); |
| 28 |
ob_start(); |
| 29 |
include( 'partials/public.php' ); |
| 30 |
$content = ob_get_contents(); |
| 31 |
ob_end_clean(); |
| 32 |
|
| 33 |
echo $content; |
| 34 |
$time = ! empty( $param['time'] ) ? $param['time'] : ''; |
| 35 |
|
| 36 |
$slug = $this->plugin['slug']; |
| 37 |
$version = $this->plugin['version']; |
| 38 |
|
| 39 |
$url_style = $this->plugin['url'] . 'assets/css/style.min.css'; |
| 40 |
wp_enqueue_style( $slug, $url_style, null, $version ); |
| 41 |
|
| 42 |
$inline_style = self::inline_style( $param, $id ); |
| 43 |
echo '<style>' . $inline_style. '</style>'; |
| 44 |
|
| 45 |
if ( empty( $param['disable_fontawesome'] ) ) { |
| 46 |
$appearance = $param['appearance']; |
| 47 |
if ( 'text_icon' == $appearance || 'icon' == $appearance ) { |
| 48 |
$url_icons = $this->plugin['url'] . 'assets/vendors/fontawesome/css/fontawesome-all.min.css'; |
| 49 |
wp_enqueue_style( $slug . '-fontawesome', $url_icons, null, '5.6.3' ); |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
$url_script = $this->plugin['url'] . 'assets/js/jquery.buttons.min.js'; |
| 54 |
wp_enqueue_script( $slug, $url_script, array( 'jquery' ), $version ); |
| 55 |
wp_localize_script( $slug, 'btg_count', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); |
| 56 |
|
| 57 |
do_action( 'btg_counter', $id ); |
| 58 |
|
| 59 |
} |
| 60 |
|
| 61 |
} |
| 62 |
|