PluginProbe
Button Generator – Easily Create Custom Buttons with Icons and Analytics / 2.3.8
Button Generator – Easily Create Custom Buttons with Icons and Analytics v2.3.8
trunk 1.1.1 2.0 2.1 2.2 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.2 3.2.1 3.2.2 3.2.3 All 28 releases
button-generation / public / shortcode.php

shortcode.php in Button Generator – Easily Create Custom Buttons with Icons and Analytics 2.3.8, at public/shortcode.php

62 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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