Exemplo n.º 1
0
 function axiom_team_theme_setup()
 {
     // Add item in the admin menu
     add_action('admin_menu', 'axiom_team_add_meta_box');
     // Save data from meta box
     add_action('save_post', 'axiom_team_save_data');
     // Detect current page type, taxonomy and title (for custom post_types use priority < 10 to fire it handles early, than for standard post types)
     add_filter('axiom_filter_get_blog_type', 'axiom_team_get_blog_type', 9, 2);
     add_filter('axiom_filter_get_blog_title', 'axiom_team_get_blog_title', 9, 2);
     add_filter('axiom_filter_get_current_taxonomy', 'axiom_team_get_current_taxonomy', 9, 2);
     add_filter('axiom_filter_is_taxonomy', 'axiom_team_is_taxonomy', 9, 2);
     add_filter('axiom_filter_get_stream_page_title', 'axiom_team_get_stream_page_title', 9, 2);
     add_filter('axiom_filter_get_stream_page_link', 'axiom_team_get_stream_page_link', 9, 2);
     add_filter('axiom_filter_get_stream_page_id', 'axiom_team_get_stream_page_id', 9, 2);
     add_filter('axiom_filter_query_add_filters', 'axiom_team_query_add_filters', 9, 2);
     add_filter('axiom_filter_detect_inheritance_key', 'axiom_team_detect_inheritance_key', 9, 1);
     // Extra column for team members lists
     if (axiom_get_theme_option('show_overriden_posts') == 'yes') {
         add_filter('manage_edit-team_columns', 'axiom_post_add_options_column', 9);
         add_filter('manage_team_posts_custom_column', 'axiom_post_fill_options_column', 9, 2);
     }
     // Meta box fields
     global $AXIOM_GLOBALS;
     $AXIOM_GLOBALS['team_meta_box'] = array('id' => 'team-meta-box', 'title' => __('Team Member Details', 'axiom'), 'page' => 'team', 'context' => 'normal', 'priority' => 'high', 'fields' => array("team_member_position" => array("title" => __('Position', 'axiom'), "desc" => __("Position of the team member", 'axiom'), "class" => "team_member_position", "std" => "", "type" => "text"), "team_member_email" => array("title" => __("E-mail", 'axiom'), "desc" => __("E-mail of the team member - need to take Gravatar (if registered)", 'axiom'), "class" => "team_member_email", "std" => "", "type" => "text"), "team_member_link" => array("title" => __('Link to profile', 'axiom'), "desc" => __("URL of the team member profile page (if not this page)", 'axiom'), "class" => "team_member_link", "std" => "", "type" => "text"), "team_member_socials" => array("title" => __("Social links", 'axiom'), "desc" => __("Links to the social profiles of the team member", 'axiom'), "class" => "team_member_email", "std" => "", "type" => "social")));
     // Prepare type "Team"
     axiom_require_data('post_type', 'team', array('label' => __('Team member', 'axiom'), 'description' => __('Team Description', 'axiom'), 'labels' => array('name' => _x('Team', 'Post Type General Name', 'axiom'), 'singular_name' => _x('Team member', 'Post Type Singular Name', 'axiom'), 'menu_name' => __('Team', 'axiom'), 'parent_item_colon' => __('Parent Item:', 'axiom'), 'all_items' => __('All Team', 'axiom'), 'view_item' => __('View Item', 'axiom'), 'add_new_item' => __('Add New Team member', 'axiom'), 'add_new' => __('Add New', 'axiom'), 'edit_item' => __('Edit Item', 'axiom'), 'update_item' => __('Update Item', 'axiom'), 'search_items' => __('Search Item', 'axiom'), 'not_found' => __('Not found', 'axiom'), 'not_found_in_trash' => __('Not found in Trash', 'axiom')), 'supports' => array('title', 'excerpt', 'editor', 'author', 'thumbnail', 'comments'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'menu_icon' => 'dashicons-admin-users', 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 30, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'query_var' => true, 'capability_type' => 'page', 'rewrite' => true));
     // Prepare taxonomy for team
     axiom_require_data('taxonomy', 'team_group', array('post_type' => array('team'), 'hierarchical' => true, 'labels' => array('name' => _x('Team Group', 'taxonomy general name', 'axiom'), 'singular_name' => _x('Group', 'taxonomy singular name', 'axiom'), 'search_items' => __('Search Groups', 'axiom'), 'all_items' => __('All Groups', 'axiom'), 'parent_item' => __('Parent Group', 'axiom'), 'parent_item_colon' => __('Parent Group:', 'axiom'), 'edit_item' => __('Edit Group', 'axiom'), 'update_item' => __('Update Group', 'axiom'), 'add_new_item' => __('Add New Group', 'axiom'), 'new_item_name' => __('New Group Name', 'axiom'), 'menu_name' => __('Team Group', 'axiom')), 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'team_group')));
 }
