403Webshell
Server IP : 69.39.225.240  /  Your IP : 216.73.216.138
Web Server : Apache
System : Linux bronze7.serverhost.net 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : reademotions ( 1074)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/reademotions/www/wp-content/plugins/gravityforms/includes/blocks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/reademotions/www/wp-content/plugins/gravityforms/includes/blocks/class-gf-blocks.php
<?php

defined( 'ABSPATH' ) or die();

// Load core Block class.
require_once( plugin_dir_path( __FILE__ ) . 'class-gf-block.php' );

/**
 * Handles management of Gravity Forms editor blocks.
 *
 * @since 2.4.10
 *
 * Class GF_Blocks
 */
class GF_Blocks {

	/**
	 * Registered Gravity Forms editor blocks.
	 *
	 * @since 2.4.10
	 * @var   GF_Block[]
	 */
	private static $_blocks = array();

	/**
	 * Register a block type.
	 *
	 * @since  2.4.10
	 *
	 * @param GF_Block $block Block class.
	 *
	 * @return bool|WP_Error
	 */
	public static function register( $block ) {

		if ( ! is_subclass_of( $block, 'GF_Block' ) ) {
			return new WP_Error( 'block_not_subclass', 'Must be a subclass of GF_Block' );
		}

		// Get block type.
		$block_type = $block->get_type();

		if ( empty( $block_type ) ) {
			return new WP_Error( 'block_type_undefined', 'The type must be set' );
		}

		if ( isset( self::$_blocks[ $block_type ] ) ) {
			return new WP_Error( 'block_already_registered', 'Block type already registered: ' . $block_type );
		}

		// Register block.
		self::$_blocks[ $block_type ] = $block;

		// Initialize block.
		call_user_func( array( $block, 'init' ) );

		return true;

	}

	/**
	 * Get instance of block.
	 *
	 * @since  2.4.10
	 *
	 * @param string $block_type Block type.
	 *
	 * @return GF_Block|bool
	 */
	public static function get( $block_type ) {

		return isset( self::$_blocks[ $block_type ] ) ? self::$_blocks[ $block_type ] : false;

	}

	/**
	 * Returns an array of registered block types.
	 *
	 * @since 2.4.18
	 *
	 * @return array
	 */
	public static function get_all_types() {
		return array_keys( self::$_blocks );
	}

}

new GF_Blocks();

Youez - 2016 - github.com/yon3zu
LinuXploit