PluginProbe ʕ •ᴥ•ʔ
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress / 4.10.0
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress v4.10.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 / Admin / Blocks / CFF_Modern_Feed_Block.php
custom-facebook-feed / inc / Admin / Blocks Last commit date
CFF_Modern_Feed_Block.php 3 weeks ago
CFF_Modern_Feed_Block.php
87 lines
1 <?php
2
3 namespace CustomFacebookFeed\Admin\Blocks;
4
5 use FacebookFeed\Vendor\Smashballoon\Framework\Packages\Blocks\SB_Feed_Block;
6 use CustomFacebookFeed\Builder\CFF_Db;
7
8 class CFF_Modern_Feed_Block extends SB_Feed_Block {
9
10 protected function get_block_name() {
11 return 'smashballoon/facebook-feed';
12 }
13
14 protected function get_shortcode_tag() {
15 return 'custom-facebook-feed';
16 }
17
18 protected function get_script_handle() {
19 return 'sb-feed-blocks';
20 }
21
22 protected function get_text_domain() {
23 return 'custom-facebook-feed';
24 }
25
26 protected function get_plugin_dir() {
27 return trailingslashit( CFF_PLUGIN_DIR );
28 }
29
30 protected function get_enqueue_scripts_action() {
31 return 'cff_enqueue_scripts';
32 }
33
34 protected function get_localize_var_name() {
35 return 'cffFacebookFeedBlock';
36 }
37
38 protected function get_feed_block_id() {
39 return 'facebook';
40 }
41
42 protected function get_init_function() {
43 return 'cff_init';
44 }
45
46 protected function get_block_dir() {
47 return $this->get_plugin_dir() . 'vendor/smashballoon/framework/Packages/Blocks/dist/feed-blocks/facebook';
48 }
49
50 protected function get_editor_localize_data() {
51 $feeds = CFF_Db::feeds_query();
52
53 return array(
54 'feeds' => ! empty( $feeds ) ? $feeds : array(),
55 'feed_url' => admin_url( 'admin.php?page=cff-feed-builder' ),
56 'nonce' => wp_create_nonce( 'cff-blocks' ),
57 );
58 }
59
60 public function register_hooks() {
61 add_action(
62 'cff_enqueue_scripts',
63 function ( $force = false ) {
64 \cff_main()->enqueue_styles_assets();
65 \cff_main()->enqueue_scripts_assets();
66 // When the parent block fires this action with $force = true (iframe
67 // editor preview or a page that contains the block) the feed must
68 // load regardless of the "load assets only with shortcode" option,
69 // which otherwise prevents enqueue_*_assets() from enqueueing.
70 if ( $force ) {
71 wp_enqueue_style( 'cff' );
72 wp_enqueue_script( 'cffscripts' );
73 }
74 }
75 );
76
77 parent::register_hooks();
78
79 if ( doing_action( 'init' ) || did_action( 'init' ) ) {
80 $this->register_block();
81 }
82
83 remove_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor_assets' ) );
84 add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor_assets' ), 25 );
85 }
86 }
87