PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / trunk
ShopBuilder – WooCommerce Builder For Elementor vtrunk
3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.3.0 All 62 releases
shopbuilder / app / Controllers / Shortcodes.php

Shortcodes.php in ShopBuilder – WooCommerce Builder For Elementor trunk, at app/Controllers/Shortcodes.php

54 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Shortcodes Class.
4 *
5 * This class contains all the Shortcodes.
6 *
7 * @package RadiusTheme\SB
8 */
9
10 namespace RadiusTheme\SB\Controllers;
11
12 use RadiusTheme\SB\Traits\SingletonTrait;
13
14 // Do not allow directly accessing this file.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit( 'This script cannot be accessed directly.' );
17 }
18
19 /**
20 * Shortcodes Class.
21 */
22 class Shortcodes {
23 /**
24 * Singleton Trait
25 */
26 use SingletonTrait;
27
28 /**
29 * Class Constructor.
30 */
31 private function __construct() {
32 add_action( 'init', [ $this, 'register_shortcodes' ] );
33 }
34
35 /**
36 * Accumulates all the shortcode classes inside an array
37 *
38 * @return void
39 * @since 1.0.0
40 */
41 public function register_shortcodes() {
42 $shortcodes_list = [];
43 $shortcodes = apply_filters( 'rtsb/elements/shortcodes', $shortcodes_list );
44
45 if ( ! empty( $shortcodes ) && is_array( $shortcodes ) ) {
46 foreach ( $shortcodes as $shortcode ) {
47 if ( ! is_object( $shortcode ) && class_exists( $shortcode ) && method_exists( $shortcode, 'instance' ) ) {
48 $shortcode::instance();
49 }
50 }
51 }
52 }
53 }
54