コード例 #1
0
ファイル: envato.php プロジェクト: sabdev1/ljcdevsab
/**
 * Envato Toolkit
 */
function envato_toolkit_admin_init()
{
    require_once locate_template('/inc/envato-wordpress-toolkit-library/class-envato-wordpress-theme-upgrader.php');
    $u = new DFD_Envato_WordPress_Theme_Upgrader();
    if ($u->validateUserOptions() && $u->continueChecking()) {
        $u->check_update();
    }
}
コード例 #2
0
ファイル: defaults.php プロジェクト: sabdev1/ljcdevsab
 /**
  * Register Option for use
  *
  * @since Redux_Options 1.0.0
  */
 function _register_setting()
 {
     if (isset($_GET['upgrade_theme']) && 1 == $_GET['upgrade_theme'] && isset($_GET['_nonce']) && wp_verify_nonce($_GET['_nonce'], 'sb_theme_upgrade')) {
         require_once locate_template('/inc/envato-wordpress-toolkit-library/class-envato-wordpress-theme-upgrader.php');
         $u = new DFD_Envato_WordPress_Theme_Upgrader();
         $u->do_updgrade();
     }
     register_setting($this->args['opt_name'] . '_group', $this->args['opt_name'], array(&$this, '_validate_options'));
     $this->generate_options_css($this->options);
     if (is_null($this->sections)) {
         return;
     }
     foreach ($this->sections as $k => $section) {
         add_settings_section($this->args['opt_name'] . $k . '_section', $section['title'], array(&$this, '_section_desc'), $this->args['opt_name'] . $k . '_section_group');
         if (isset($section['fields'])) {
             foreach ($section['fields'] as $fieldk => $field) {
                 if (isset($field['title'])) {
                     $std_mark = !isset($this->options[$field['id']]) && $this->args['std_show'] == true && isset($field['std']) ? $this->args['std_mark'] : '';
                     $th = $field['title'] . $std_mark;
                     if (isset($field['sub_desc'])) {
                         $th .= '<span class="description">' . $field['sub_desc'] . '</span>';
                     }
                 } else {
                     $th = '';
                 }
                 add_settings_field($fieldk . '_field', $th, array(&$this, '_field_input'), $this->args['opt_name'] . $k . '_section_group', $this->args['opt_name'] . $k . '_section', $field);
                 // checkbox
             }
         }
     }
     do_action('redux-opts-register-settings-' . $this->args['opt_name']);
 }