PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.4.25
Post Grid Gutenberg Blocks – PostX v2.4.25
5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 2.1.2 All 237 releases
ultimate-post / classes / Initialization.php

Initialization.php in Post Grid Gutenberg Blocks – PostX 2.4.25, at classes/Initialization.php

620 lines 22.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Initialization Action.
4 *
5 * @package ULTP\Notice
6 * @since v.1.1.0
7 */
8 namespace ULTP;
9
10 defined('ABSPATH') || exit;
11
12 /**
13 * Initialization class.
14 */
15 class ULTP_Initialization{
16
17 private $all_blocks;
18
19 /**
20 * Setup class.
21 *
22 * @since v.1.1.0
23 */
24 public function __construct(){
25 $this->compatibility_check();
26 $this->requires(); // Include Necessary Files
27 $this->blocks(); // Include Blocks
28 $this->include_addons(); // Include Addons
29
30 add_action('wp', array($this, 'popular_posts_tracker_callback'));
31 add_filter('block_categories_all', array($this, 'register_category_callback'), 10, 2); // Block Category Register
32 add_action('after_setup_theme', array($this, 'add_image_size'));
33
34 add_action('enqueue_block_editor_assets', array($this, 'register_scripts_back_callback')); // Only editor
35 add_action('admin_enqueue_scripts', array($this, 'register_scripts_option_panel_callback')); // Option Panel
36 add_action('wp_enqueue_scripts', array($this, 'register_scripts_front_callback')); // Both frontend
37 register_activation_hook(ULTP_PATH.'ultimate-post.php', array($this, 'install_hook'));
38 add_action( 'activated_plugin', array($this, 'activation_redirect'));
39
40 add_action('wp_ajax_ultp_next_prev', array($this, 'ultp_next_prev_callback')); // Next Previous AJAX Call
41 add_action('wp_ajax_nopriv_ultp_next_prev', array($this, 'ultp_next_prev_callback')); // Next Previous AJAX Call Logout User
42 add_action('wp_ajax_ultp_filter', array($this, 'ultp_filter_callback')); // Next Previous AJAX Call
43 add_action('wp_ajax_nopriv_ultp_filter', array($this, 'ultp_filter_callback')); // Next Previous AJAX Call Logout User
44 add_action('wp_ajax_ultp_pagination', array($this, 'ultp_pagination_callback')); // Page Number AJAX Call
45 add_action('wp_ajax_nopriv_ultp_pagination',array($this, 'ultp_pagination_callback')); // Page Number AJAX Call Logout User
46 add_action('wp_ajax_ultp_addon', array($this, 'ultp_addon_callback')); // Next Previous AJAX Call
47
48 add_action('admin_init', array($this, 'check_theme_compatibility'));
49 add_action( 'after_switch_theme', array($this, 'wpxpo_swithch_thememe'));
50 }
51
52
53 /**
54 * Theme Switch Callback
55 *
56 * @since v.1.1.0
57 * @return NULL
58 */
59 public function wpxpo_swithch_thememe () {
60 $this->check_theme_compatibility();
61 }
62
63
64 /**
65 * Theme Compatibility Action
66 *
67 * @since v.1.1.0
68 * @return NULL
69 */
70 public function check_theme_compatibility() {
71 $licence = apply_filters( 'ultp_theme_integration' , FALSE);
72 $theme = get_transient( 'ulpt_theme_enable' );
73
74 if( $licence ) {
75 if( $theme != 'integration' ) {
76 $themes = wp_get_theme();
77 $api_params = array(
78 'wpxpo_theme_action' => 'theme_license',
79 'slug' => $themes->get('TextDomain'),
80 'author' => $themes->get('Author'),
81 'item_id' => 181,
82 'url' => home_url()
83 );
84
85 $response = wp_remote_post( 'https://www.wpxpo.com', array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
86
87 if ( !is_wp_error( $response ) || 200 === wp_remote_retrieve_response_code( $response ) ) {
88 $license_data = json_decode( wp_remote_retrieve_body( $response ) );
89 if(isset($license_data->license)) {
90 if ( $license_data->license == 'valid' ) {
91 set_transient( 'ulpt_theme_enable', 'integration', 2592000 ); // 30 days time
92 }
93 }
94 }
95 }
96 } else {
97 if ( $theme == 'integration' ) {
98 delete_transient('ulpt_theme_enable');
99 }
100 }
101 }
102
103
104 /**
105 * Check Compatibility
106 *
107 * @since v.1.0.0
108 * @return NULL
109 */
110 public function compatibility_check(){
111 require_once ULTP_PATH.'classes/Compatibility.php';
112 new \ULTP\Compatibility();
113 }
114
115
116 /**
117 * Option Panel CSS and JS Scripts
118 *
119 * @since v.1.0.0
120 * @return NULL
121 */
122 public function register_scripts_option_panel_callback(){
123 wp_enqueue_style('wp-color-picker');
124 wp_enqueue_script('wp-color-picker');
125 wp_enqueue_script('ultp-option-script', ULTP_URL.'assets/js/ultp-option.js', array('jquery'), ULTP_VER, true);
126 wp_enqueue_style('ultp-option-style', ULTP_URL.'assets/css/ultp-option.css', array(), ULTP_VER);
127 wp_localize_script('ultp-option-script', 'ultp_option_panel', array(
128 'width' => ultimate_post()->get_setting('editor_container'),
129 'security' => wp_create_nonce('ultp-nonce'),
130 'ajax' => admin_url('admin-ajax.php')
131 ));
132 }
133
134
135 /**
136 * Common Frontend and Backend CSS and JS Scripts
137 *
138 * @since v.1.0.0
139 * @return NULL
140 */
141 public function register_scripts_common(){
142 wp_enqueue_style('ultp-style', ULTP_URL.'assets/css/style.min.css', array(), ULTP_VER );
143 wp_enqueue_script('ultp-script', ULTP_URL.'assets/js/ultp.min.js', array('jquery'), ULTP_VER, true);
144 wp_localize_script('ultp-script', 'ultp_data_frontend', array(
145 'url' => ULTP_URL,
146 'ajax' => admin_url('admin-ajax.php'),
147 'security' => wp_create_nonce('ultp-nonce')
148 ));
149
150 }
151
152
153 /**
154 * Only Frontend CSS and JS Scripts
155 *
156 * @since v.1.0.0
157 * @return NULL
158 */
159 public function register_scripts_front_callback() {
160 $call_common = false;
161 if (isset($_GET['preview_id']) && isset($_GET['preview_nonce'])) {
162 $call_common = true;
163 $this->register_scripts_common();
164 } else if ('yes' == get_post_meta(ultimate_post()->get_ID(), '_ultp_active', true)) {
165 $call_common = true;
166 $this->register_scripts_common();
167 } else if (ultimate_post()->is_builder()) {
168 $call_common = true;
169 $this->register_scripts_common();
170 }
171
172 // For WidgetWidget
173 $has_block = false;
174 $widget_blocks = array();
175 global $wp_registered_sidebars, $sidebars_widgets;
176 foreach ($wp_registered_sidebars as $key => $value) {
177 if (is_active_sidebar($key)) {
178 foreach ($sidebars_widgets[$key] as $val) {
179 if (strpos($val, 'block-') !== false) {
180 if (empty($widget_blocks)) {
181 $widget_blocks = get_option( 'widget_block' );
182 }
183 foreach ( (array) $widget_blocks as $block ) {
184 if ( isset( $block['content'] ) && strpos($block['content'], 'wp:ultimate-post') !== false ) {
185 $has_block = true;
186 break;
187 }
188 }
189 if ($has_block) {
190 break;
191 }
192 }
193 }
194 }
195 }
196 if ($has_block) {
197 if (!$call_common) {
198 $this->register_scripts_common();
199 }
200 $css = get_option('ultp-widget', true);
201 if ($css) {
202 wp_register_style('ultp-post-widget', false );
203 wp_enqueue_style('ultp-post-widget' );
204 wp_add_inline_style('ultp-post-widget', $css);
205 }
206 }
207 }
208
209
210 /**
211 * Only Backend CSS and JS Scripts
212 *
213 * @since v.1.0.0
214 * @return NULL
215 */
216 public function register_scripts_back_callback() {
217 $this->register_scripts_common();
218 global $pagenow;
219 $depends = 'wp-editor';
220 if ( $pagenow === 'widgets.php' ) {
221 $depends = 'wp-edit-widgets';
222 }
223 wp_enqueue_script('ultp-blocks-editor-script', ULTP_URL.'assets/js/editor.blocks.min.js', array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', $depends ), ULTP_VER, true);
224 wp_enqueue_style('ultp-blocks-editor-css', ULTP_URL.'assets/css/blocks.editor.css', array(), ULTP_VER);
225 if(is_rtl()){
226 wp_enqueue_style('ultp-blocks-editor-rtl-css', ULTP_URL.'assets/css/rtl.css', array(), ULTP_VER);
227 }
228 $is_active = ultimate_post()->is_lc_active();
229 wp_localize_script('ultp-blocks-editor-script', 'ultp_data', array(
230 'url' => ULTP_URL,
231 'ajax' => admin_url('admin-ajax.php'),
232 'security' => wp_create_nonce('ultp-nonce'),
233 'hide_import_btn' => ultimate_post()->get_setting('hide_import_btn'),
234 'upload' => wp_upload_dir()['basedir'] . '/ultp',
235 'premium_link' => ultimate_post()->get_premium_link(),
236 'license' => $is_active ? get_option('edd_ultp_license_key') : '',
237 'active' => $is_active,
238 'archive' => $is_active ? ultimate_post()->is_archive_builder() : '',
239 'settings' => ultimate_post()->get_setting()
240 ));
241
242 wp_set_script_translations( 'ultp-blocks-editor-script', 'ultimate-post', ULTP_PATH . 'languages/' );
243 }
244
245
246 /**
247 * Fire When Plugin First Install
248 *
249 * @since v.1.0.0
250 * @return NULL
251 */
252 public function install_hook() {
253 if (!get_option('ultp_options')) {
254 ultimate_post()->init_set_data();
255 }
256 }
257
258
259 /**
260 * Redirect After Active Plugin
261 *
262 * @since v.1.0.0
263 * @param STRING | Plugin Path
264 * @return NULL
265 */
266 public function activation_redirect($plugin) {
267 if( $plugin == 'ultimate-post/ultimate-post.php' ) {
268 exit(wp_redirect(admin_url('admin.php?page=ultp-settings')));
269 }
270 }
271
272
273 /**
274 * Require Blocks
275 *
276 * @since v.1.0.0
277 * @return NULL
278 */
279 public function blocks() {
280 $setting = ultimate_post()->get_setting();
281 if (!isset($setting['post_list_1']) || $setting['post_list_1'] == 'yes') {
282 require_once ULTP_PATH.'blocks/Post_List_1.php';
283 $this->all_blocks['ultimate-post_post-list-1'] = new \ULTP\blocks\Post_List_1();
284 }
285 if (!isset($setting['post_list_2']) || $setting['post_list_2'] == 'yes') {
286 require_once ULTP_PATH.'blocks/Post_List_2.php';
287 $this->all_blocks['ultimate-post_post-list-2'] = new \ULTP\blocks\Post_List_2();
288 }
289 if (!isset($setting['post_list_3']) || $setting['post_list_3'] == 'yes') {
290 require_once ULTP_PATH.'blocks/Post_List_3.php';
291 $this->all_blocks['ultimate-post_post-list-3'] = new \ULTP\blocks\Post_List_3();
292 }
293 if (!isset($setting['post_list_4']) || $setting['post_list_4'] == 'yes') {
294 require_once ULTP_PATH.'blocks/Post_List_4.php';
295 $this->all_blocks['ultimate-post_post-list-4'] = new \ULTP\blocks\Post_List_4();
296 }
297 if (!isset($setting['post_grid_1']) || $setting['post_grid_1'] == 'yes') {
298 require_once ULTP_PATH.'blocks/Post_Grid_1.php';
299 $this->all_blocks['ultimate-post_post-grid-1'] = new \ULTP\blocks\Post_Grid_1();
300 }
301 if (!isset($setting['post_grid_2']) || $setting['post_grid_2'] == 'yes') {
302 require_once ULTP_PATH.'blocks/Post_Grid_2.php';
303 $this->all_blocks['ultimate-post_post-grid-2'] = new \ULTP\blocks\Post_Grid_2();
304 }
305 if (!isset($setting['post_grid_3']) || $setting['post_grid_3'] == 'yes') {
306 require_once ULTP_PATH.'blocks/Post_Grid_3.php';
307 $this->all_blocks['ultimate-post_post-grid-3'] = new \ULTP\blocks\Post_Grid_3();
308 }
309 if (!isset($setting['post_grid_4']) || $setting['post_grid_4'] == 'yes') {
310 require_once ULTP_PATH.'blocks/Post_Grid_4.php';
311 $this->all_blocks['ultimate-post_post-grid-4'] = new \ULTP\blocks\Post_Grid_4();
312 }
313 if (!isset($setting['post_grid_5']) || $setting['post_grid_5'] == 'yes') {
314 require_once ULTP_PATH.'blocks/Post_Grid_5.php';
315 $this->all_blocks['ultimate-post_post-grid-5'] = new \ULTP\blocks\Post_Grid_5();
316 }
317 if (!isset($setting['post_grid_6']) || $setting['post_grid_6'] == 'yes') {
318 require_once ULTP_PATH.'blocks/Post_Grid_6.php';
319 $this->all_blocks['ultimate-post_post-grid-6'] = new \ULTP\blocks\Post_Grid_6();
320 }
321 if (!isset($setting['post_grid_7']) || $setting['post_grid_7'] == 'yes') {
322 require_once ULTP_PATH.'blocks/Post_Grid_7.php';
323 $this->all_blocks['ultimate-post_post-grid-7'] = new \ULTP\blocks\Post_Grid_7();
324 }
325 if (!isset($setting['post_slider_1']) || $setting['post_slider_1'] == 'yes') {
326 require_once ULTP_PATH.'blocks/Post_Slider_1.php';
327 $this->all_blocks['ultimate-post_post-slider-1'] = new \ULTP\blocks\Post_Slider_1();
328 }
329 if (!isset($setting['post_module_1']) || $setting['post_module_1'] == 'yes') {
330 require_once ULTP_PATH.'blocks/Post_Module_1.php';
331 $this->all_blocks['ultimate-post_post-module-1'] = new \ULTP\blocks\Post_Module_1();
332 }
333 if (!isset($setting['post_module_2']) || $setting['post_module_2'] == 'yes') {
334 require_once ULTP_PATH.'blocks/Post_Module_2.php';
335 $this->all_blocks['ultimate-post_post-module-2'] = new \ULTP\blocks\Post_Module_2();
336 }
337 if (!isset($setting['heading']) || $setting['heading'] == 'yes') {
338 require_once ULTP_PATH.'blocks/Heading.php';
339 $this->all_blocks['ultimate-post_heading'] = new \ULTP\blocks\Heading();
340 }
341 if (!isset($setting['image']) || $setting['image'] == 'yes') {
342 require_once ULTP_PATH.'blocks/Image.php';
343 $this->all_blocks['ultimate-post_image'] = new \ULTP\blocks\Image();
344 }
345 if (!isset($setting['taxonomy']) || $setting['taxonomy'] == 'yes') {
346 require_once ULTP_PATH.'blocks/Taxonomy.php';
347 $this->all_blocks['ultimate-post_ultp-taxonomy'] = new \ULTP\blocks\Taxonomy();
348 }
349
350 require_once ULTP_PATH.'blocks/Archive_Title.php';
351 $this->all_blocks['ultimate-post_archive-title'] = new \ULTP\blocks\Archive_Title();
352 }
353
354
355 /**
356 * Necessary Requires Class
357 *
358 * @since v.1.0.0
359 * @return NULL
360 */
361 public function requires() {
362 require_once ULTP_PATH.'classes/Notice.php';
363 require_once ULTP_PATH.'classes/Styles.php';
364 require_once ULTP_PATH.'classes/Options.php';
365 require_once ULTP_PATH.'classes/REST_API.php';
366 require_once ULTP_PATH.'classes/Caches.php';
367 new \ULTP\REST_API();
368 new \ULTP\Caches();
369 new \ULTP\Options();
370 new \ULTP\Styles();
371 new \ULTP\Notice();
372
373 require_once ULTP_PATH.'classes/Deactive.php';
374 new \ULTP\Deactive();
375 }
376
377
378 /**
379 * Block Categories Initialization
380 *
381 * @since v.1.0.0
382 * @param $categories(ARRAY) | $post (ARRAY)
383 * @return NULL
384 */
385 public function register_category_callback( $categories, $post ) {
386 return array_merge(
387 array(
388 array(
389 'slug' => 'ultimate-post',
390 'title' => __( 'PostX - Gutenberg Post Blocks', 'ultimate-post' )
391 )
392 ), $categories
393 );
394 }
395
396
397 /**
398 * Post View Counter for Every Post
399 *
400 * @since v.1.0.0
401 * @param NUMBER | Post ID
402 * @return NULL
403 */
404 public function popular_posts_tracker_callback($post_id) {
405 if (!is_single()){ return; }
406 global $post;
407 $post_id = $post->ID;
408 $isEnable = apply_filters('ultp_view_cookies', true);
409 if ($post_id && $isEnable) {
410 $has_cookie = isset( $_COOKIE['ultp_view_'.$post_id] ) ? $_COOKIE['ultp_view_'.$post_id] : false;
411 if (!$has_cookie) {
412 $count = (int)get_post_meta( $post_id, '__post_views_count', true );
413 update_post_meta($post_id, '__post_views_count', $count ? (int)$count + 1 : 1 );
414 setcookie( 'ultp_view_'.$post_id, 1, time() + 86400, COOKIEPATH ); // 1 days cookies
415 }
416 }
417 }
418
419
420 /**
421 * Set Image Size
422 *
423 * @since v.1.0.0
424 * @return NULL
425 */
426 public function add_image_size() {
427 $size_disable = ultimate_post()->get_setting('disable_image_size');
428 if ($size_disable != 'yes') {
429 add_image_size('ultp_layout_landscape_large', 1200, 800, true);
430 add_image_size('ultp_layout_landscape', 870, 570, true);
431 add_image_size('ultp_layout_portrait', 600, 900, true);
432 add_image_size('ultp_layout_square', 600, 600, true);
433 }
434 }
435
436
437 /**
438 * Include Addons Directory
439 *
440 * @since v.1.0.0
441 * @return NULL
442 */
443 public function include_addons() {
444 $addons_dir = array_filter(glob(ULTP_PATH.'addons/*'), 'is_dir');
445 if (count($addons_dir) > 0) {
446 foreach( $addons_dir as $key => $value ) {
447 $addon_dir_name = str_replace(dirname($value).'/', '', $value);
448 $file_name = ULTP_PATH . 'addons/'.$addon_dir_name.'/init.php';
449 if ( file_exists($file_name) ) {
450 include_once $file_name;
451 }
452 }
453 }
454 }
455
456
457 /**
458 * Addon Callback
459 *
460 * @since v.1.0.0
461 * @return STRING
462 */
463 public function ultp_addon_callback() {
464 if (!wp_verify_nonce($_REQUEST['wpnonce'], 'ultp-nonce') && $local){
465 return ;
466 }
467 $addon_name = sanitize_text_field($_POST['addon']);
468 $addon_value = sanitize_text_field($_POST['value']);
469 if ($addon_name && current_user_can('administrator')) {
470 $addon_data = ultimate_post()->get_setting();
471 $addon_data[$addon_name] = $addon_value;
472 $GLOBALS['ultp_settings'][$addon_name] = $addon_value;
473 update_option('ultp_options', $addon_data);
474 }
475 }
476
477
478 /**
479 * Next Preview Callback of the Blocks
480 *
481 * @since v.1.0.0
482 * @return STRING
483 */
484 public function ultp_next_prev_callback() {
485 if (!wp_verify_nonce($_REQUEST['wpnonce'], 'ultp-nonce') && $local){
486 return ;
487 }
488
489 $paged = sanitize_text_field($_POST['paged']);
490 $blockId = sanitize_text_field($_POST['blockId']);
491 $postId = sanitize_text_field($_POST['postId']);
492 $blockRaw = sanitize_text_field($_POST['blockName']);
493 $builder = isset($_POST['builder']) ? sanitize_text_field($_POST['builder']) : '';
494
495 $blockName = str_replace('_','/', $blockRaw);
496
497 if( $paged && $blockId && $postId && $blockName ) {
498 $post = get_post($postId);
499 if (has_blocks($post->post_content)) {
500 $blocks = parse_blocks($post->post_content);
501 $this->block_return($blocks, $paged, $blockId, $blockRaw, $blockName, $builder, $postId);
502 }
503 }
504 }
505
506
507 /**
508 * Filter Callback of the Blocks
509 *
510 * @since v.1.0.0
511 * @return STRING
512 */
513 public function filter_block_return($blocks, $blockId, $blockRaw, $blockName, $taxtype, $taxonomy) {
514 foreach ($blocks as $key => $value) {
515 if($blockName == $value['blockName']) {
516 if($value['attrs']['blockId'] == $blockId) {
517 $attr = $this->all_blocks[$blockRaw]->get_attributes(true);
518 if($taxonomy) {
519 $value['attrs']['queryTaxValue'] = json_encode(array($taxonomy));
520 $value['attrs']['queryTax'] = $taxtype;
521 }
522 if(isset($value['attrs']['queryNumber'])){
523 $value['attrs']['queryNumber'] = $value['attrs']['queryNumber'];
524 }
525 $attr = array_merge($attr, $value['attrs']);
526 echo $this->all_blocks[$blockRaw]->content($attr, true);
527 die();
528 }
529 }
530 if(!empty($value['innerBlocks'])){
531 $this->filter_block_return($value['innerBlocks'], $blockId, $blockRaw, $blockName, $taxtype, $taxonomy);
532 }
533 }
534 }
535
536
537 /**
538 * Filter Callback of the Blocks
539 *
540 * @since v.1.0.0
541 * @return STRING
542 */
543 public function ultp_filter_callback() {
544 if (!wp_verify_nonce($_REQUEST['wpnonce'], 'ultp-nonce') && $local){
545 return ;
546 }
547
548 $taxtype = sanitize_text_field($_POST['taxtype']);
549 if( $taxtype ) {
550 $blockId = sanitize_text_field($_POST['blockId']);
551 $postId = sanitize_text_field($_POST['postId']);
552 $taxonomy = sanitize_text_field($_POST['taxonomy']);
553 $blockRaw = sanitize_text_field($_POST['blockName']);
554 $blockName = str_replace('_','/', $blockRaw);
555 $post = get_post($postId);
556 if (has_blocks($post->post_content)) {
557 $blocks = parse_blocks($post->post_content);
558 $this->filter_block_return($blocks, $blockId, $blockRaw, $blockName, $taxtype, $taxonomy);
559 }
560 }
561 }
562
563
564 /**
565 * Pagination of the Blocks
566 *
567 * @since v.1.0.0
568 * @return STRING
569 */
570 public function ultp_pagination_callback() {
571 if (!wp_verify_nonce($_REQUEST['wpnonce'], 'ultp-nonce') && $local) {
572 return ;
573 }
574
575 $paged = sanitize_text_field($_POST['paged']);
576 if($paged) {
577 $blockId = sanitize_text_field($_POST['blockId']);
578 $postId = sanitize_text_field($_POST['postId']);
579 $blockRaw = sanitize_text_field($_POST['blockName']);
580 $builder = isset($_POST['builder']) ? sanitize_text_field($_POST['builder']) : '';
581 $blockName = str_replace('_','/', $blockRaw);
582 $post = get_post($postId);
583 if (has_blocks($post->post_content)) {
584 $blocks = parse_blocks($post->post_content);
585 $this->block_return($blocks, $paged, $blockId, $blockRaw, $blockName, $builder, $postId);
586 }
587 }
588 }
589
590
591 /**
592 * Blocks Content Start
593 *
594 * @since v.1.0.0
595 * @return STRING
596 */
597 public function block_return($blocks, $paged, $blockId, $blockRaw, $blockName, $builder, $postId) {
598 foreach ($blocks as $key => $value) {
599 if($blockName == $value['blockName']) {
600 if($value['attrs']['blockId'] == $blockId) {
601 $attr = $this->all_blocks[$blockRaw]->get_attributes(true);
602 $value['attrs']['paged'] = $paged;
603 if ($builder) {
604 $value['attrs']['builder'] = $builder;
605 }
606 if ($postId) {
607 $attr['current_post'] = $postId;
608 }
609 $attr = array_merge($attr, $value['attrs']);
610 echo $this->all_blocks[$blockRaw]->content($attr, true);
611 die();
612 }
613 }
614 if(!empty($value['innerBlocks'])){
615 $this->block_return($value['innerBlocks'], $paged, $blockId, $blockRaw, $blockName, $builder, $postId);
616 }
617 }
618 }
619
620 }