Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /home/claqxcrl/anfangola.com/wp-content/plugins/blockspare/inc/layout/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/claqxcrl/anfangola.com/wp-content/plugins/blockspare/inc/layout/components.php
<?php
/**
 * Register layouts and sections for the Layout block.
 *
 * @package Blockspare
 */

namespace Blockspare\Layouts;
include BLOCKSPARE_PLUGIN_DIR .'inc/template-library/init.php';
add_action( 'plugins_loaded', __NAMESPACE__ . '\register_components', 11 );
/**
 * Registers section and layout components.
 *
 * @since 2.0
 */
function register_components() {
	$blocks_lists = array();

	$templates = apply_filters( 'blockspare_template_library', $blocks_lists );
	$get_templates = get_posts(array('post_type'=>'bs_templates','posts_per_page'=>-1));
	if(!empty($get_templates)){
		foreach($get_templates as $res){
			//$get_meta = get_post_meta($res->ID,'bs_template_category');
			$array=array(
			'type'     => 'templates',
			//'item'     =>($get_meta)?$get_meta:$res->post_title,
			'item'     =>[$res->post_title],
			'key'      => 'bs_template_'.$res->ID,
			'name'     =>$res->post_title,
			'blockLink'=> get_the_permalink($res->ID),
			'content'  =>$res->post_content
		);

		

		array_push($templates,$array);

		}
	}

	

	if(!empty($templates)){
		foreach($templates as $temp){
			
		blockspare_register_layout_component($temp);
		}
	}

}





ZeroDay Forums Mini