PluginProbe
Bubble Menu – Floating Button Menu with Sticky Navigation / 2.2
Bubble Menu – Floating Button Menu with Sticky Navigation v2.2
trunk 1.3 2.0 2.2 2.2.1 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.1 4.1.1
bubble-menu / public / shortcode.php

shortcode.php in Bubble Menu – Floating Button Menu with Sticky Navigation 2.2, at public/shortcode.php

76 lines 2.2 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 Dmytro Lobov <i@wpbiker.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 $path_style = $this->basedir . 'style-' . $val->id . '.css';
33 $path_script = $this->basedir . 'script-' . $val->id . '.js';
34 $file_style = $this->plugin['dir'] . 'admin/partials/generator/style.php';
35 $file_script = $this->plugin['dir'] . 'admin/partials/generator/script.php';
36 if ( file_exists( $file_style ) && ! file_exists( $path_style ) ) {
37 ob_start();
38 include( $file_style );
39 $content_style = ob_get_contents();
40 ob_end_clean();
41 file_put_contents( $path_style, $content_style );
42 }
43 if ( file_exists( $file_script ) && ! file_exists( $path_script ) ) {
44 ob_start();
45 include( $file_script );
46 $content_script = ob_get_contents();
47 ob_end_clean();
48 file_put_contents( $path_script, $content_script );
49 }
50
51
52 echo $content;
53 $time = ! empty( $param['time'] ) ? $param['time'] : '';
54
55 $slug = $this->plugin['slug'];
56 $version = $this->plugin['version'];
57
58 $url_style = $this->plugin['url'] . 'assets/css/style.min.css';
59 wp_enqueue_style( $slug, $url_style, null, $version );
60
61
62 if ( empty( $param['disable_fontawesome'] ) ) {
63 $url_icons = $this->plugin['url'] . 'assets/vendors/fontawesome/css/fontawesome-all.min.css';
64 wp_enqueue_style( $slug . '-fontawesome', $url_icons, null, '5.6.3' );
65 }
66
67
68 if ( file_exists( $path_style ) ) {
69 $url_css = $this->baseurl . 'style-' . $val->id . '.css';
70 wp_enqueue_style( $slug . '-' . $val->id, $url_css, array(), $time );
71 }
72
73 }
74
75 }
76