Beispiel #1
0
 public function init_theme()
 {
     global $wp_rewrite;
     // post type
     QA_Questions::init();
     QA_Answers::init();
     QA_Member::init();
     if (ae_get_option('twitter_login', false)) {
         new ET_TwitterAuth();
     }
     if (ae_get_option('facebook_login', false)) {
         new ET_FaceAuth();
     }
     if (ae_get_option('gplus_login', false)) {
         new ET_GoogleAuth();
     }
     /**
      * new class QA_PackAction to control all action do with user badge
      */
     $qa_pack = new QA_PackAction();
     // register footer menu
     register_nav_menus(array('et_header' => __('Menu display on Header', ET_DOMAIN), 'et_left' => __('Menu display on Left Sidebar', ET_DOMAIN)));
     //sidebars
     register_sidebar(array('name' => __('Left Sidebar', ET_DOMAIN), 'id' => 'qa-left-sidebar', 'description' => __("Display widgets in left sidebar", ET_DOMAIN)));
     register_sidebar(array('name' => __('Right Sidebar', ET_DOMAIN), 'id' => 'qa-right-sidebar', 'description' => __("Display widgets in right sidebar", ET_DOMAIN)));
     //header sidebars
     register_sidebar(array('name' => __('Header Sidebar', ET_DOMAIN), 'id' => 'qa-header-sidebar', 'description' => __("Display widgets in header sidebar", ET_DOMAIN)));
     //blog sidebars
     register_sidebar(array('name' => __('Blog\'s Left Sidebar', ET_DOMAIN), 'id' => 'qa-blog-left-sidebar', 'description' => __("Display widgets in blog's left sidebar", ET_DOMAIN)));
     register_sidebar(array('name' => __('Blog\'s Right Sidebar', ET_DOMAIN), 'id' => 'qa-blog-right-sidebar', 'description' => __("Display widgets in blog's right sidebar", ET_DOMAIN)));
     add_theme_support('automatic-feed-links');
     $author_slug = apply_filters('qa_member_slug', 'member');
     // change slug name
     $wp_rewrite->author_base = $author_slug;
     /**
      * create post type report
      */
     $args = array('labels' => array('name' => __('Reports', ET_DOMAIN), 'singular_name' => __('Report', ET_DOMAIN), 'add_new' => __('Add New', ET_DOMAIN), 'add_new_item' => __('Add New Report', ET_DOMAIN), 'edit_item' => __('Edit Report', ET_DOMAIN), 'new_item' => __('New Report', ET_DOMAIN), 'all_items' => __('All Reports', ET_DOMAIN), 'view_item' => __('View Report', ET_DOMAIN), 'search_items' => __('Search Reports', ET_DOMAIN), 'not_found' => __('No Reports found', ET_DOMAIN), 'not_found_in_trash' => __('No Reports found in Trash', ET_DOMAIN), 'parent_item_colon' => '', 'menu_name' => __('Reports', ET_DOMAIN)), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => 'report'), 'capability_type' => 'post', 'has_archive' => 'reports', 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'editor', 'author'), 'taxonomies' => array('report-taxonomy'));
     register_post_type('report', $args);
     $tax_labels = array('name' => _x('Reports taxonomy', ET_DOMAIN), 'singular_name' => _x('Report taxonomys', ET_DOMAIN), 'search_items' => __('Search Reports', ET_DOMAIN), 'popular_items' => __('Popular Reports', ET_DOMAIN), 'all_items' => __('All Reports', ET_DOMAIN), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Report', ET_DOMAIN), 'update_item' => __('Update Report', ET_DOMAIN), 'add_new_item' => __('Add New Report', ET_DOMAIN), 'new_item_name' => __('New Report Name', ET_DOMAIN), 'separate_items_with_commas' => __('Separate Reports with commas', ET_DOMAIN), 'add_or_remove_items' => __('Add or remove Reports', ET_DOMAIN), 'choose_from_most_used' => __('Choose from the most used Reports', ET_DOMAIN), 'not_found' => __('No Reports found.', ET_DOMAIN), 'menu_name' => __('Reports taxonomy', ET_DOMAIN));
     $tax_args = array('hierarchical' => true, 'labels' => $tax_labels, 'show_ui' => true, 'show_admin_column' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array('slug' => 'Report-taxonomy'));
     register_taxonomy('report-taxonomy', 'report', $tax_args);
 }