PluginProbe ʕ •ᴥ•ʔ
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress / 4.9.0
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress v4.9.0
4.12.0 4.10.0 4.9.0 4.8.1 trunk 1.0 1.1 1.12.1 1.2.3 1.2.4 1.2.5 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5 1.5.1 1.5.2 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.4.1 1.6.5 1.6.5.1 1.6.6 1.6.6.1 1.6.6.2 1.6.6.3 1.6.7 1.6.7.1 1.6.8 1.6.8.1 1.6.8.2 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.9.0 1.9.1 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.8.1 1.9.9 1.9.9.1 1.9.9.2 1.9.9.3 2.0 2.0.1 2.1 2.1.1 2.1.2 2.1.3 2.10 2.11 2.11.1 2.12 2.12.1 2.12.2 2.12.3 2.12.4 2.13 2.14 2.14.1 2.15 2.15.1 2.16 2.16.1 2.17 2.17.1 2.18 2.18.1 2.18.2 2.18.3 2.19 2.19.1 2.19.2 2.19.3 2.2 2.2.1 2.3 2.3.1 2.3.10 2.3.2 2.3.3 2.3.4 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.1.1 2.4.1.2 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5 2.5.1 2.5.2 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.7 2.7.1 2.7.2 2.8 2.9 2.9.1 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.7.5 4.7.6 4.7.7
custom-facebook-feed / inc / CFF_Elementor_Base.php
custom-facebook-feed / inc Last commit date
Admin 1 month ago Builder 1 month ago Helpers 1 month ago Integrations 1 month ago UsageTracking 1 month ago CFF_Autolink.php 1 month ago CFF_Blocks.php 1 month ago CFF_Cache.php 1 month ago CFF_Education.php 1 month ago CFF_Elementor_Base.php 1 month ago CFF_Elementor_Widget.php 1 month ago CFF_Error_Reporter.php 1 month ago CFF_FB_Settings.php 1 month ago CFF_Feed_Elementor_Control.php 1 month ago CFF_Feed_Locator.php 1 month ago CFF_Feed_Pro.php 1 month ago CFF_GDPR_Integrations.php 1 month ago CFF_Group_Posts.php 1 month ago CFF_HTTP_Request.php 1 month ago CFF_Oembed.php 1 month ago CFF_Parse.php 1 month ago CFF_Resizer.php 1 month ago CFF_Response.php 1 month ago CFF_Shortcode.php 1 month ago CFF_Shortcode_Display.php 1 month ago CFF_SiteHealth.php 1 month ago CFF_Utils.php 1 month ago CFF_View.php 1 month ago Custom_Facebook_Feed.php 1 month ago Email_Notification.php 1 month ago Platform_Data.php 1 month ago SB_Facebook_Data_Encryption.php 1 month ago SB_Facebook_Data_Manager.php 1 month ago index.php 1 month ago
CFF_Elementor_Base.php
119 lines
1 <?php
2
3 namespace CustomFacebookFeed;
4
5 use FacebookFeed\Vendor\Smashballoon\Framework\Packages\Blocks\RecommendedElementorWidgets;
6 use FacebookFeed\Vendor\Smashballoon\Framework\Packages\Blocks\SB_Feed_Blocks_Registry;
7 use FacebookFeed\Vendor\Smashballoon\Framework\Packages\Blocks\SB_Block_Utils;
8 use FacebookFeed\Vendor\Smashballoon\Framework\Packages\Blocks\SB_Elementor_Editor_Assets;
9 use CustomFacebookFeed\Builder\CFF_Db;
10
11 if (!defined('ABSPATH')) {
12 exit; // Exit if accessed directly
13 }
14
15
16 class CFF_Elementor_Base
17 {
18 private static $instance = null;
19
20 public static function register() {
21 if ( null === self::$instance ) {
22 self::$instance = new self();
23 self::$instance->init();
24 }
25 return self::$instance;
26 }
27
28 public static function instance() {
29 return self::register();
30 }
31
32 private function init() {
33 if ( doing_action( 'init' ) || did_action( 'init' ) ) {
34 $this->init_elementor_integration();
35 } else {
36 add_action( 'init', array( $this, 'init_elementor_integration' ), 4 );
37 }
38 }
39
40 public function init_elementor_integration() {
41 if ( ! did_action( 'elementor/loaded' ) ) {
42 return;
43 }
44
45 $recommended = new RecommendedElementorWidgets( 'facebook' );
46 $recommended->setup();
47
48 $registry = SB_Feed_Blocks_Registry::instance();
49 $registry->register_elementor_widget(
50 array(
51 'blockId' => 'facebook',
52 'widgetName' => 'sb-facebook-feed',
53 'globalVar' => 'cffElementorData',
54 'feedInitFn' => 'cff_init',
55 )
56 );
57
58 add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ) );
59 add_action( 'elementor/controls/register', array( $this, 'register_controls' ) );
60 add_action( 'elementor/frontend/after_register_scripts', array( $this, 'register_frontend_scripts' ) );
61 add_action( 'elementor/elements/categories_registered', array( $this, 'add_smashballoon_categories' ) );
62 add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'enqueue_editor_scripts' ) );
63 }
64
65 public function register_widgets( $widgets_manager ) {
66 // Register modern widget
67 require_once trailingslashit( CFF_PLUGIN_DIR ) . 'inc/Integrations/Elementor/CFF_Modern_Elementor_Widget.php';
68 $widgets_manager->register( new \CustomFacebookFeed\Integrations\Elementor\CFF_Modern_Elementor_Widget() );
69
70 // Register legacy widget for backward compatibility (existing pages use 'cff-widget' type)
71 require_once trailingslashit( CFF_PLUGIN_DIR ) . 'inc/CFF_Elementor_Widget.php';
72 $widgets_manager->register( new \CustomFacebookFeed\CFF_Elementor_Widget() );
73 }
74
75 public function register_controls( $controls_manager ) {
76 require_once trailingslashit( CFF_PLUGIN_DIR ) . 'inc/CFF_Feed_Elementor_Control.php';
77 $controls_manager->register( new \CustomFacebookFeed\CFF_Feed_Elementor_Control() );
78 }
79
80 public function register_frontend_scripts() {
81 \cff_main()->enqueue_styles_assets();
82 \cff_main()->enqueue_scripts_assets();
83
84 $feeds = CFF_Db::elementor_feeds_list();
85
86 $data = array(
87 'feeds' => ! empty( $feeds ) ? $feeds : array(),
88 'feed_url' => admin_url( 'admin.php?page=cff-feed-builder' ),
89 'is_pro_active' => CFF_Utils::cff_is_pro_version(),
90 );
91
92 wp_localize_script( 'cffscripts', 'cffElementorData', $data );
93
94 wp_register_script(
95 'elementor-preview',
96 CFF_PLUGIN_URL . 'assets/js/elementor-preview.js',
97 array( 'jquery' ),
98 CFFVER,
99 true
100 );
101
102 SB_Feed_Blocks_Registry::instance()->enqueue_elementor_assets();
103 }
104
105 public function add_smashballoon_categories( $elements_manager ) {
106 $elements_manager->add_category(
107 SB_Block_Utils::CATEGORY_SLUG,
108 array(
109 'title' => esc_html__( 'Smash Balloon', 'custom-facebook-feed' ),
110 'icon' => 'fa fa-plug',
111 )
112 );
113 }
114
115 public function enqueue_editor_scripts() {
116 SB_Elementor_Editor_Assets::enqueue_shared_elementor_styles( CFFVER );
117 }
118 }
119