/** * general options * @param $command * @param $args */ public function setup_general_settings($command, $args) { if ($this->theme_config->item('configuration')) { $general = $this->theme_config->item('configuration'); //set locale if (empty($general['locale'])) { $general['locale'] = 'vi'; } $languages = _hw_global('admin')->load_api('HW_WP_Languages'); $languages->change_site_language($general['locale']); //set thumbnail size $media = _hw_global('admin')->load_api('HW_WP_Media'); if (!empty($general['media'])) { foreach ($general['media'] as $name => $size) { $media->set_image_size($size, $name); } } } }
/** * init */ public static function init() { //register template pages HW_HOANGWEB::register_class('HW__Template_taxonomy', HW_HOANGWEB_INCLUDES . '/layout-templates/template-category-taxonomy.php', 'hw-template_taxonomy'); HW_HOANGWEB::register_class('HW__Template_404', HW_HOANGWEB_INCLUDES . '/layout-templates/template-404.php', 'hw-template-404'); HW_HOANGWEB::register_class('HW__Template_page', HW_HOANGWEB_INCLUDES . '/layout-templates/template-page.php', 'hw-template-page'); HW_HOANGWEB::register_class('HW__Template_single', HW_HOANGWEB_INCLUDES . '/layout-templates/template-single.php', 'hw-template-single'); HW_HOANGWEB::register_class('HW__Template_admin', HW_HOANGWEB_INCLUDES . '/layout-templates/template-admin.php', 'hw-template-admin'); //parse config file _hw_global('theme_config', self::get_theme_config()); //$config['sidebars']; //determine current template _hw_global('current_template', self::get_current_template()); //register positions for current theme self::register_theme_positions(); }
* call Timber::render * @param $file * @param $data */ public static function _render($file, $data = array(), $current = '') { //$trace = debug_backtrace(); //determine main template file //$last = end($trace); if (empty($current)) { $current = self::$current_working_file; } $data['_template_tool'] = template_tool($current); Timber::render($file, $data); } /** * @param $name * @return mixed */ public function load_partial_template($name) { $name = trim($name); if ($name[0] == ':' && self::$current_working_file) { //return load_partial(self::$current_working_file.$name); $utility = HW_Twig_Template_Utilities::get_instance(); return $utility->render_template(self::$current_working_file . $name); } } } } _hw_global('hw_twig', HW_Timber::get_instance());
{ global $menu; global $submenu; if (function_exists('remove_menu_page')) { remove_menu_page('edit.php?post_type=acf'); remove_menu_page('cpt_main_menu'); } /*remove_menu_page('edit.php'); // Posts remove_menu_page('upload.php'); // Media remove_menu_page('link-manager.php'); // Links remove_menu_page('edit-comments.php'); // Comments remove_menu_page('edit.php?post_type=page'); // Pages remove_menu_page('plugins.php'); // Plugins remove_menu_page('themes.php'); // Appearance remove_menu_page('users.php'); // Users remove_menu_page('tools.php'); // Tools remove_menu_page('options-general.php'); // Settings //page post type, your_post_type should be the name of your actual post type. remove_menu_page( 'edit.php?post_type=your_post_type' ); //For plugins, it seems you only need the page= query var if( !current_user_can( 'administrator' ) ): //cat66 plugin remove_menu_page('cart66_admin'); endif; */ } } if (is_admin() || is_call_behind()) { //HW_Admin_page_Implement::get_instance(); _hw_global('admin', 'HW_Admin_page_Implement'); }