Exemplo n.º 2
0
 function axiom_testimonial_theme_setup()
 {
     // Add item in the admin menu
     add_action('admin_menu', 'axiom_testimonial_add_meta_box');
     // Save data from meta box
     add_action('save_post', 'axiom_testimonial_save_data');
     // Meta box fields
     global $AXIOM_GLOBALS;
     $AXIOM_GLOBALS['testimonial_meta_box'] = array('id' => 'testimonial-meta-box', 'title' => __('Testimonial Details', 'axiom'), 'page' => 'testimonial', 'context' => 'normal', 'priority' => 'high', 'fields' => array("testimonial_author" => array("title" => __('Testimonial author', 'axiom'), "desc" => __("Name of the testimonial's author", 'axiom'), "class" => "testimonial_author", "std" => "", "type" => "text"), "testimonial_email" => array("title" => __("Author's e-mail", 'axiom'), "desc" => __("E-mail of the testimonial's author - need to take Gravatar (if registered)", 'axiom'), "class" => "testimonial_email", "std" => "", "type" => "text"), "testimonial_link" => array("title" => __('Testimonial link', 'axiom'), "desc" => __("URL of the testimonial source or author profile page", 'axiom'), "class" => "testimonial_link", "std" => "", "type" => "text")));
     // Prepare type "Testimonial"
     axiom_require_data('post_type', 'testimonial', array('label' => __('Testimonial', 'axiom'), 'description' => __('Testimonial Description', 'axiom'), 'labels' => array('name' => _x('Testimonials', 'Post Type General Name', 'axiom'), 'singular_name' => _x('Testimonial', 'Post Type Singular Name', 'axiom'), 'menu_name' => __('Testimonials', 'axiom'), 'parent_item_colon' => __('Parent Item:', 'axiom'), 'all_items' => __('All Testimonials', 'axiom'), 'view_item' => __('View Item', 'axiom'), 'add_new_item' => __('Add New Testimonial', 'axiom'), 'add_new' => __('Add New', 'axiom'), 'edit_item' => __('Edit Item', 'axiom'), 'update_item' => __('Update Item', 'axiom'), 'search_items' => __('Search Item', 'axiom'), 'not_found' => __('Not found', 'axiom'), 'not_found_in_trash' => __('Not found in Trash', 'axiom')), 'supports' => array('title', 'editor', 'author', 'thumbnail'), 'hierarchical' => false, 'public' => false, 'show_ui' => true, 'menu_icon' => 'dashicons-cloud', 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 25, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => true, 'publicly_queryable' => false, 'capability_type' => 'page'));
     // Prepare taxonomy for testimonial
     axiom_require_data('taxonomy', 'testimonial_group', array('post_type' => array('testimonial'), 'hierarchical' => true, 'labels' => array('name' => _x('Testimonials Group', 'taxonomy general name', 'axiom'), 'singular_name' => _x('Group', 'taxonomy singular name', 'axiom'), 'search_items' => __('Search Groups', 'axiom'), 'all_items' => __('All Groups', 'axiom'), 'parent_item' => __('Parent Group', 'axiom'), 'parent_item_colon' => __('Parent Group:', 'axiom'), 'edit_item' => __('Edit Group', 'axiom'), 'update_item' => __('Update Group', 'axiom'), 'add_new_item' => __('Add New Group', 'axiom'), 'new_item_name' => __('New Group Name', 'axiom'), 'menu_name' => __('Testimonial Group', 'axiom')), 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'testimonial_group')));
 }
Exemplo n.º 3
0
 function axiom_attachment_theme_setup()
 {
     // Add folders in ajax query
     add_filter('ajax_query_attachments_args', 'axiom_attachment_ajax_query_args');
     // Add folders in filters for js view
     add_filter('media_view_settings', 'axiom_attachment_view_filters');
     // Add folders list in js view compat area
     add_filter('attachment_fields_to_edit', 'axiom_attachment_view_compat');
     // Prepare media folders for save
     add_filter('attachment_fields_to_save', 'axiom_attachment_save_compat');
     // Detect current page type, taxonomy and title (for custom post_types use priority < 10 to fire it handles early, than for standard post types)
     add_filter('axiom_filter_detect_inheritance_key', 'axiom_attachmnent_detect_inheritance_key', 9, 1);
     // Prepare taxonomy for attachment
     axiom_require_data('taxonomy', 'media_folder', array('post_type' => array('attachment'), 'hierarchical' => true, 'labels' => array('name' => __('Media Folders', 'axiom'), 'singular_name' => __('Media Folder', 'axiom'), 'search_items' => __('Search Media Folders', 'axiom'), 'all_items' => __('All Media Folders', 'axiom'), 'parent_item' => __('Parent Media Folder', 'axiom'), 'parent_item_colon' => __('Parent Media Folder:', 'axiom'), 'edit_item' => __('Edit Media Folder', 'axiom'), 'update_item' => __('Update Media Folder', 'axiom'), 'add_new_item' => __('Add New Media Folder', 'axiom'), 'new_item_name' => __('New Media Folder Name', 'axiom'), 'menu_name' => __('Media Folders', 'axiom')), 'query_var' => true, 'rewrite' => true, 'show_admin_column' => true));
 }
Exemplo n.º 4
0
 function prepare_taxonomies()
 {
     if (isset($this->options['taxonomies']) && is_array($this->options['taxonomies']) && count($this->options['taxonomies']) > 0) {
         foreach ($this->options['taxonomies'] as $type => $tax) {
             axiom_require_data('taxonomy', $tax, array('post_type' => array($type), 'hierarchical' => false, 'query_var' => $tax, 'rewrite' => true, 'public' => false, 'show_ui' => false, 'show_admin_column' => false, '_builtin' => false));
         }
     }
 }