| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 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/wp.3/wp-content/plugins/js_composer/include/autoload/ |
Upload File : |
<?php
/**
* Autoload hooks related autosave plugin functionality.
*
* @note we require our autoload files everytime and everywhere after plugin load.
*/
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
if ( ! function_exists( 'vc_auto_save_add_settings' ) ) {
/**
* Adds settings for auto-save feature.
*
* @param \Vc_Settings $settings The Visual Composer settings object.
* @since 7.6
*/
function vc_auto_save_add_settings( $settings ) {
$settings->addField(
'general',
esc_html__( 'Auto save', 'js_composer' ),
'auto_save',
'vc_auto_save_sanitize_disable_callback',
'vc_auto_save_disable_render_callback',
[ 'info' => esc_html__( 'Enable auto-save, or use legacy save.', 'js_composer' ) ]
);
}
}
if ( ! function_exists( 'vc_auto_save_sanitize_disable_callback' ) ) {
/**
* Sanitizes the auto-save option.
*
* @param mixed $rules The auto-save rules.
* @return bool Sanitized auto-save status.
* @since 7.6
*/
function vc_auto_save_sanitize_disable_callback( $rules ) {
return (bool) $rules;
}
}
if ( ! function_exists( 'vc_auto_save_disable_render_callback' ) ) {
/**
* Renders the auto-save checkbox in the WordPress dashboard,
* under WPBakery -> General Settings.
*
* @since 7.6
*/
function vc_auto_save_disable_render_callback() {
$checked = get_option( 'wpb_js_auto_save', false );
?>
<label>
<input type="checkbox"<?php echo esc_attr( $checked ) ? ' checked' : ''; ?> value="1"
id="<?php echo esc_attr( 'wpb_js_auto_save' ); ?>"
name="<?php echo esc_attr( 'wpb_js_auto_save' ); ?>">
<?php esc_html_e( 'Enable', 'js_composer' ); ?>
</label>
<?php
}
}
if ( ! function_exists( 'wpb_add_element_controls' ) ) {
/**
* Adds controls for elements' Edit Form panel.
*
* @since 7.6
*/
function wpb_add_element_controls() {
if ( ! get_option( 'wpb_js_auto_save' ) ) {
vc_include_template('editors/popups/vc_ui-footer.tpl.php', [
'controls' => [
[
'name' => 'close',
'label' => esc_html__( 'Close', 'js_composer' ),
'css_classes' => 'vc_ui-button-fw',
],
[
'name' => 'save',
'label' => esc_html__( 'Save changes', 'js_composer' ),
'css_classes' => 'vc_ui-button-fw',
'style' => 'action',
],
],
]);
}
}
}
add_action( 'vc_settings_tab-general', 'vc_auto_save_add_settings' );
add_action( 'wpb_add_element_controls', 'wpb_add_element_controls' );