PluginProbe
Section Collection – Add Ready-made Sections to Design Modern Websites / 1.0.7
Section Collection – Add Ready-made Sections to Design Modern Websites v1.0.7
trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 All 43 releases
section-collection / section-collection.php

section-collection.php in Section Collection – Add Ready-made Sections to Design Modern Websites 1.0.7, at section-collection.php

62 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Section Collection
4 * Description: A versatile section collection plugin featuring essential UI blocks to craft impactful, engaging, and user-centric web pages.
5 * Version: 1.0.7
6 * Author: bPlugins
7 * Author URI: https://bplugins.com
8 * License: GPLv3
9 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
10 * Text Domain: b-blocks
11 */
12
13 // ABS PATH
14 if ( !defined( 'ABSPATH' ) ) { exit; }
15
16 // Constant
17 define( 'BPSC_VERSION', isset( $_SERVER['HTTP_HOST'] ) && 'localhost' === $_SERVER['HTTP_HOST'] ? time() : '1.0.7' );
18 define( 'BPSC_DIR_URL', plugin_dir_url( __FILE__ ) );
19 define( 'BPSC_DIR_PATH', plugin_dir_path( __FILE__ ) );
20
21
22 // require_once BPSC_DIR_PATH . '/includes/Utils.php';
23 // require_once BPSC_DIR_PATH . '/includes/GetCSS.php';
24 // require_once BPSC_DIR_PATH . '/includes/EnqueueAssets.php';
25
26
27
28 if( !class_exists( 'BPSCPlugin' ) ){
29 class BPSCPlugin{
30 function __construct(){
31 add_action( 'init', [ $this, 'onInit' ] );
32 add_action( 'enqueue_block_editor_assets', [ $this, 'enqueueAssets' ] );
33 add_action( 'wp_enqueue_scripts', [ $this, 'enqueueScripts' ] );
34 add_filter( 'block_categories_all', [$this, 'registerCategories'] );
35 }
36
37 function onInit(){
38 $blocks =['testimonial_block', 'timeline_block', 'ticker', 'about-us', 'team-section', 'faq', 'call-to-actions', 'info-list-block', 'hero-section', 'pricing-table-section', 'feature-details', 'info-grid', 'feature-overview-section', 'modern-faq-section'];
39 foreach ( $blocks as $block ) {
40 register_block_type( __DIR__ . "/build/".$block );
41 }
42 }
43 function enqueueAssets(){
44 wp_enqueue_style( 'bndl-style', BPSC_DIR_URL . 'build/index.css', [], BPSC_VERSION );
45 wp_enqueue_script( 'bndl-script', BPSC_DIR_URL . 'build/index.js', ['wp-blocks'], BPSC_VERSION, true );
46 }
47
48 function enqueueScripts(){
49 wp_enqueue_script( 'bndl-advanced-script', BPSC_DIR_URL . 'build/advanced.js', [], BPSC_VERSION, true );
50 }
51
52 function registerCategories( $categories ){
53 return array_merge( [ [
54 'slug' => 'bPlugins',
55 'title' => __( 'Section Collection', 'b-plugins' ),
56 ] ], $categories );
57 }
58 }
59 new BPSCPlugin();
60 }
61
62