PluginProbe
Team Section Block – Showcase Team Members with Layout Options / 1.0.3
Team Section Block – Showcase Team Members with Layout Options v1.0.3
2.0.4 2.0.3 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 2.0.0 2.0.1 2.0.2
team-section / index.php

index.php in Team Section Block – Showcase Team Members with Layout Options 1.0.3, at index.php

51 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Team Section - Block
4 * Description: Makes background element scrolls slower than foreground content.
5 * Version: 1.0.3
6 * Author: bPlugins LLC
7 * Author URI: http://bplugins.com
8 * License: GPLv3
9 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
10 * Text Domain: team-section
11 */
12
13 // ABS PATH
14 if ( !defined( 'ABSPATH' ) ) { exit; }
15
16 // Constant
17 define( 'TSB_PLUGIN_VERSION', isset($_SERVER['HTTP_HOST']) && 'localhost' === $_SERVER['HTTP_HOST'] ? time() : '1.0.2' );
18 define( 'TSB_ASSETS_DIR', plugin_dir_url( __FILE__ ) . 'assets/' );
19
20 // Team Section
21 class TSBTeamSection{
22 function __construct(){
23 add_action( 'enqueue_block_assets', [$this, 'enqueueBockAssets'] );
24 add_action( 'init', [$this, 'onInit'] );
25 }
26
27 function enqueueBockAssets(){ wp_enqueue_style( 'fontAwesome', TSB_ASSETS_DIR . 'css/fontAwesome.min.css', [], '5.15.4' ); }
28
29 function onInit() {
30 wp_register_style( 'tsb-team-editor-style', plugins_url( 'dist/editor.css', __FILE__ ), [ 'wp-edit-blocks' ], TSB_PLUGIN_VERSION ); // Backend Style
31 wp_register_style( 'tsb-team-style', plugins_url( 'dist/style.css', __FILE__ ), [ 'wp-editor' ], TSB_PLUGIN_VERSION ); // Both Style
32
33 register_block_type( __DIR__, [
34 'editor_style' => 'tsb-team-editor-style',
35 'style' => 'tsb-team-style',
36 'render_callback' => [$this, 'render']
37 ] ); // Register Block
38
39 wp_set_script_translations( 'tsb-team-editor-script', 'team-section', plugin_dir_path( __FILE__ ) . 'languages' ); // Translate
40 }
41
42 function render( $attributes, $content ){
43 extract( $attributes );
44
45 ob_start(); ?>
46 <div class='wp-block-tsb-team <?php echo 'align' . esc_attr( $align ); ?>' id='tsbTeamMembers-<?php echo esc_attr( $cId ) ?>' data-attributes='<?php echo esc_attr( wp_json_encode( $attributes ) ) ?>'></div>
47
48 <?php return ob_get_clean();
49 } // Render
50 }
51 new TSBTeamSection;