| Server IP : www.new.bangkokfinder.com / Your IP : 104.23.176.10 Web Server : nginx/1.20.1 System : Linux new 4.15.0-159-generic #167-Ubuntu SMP Tue Sep 21 08:55:05 UTC 2021 x86_64 User : bangkokfinder ( 1000) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/bangkokfinder/www/wp-content/plugins/generateblocks-pro/includes/ |
Upload File : |
<?php
/**
* General actions and filters.
*
* @package GenerateBlocks
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Build our settings area.
*
* @since 1.0
*/
class GenerateBlocks_Pro_Settings {
/**
* Instance.
*
* @access private
* @var object Instance
*/
private static $instance;
/**
* Initiator.
*
* @return object initialized object of class.
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Initiate our class.
*/
public function __construct() {
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
add_action( 'generateblocks_settings_area', array( $this, 'add_license_key_area' ), 5 );
add_action( 'generateblocks_settings_area', array( $this, 'add_template_library_settings' ), 20 );
}
/**
* Enqueue our scripts.
*/
public function enqueue_scripts() {
$screen = get_current_screen();
if ( 'generateblocks_page_generateblocks-settings' === $screen->id ) {
$assets = generateblocks_pro_get_enqueue_assets(
'dashboard',
[
'dependencies' => array( 'generateblocks-settings', 'wp-api', 'wp-i18n', 'wp-components', 'wp-element', 'wp-api-fetch' ),
'version' => GENERATEBLOCKS_PRO_VERSION,
]
);
wp_enqueue_script(
'generateblocks-pro-settings',
GENERATEBLOCKS_PRO_DIR_URL . 'dist/dashboard.js',
$assets['dependencies'],
$assets['version'],
true
);
wp_set_script_translations( 'generateblocks-pro-settings', 'generateblocks-pro', GENERATEBLOCKS_PRO_DIR . 'languages' );
wp_localize_script(
'generateblocks-pro-settings',
'generateBlocksProSettings',
array(
'settings' => wp_parse_args(
get_option( 'generateblocks', array() ),
generateblocks_get_option_defaults()
),
'adminSettings' => wp_parse_args(
get_option( 'generateblocks_admin', array() ),
generateblocks_pro_get_admin_option_defaults()
),
'licenseSettings' => wp_parse_args(
get_option( 'generateblocks_pro_licensing', array() ),
generateblocks_pro_get_license_defaults()
),
'useLegacyPatternLibrary' => generateblocks_pro_has_legacy_patterns(),
)
);
wp_enqueue_style(
'generateblocks-pro-settings',
GENERATEBLOCKS_PRO_DIR_URL . 'dist/dashboard.css',
array( 'wp-components' ),
GENERATEBLOCKS_PRO_VERSION
);
}
}
/**
* Add license key container.
*
* @since 1.2.0
*/
public function add_license_key_area() {
echo '<div id="gblocks-license-key-settings"></div>';
}
/**
* Add Template Library container.
*
* @since 1.2.0
*/
public function add_template_library_settings() {
echo '<div id="gblocks-template-library-settings"></div>';
}
}
GenerateBlocks_Pro_Settings::get_instance();