示例#1
0
 public function __construct()
 {
     //$this->add_roles();
     //if (current_user_can('administrator'))
     if (!current_user_can('manage_options')) {
         return;
     }
     $this->post_types();
     /**
      * *****************************************************************************
      * Custom Options page
      * *****************************************************************************
      */
     if (file_exists(get_stylesheet_directory() . '/includes/theme-options/custom_ui_options.php')) {
         require_once get_stylesheet_directory() . '/includes/theme-options/custom_ui_options.php';
         custom_ui_options::instance()->opts();
     } elseif (file_exists(CWP_PATH . '/theme-options/custom_ui_options.php')) {
         require_once CWP_PATH . '/theme-options/custom_ui_options.php';
         if (is_admin()) {
             custom_ui_options::instance()->instructions()->theme_options()->offline_options()->custom_404_options()->search_options()->theme_images();
         }
     }
     //        if(is_admin()):
     //        $screen = get_current_screen();
     //        if ('cwp_custom_options' == $screen->post_type) {
     //            add_filter('enter_title_here', function($title) {
     //                        //global $_title, $post_type;
     //                        $title = "My New Title";
     //                        return $title;
     //                    });
     //        }
     //        endif;
 }
 /**
  *
  * @return type
  */
 public static function instance()
 {
     if (!is_object(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new custom_ui_options();
     }
     return self::$instance;
 }