| Server IP : 38.190.208.107 / Your IP : 216.73.216.187 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/test14.chuangfenglink.xyz/wp-content/themes/dt-the7/inc/extensions/ |
Upload File : |
<?php
/**
* Meta Box connection
*
* @since 3.3.2
*/
// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Include metaboxes overrides.
*
*/
require_once( PRESSCORE_EXTENSIONS_DIR . '/custom-meta-boxes/override-fields.php' );
/**
* Include Meta-Box framework.
*
*/
require_once( THE7_RWMB_DIR . 'meta-box.php' );
/**
* Include custom metaboxes.
*
*/
require_once( PRESSCORE_EXTENSIONS_DIR . '/custom-meta-boxes/metabox-fields.php' );
require_once( PRESSCORE_EXTENSIONS_DIR . '/custom-meta-boxes/class-the7-rwmb-dimension-field.php' );
/**
* Register meta boxes
*/
function presscore_register_meta_boxes() {
// Make sure there's no errors when the plugin is deactivated or during upgrade
if ( !class_exists( 'The7_RW_Meta_Box' ) ) {
return;
}
global $DT_META_BOXES;
do_action( 'the7_before_meta_box_registration' );
foreach ( $DT_META_BOXES as $meta_box ) {
new The7_RW_Meta_Box( $meta_box );
}
}
add_action( 'admin_init', 'presscore_register_meta_boxes', 30 );
/**
* Define default meta boxes for templates
*
* @TODO: Delete in the future.
*
* @param array $hidden Hidden Meta Boxes
* @param string|WP_Screen $screen Current screen
* @param bool $use_defaults Use default Meta Boxes or not
*
* @return array Hidden Meta Boxes
*/
function presscore_hidden_meta_boxes( $hidden, $screen, $use_defaults ) {
$template = dt_get_template_name();
$meta_boxes = the7_get_meta_boxes_with_template_dependencies();
foreach ( $meta_boxes as $meta_box ) {
if ( in_array( $template, (array) $meta_box['only_on']['template'], true ) ) {
$meta_box_key_to_show = array_search( $meta_box['id'], $hidden, true );
if ( false !== $meta_box_key_to_show ) {
unset( $hidden[ $meta_box_key_to_show ] );
}
} else {
$hidden[] = $meta_box['id'];
}
}
return array_unique( $hidden );
}
//add_filter('hidden_meta_boxes', 'presscore_hidden_meta_boxes', 99, 3);
/**
* @return array
*/
function the7_get_meta_boxes_with_template_dependencies() {
global $DT_META_BOXES;
$meta_boxes = array();
foreach ( $DT_META_BOXES as $meta_box ) {
if ( isset( $meta_box['only_on']['template'] ) ) {
$meta_boxes[] = $meta_box;
}
}
return $meta_boxes;
}