HEX
Server: nginx/1.15.10
System: Linux vps240vn 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: 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
Upload Files
File: /www/wwwroot/vietktv.vn/wp-content/themes/hardware-tools-store/custom-setting.php
<?php 

function hardware_tools_store_add_admin_menu() {
    add_menu_page(
        'Theme Settings', // Page title
        'Theme Settings', // Menu title
        'manage_options', // Capability
        'hardware-tools-store-theme-settings', // Menu slug
        'hardware_tools_store_settings_page' // Function to display the page
    );
}
add_action( 'admin_menu', 'hardware_tools_store_add_admin_menu' );

function hardware_tools_store_settings_page() {
    ?>
    <div class="wrap">
        <h1><?php esc_html_e( 'Theme Settings', 'hardware-tools-store' ); ?></h1>
        <form action="options.php" method="post">
            <?php
            settings_fields( 'hardware_tools_store_settings_group' );
            do_settings_sections( 'hardware-tools-store-theme-settings' );
            submit_button();
            ?>
        </form>
    </div>
    <?php
}

function hardware_tools_store_register_settings() {
    register_setting( 'hardware_tools_store_settings_group', 'hardware_tools_store_enable_animations' );

    add_settings_section(
        'hardware_tools_store_settings_section',
        __( 'Animation Settings', 'hardware-tools-store' ),
        null,
        'hardware-tools-store-theme-settings'
    );

    add_settings_field(
        'hardware_tools_store_enable_animations',
        __( 'Enable Animations', 'hardware-tools-store' ),
        'hardware_tools_store_enable_animations_callback',
        'hardware-tools-store-theme-settings',
        'hardware_tools_store_settings_section'
    );
}
add_action( 'admin_init', 'hardware_tools_store_register_settings' );

function hardware_tools_store_enable_animations_callback() {
    $checked = get_option( 'hardware_tools_store_enable_animations', true );
    ?>
    <input type="checkbox" name="hardware_tools_store_enable_animations" value="1" <?php checked( 1, $checked ); ?> />
    <?php
}