File: /home/flexnetw/kifwa.flexnetworks.co.ke/wp-content/plugins/axil-elements/include/custom-post.php
<?php
include_once( ABSTRAK_ELEMENTS_BASE_DIR . '/include/custom-post-type-base.php');
/**
* Megamenu
*/
$megamenu_args = array(
'menu_icon' => 'dashicons-editor-kitchensink'
);
$megamenu = new Axil_Register_Custom_Post_Type( 'Megamenu', 'Mega Menus', $megamenu_args);
add_action('init', 'register_axil_team_postype');
function register_axil_team_postype()
{
$prefix = ABSTRAK_PT_PREFIX;
$axil_options = Helper::axil_get_options();
$team_slug = ( !empty($axil_options['team_slug']) )? $axil_options['team_slug'] :'team';
$team_cat_slug = ( !empty($axil_options['team_cat_slug']) )? $axil_options['team_cat_slug'] :'team-cat';
$team_label = ( !empty($axil_options['team_label']) )? $axil_options['team_label'] :'Team';
$labels = array(
'name' => esc_html__( $team_label, 'axil-elements'),
'singular_name' => esc_html__( $team_label, 'axil-elements'),
'add_new' => esc_html__('Add New', 'axil-elements'),
'add_new_item' => esc_html__('Add New' . $team_label, 'axil-elements'),
'edit_item' => esc_html__('Edit' . $team_label, 'axil-elements'),
'new_item' => esc_html__('New' . $team_label, 'axil-elements'),
'view_item' => esc_html__('View ' . $team_label, 'axil-elements'),
'search_items' => esc_html__('Search ' . $team_label, 'axil-elements'),
'not_found' => esc_html__('No Team found', 'axil-elements'),
'not_found_in_trash' => esc_html__('No Team found in Trash', 'axil-elements'),
'parent_item_colon' => ''
);
register_post_type("{$prefix}_team", array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'show_in_nav_menus' => true,
'has_archive' => true,
'rewrite' => true,
'hierarchical' => false,
'show_in_rest' => true, // To use Gutenberg editor.
'menu_position' => 10,
'menu_icon' => 'dashicons-universal-access-alt',
'supports' => array( 'title', 'thumbnail', 'editor', 'excerpt', 'page-attributes' ),
'rewrite' => array( 'slug' => esc_html__($team_slug , 'axil-elements' )),
));
$labels = array(
'name' => _x( 'Categories', 'team categories', 'axil-elements' ),
'singular_name' => _x( 'Category', 'team category', 'axil-elements' ),
'search_items' => esc_html__('Search ' . $team_label . 'Categories' , 'axil-elements'),
'all_items' => esc_html__('All ' . $team_label . ' Categories' , 'axil-elements'),
'parent_item' => esc_html__('Parent ' . $team_label . ' Category' , 'axil-elements'),
'parent_item_colon' => esc_html__('Parent ' . $team_label . ' Category:' , 'axil-elements'),
'edit_item' => esc_html__('Edit ' . $team_label . ' Category' , 'axil-elements'),
'update_item' => esc_html__('Update ' . $team_label . ' Category' , 'axil-elements'),
'add_new_item' => esc_html__('Add New ' . $team_label . ' Category' , 'axil-elements'),
'new_item_name' => esc_html__('New ' . $team_label . ' Category Name' , 'axil-elements'),
'menu_name' => esc_html__('Category' , 'axil-elements'),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_in_nav_menus' => true,
'show_ui' => null,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => $team_cat_slug ),
);
register_taxonomy( "{$prefix}_team_category", array( "{$prefix}_team" ), $args );
}
add_action('init', 'register_axil_service_postype');
function register_axil_service_postype()
{
$prefix = ABSTRAK_PT_PREFIX;
$axil_options = Helper::axil_get_options();
$service_label = (!empty($axil_options['services_label']))? $axil_options['services_label'] :'Services';
$service_slug = (!empty($axil_options['services_slug']))? $axil_options['services_slug'] :'services';
$service_cat_slug = (!empty($axil_options['services_cat_slug']))? $axil_options['services_cat_slug'] :'services-cat';
$labels = array(
'name' => esc_html__( $service_label, 'axil-elements'),
'singular_name' => esc_html__( $service_label, 'axil-elements'),
'add_new' => esc_html__('Add New', 'axil-elements'),
'add_new_item' => esc_html__('Add New' . $service_label, 'axil-elements'),
'edit_item' => esc_html__('Edit' . $service_label, 'axil-elements'),
'new_item' => esc_html__('New' . $service_label, 'axil-elements'),
'view_item' => esc_html__('View' . $service_label, 'axil-elements'),
'search_items' => esc_html__('Search' . $service_label, 'axil-elements'),
'not_found' => esc_html__('No Services found', 'axil-elements'),
'not_found_in_trash' => esc_html__('No Services found in Trash', 'axil-elements'),
'parent_item_colon' => ''
);
register_post_type("{$prefix}_services", array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'show_in_nav_menus' => true,
'has_archive' => true,
'rewrite' => true,
'hierarchical' => false,
'show_in_rest' => true, // To use Gutenberg editor.
'menu_position' => 11,
'menu_icon' => 'dashicons-list-view',
'supports' => array( 'title', 'thumbnail', 'editor', 'excerpt', 'page-attributes' ),
'rewrite' => array( 'slug' => esc_html__($service_slug , 'axil-elements' )),
));
$labels = array(
'name' => _x( $service_label .'Categories', $service_label .'categories', 'axil-elements' ),
'singular_name' => _x( $service_label .' Category', $service_label .' category', 'axil-elements' ),
'search_items' => esc_html__('Search '. $service_label .' Categories' , 'axil-elements'),
'all_items' => esc_html__('All '. $service_label .' Categories' , 'axil-elements'),
'parent_item' => esc_html__('Parent '. $service_label .' Category' , 'axil-elements'),
'parent_item_colon' => esc_html__('Parent '. $service_label .' Category:' , 'axil-elements'),
'edit_item' => esc_html__('Edit '. $service_label .' Category' , 'axil-elements'),
'update_item' => esc_html__('Update '. $service_label .' Category' , 'axil-elements'),
'add_new_item' => esc_html__('Add New '. $service_label .' Category' , 'axil-elements'),
'new_item_name' => esc_html__('New '. $service_label .' Category Name' , 'axil-elements'),
'menu_name' => esc_html__('Category' , 'axil-elements'),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_in_nav_menus' => true,
'show_ui' => null,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => $service_cat_slug ),
);
register_taxonomy( "{$prefix}_services_category", array( "{$prefix}_services" ), $args );
}
add_action('init', 'register_axil_projects_postype');
function register_axil_projects_postype()
{
$prefix = ABSTRAK_PT_PREFIX;
$axil_options = Helper::axil_get_options();
$projects_label = ( !empty($axil_options['project_label']) )? $axil_options['project_label'] :'Projects';
$projects_slug = ( !empty($axil_options['project_slug']) )? $axil_options['project_slug'] :'projects';
$projects_cat_slug = ( !empty($axil_options['projects_cat_slug']) )? $axil_options['projects_cat_slug'] :'projects-cat';
$labels = array(
'name' => esc_html__($projects_label, 'axil-elements'),
'singular_name' => esc_html__($projects_label, 'axil-elements'),
'add_new' => esc_html__('Add New', 'axil-elements'),
'add_new_item' => esc_html__('Add New'. $projects_label, 'axil-elements'),
'edit_item' => esc_html__('Edit'. $projects_label, 'axil-elements'),
'new_item' => esc_html__('New '. $projects_label, 'axil-elements'),
'view_item' => esc_html__('View'. $projects_label, 'axil-elements'),
'search_items' => esc_html__('Search'. $projects_label, 'axil-elements'),
'not_found' => esc_html__('No '. $projects_label .' found', 'axil-elements'),
'not_found_in_trash' => esc_html__('No '. $projects_label .' found in Trash', 'axil-elements'),
'parent_item_colon' => ''
);
register_post_type("{$prefix}-projects", array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'show_in_rest' => true, // To use Gutenberg editor.
'show_in_nav_menus' => true,
'has_archive' => true,
'rewrite' => true,
'hierarchical' => false,
'menu_position' => 12,
'menu_icon' => 'dashicons-grid-view',
'supports' => array( 'title', 'thumbnail', 'editor', 'excerpt', 'page-attributes' ),
'rewrite' => array('slug' => esc_html__($projects_slug , 'axil-elements')),
));
$labels = array(
'name' => _x( $projects_label .' Categories', $projects_label .'categories', 'axil-elements' ),
'singular_name' => _x( $projects_label .' Category', $projects_label .' category', 'axil-elements' ),
'search_items' => esc_html__('Search '. $projects_label .' Categories' , 'axil-elements'),
'all_items' => esc_html__('All '. $projects_label .' Categories' , 'axil-elements'),
'parent_item' => esc_html__('Parent '. $projects_label .' Category' , 'axil-elements'),
'parent_item_colon' => esc_html__('Parent '. $projects_label .' Category:' , 'axil-elements'),
'edit_item' => esc_html__('Edit '. $projects_label .' Category' , 'axil-elements'),
'update_item' => esc_html__('Update '. $projects_label .' Category' , 'axil-elements'),
'add_new_item' => esc_html__('Add New '. $projects_label .' Category' , 'axil-elements'),
'new_item_name' => esc_html__('New '. $projects_label .' Category Name' , 'axil-elements'),
'menu_name' => esc_html__('Category' , 'axil-elements'),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_in_nav_menus' => true,
'show_ui' => null,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => $projects_cat_slug ),
);
register_taxonomy( "{$prefix}-projects-category", array( "{$prefix}-projects" ), $args );
}
add_action('init', 'register_axil_case_studies_postype');
function register_axil_case_studies_postype()
{
$prefix = ABSTRAK_PT_PREFIX;
$axil_options = Helper::axil_get_options();
$case_studies_label = ( !empty( $axil_options['case_studies_label']) )? $axil_options['case_studies_label'] :'Case Study';
$case_studies_slug = ( !empty( $axil_options['case_studies_slug']) )? $axil_options['case_studies_slug'] :'case-study';
$case_studies_cat_slug = ( !empty( $axil_options['case_studies_cat_slug']) )? $axil_options['case_studies_cat_slug'] :'case-study-cat';
$labels = array(
'name' => esc_html__('Case' . $case_studies_label , 'axil-elements'),
'singular_name' => esc_html__('Case ' . $case_studies_label, 'axil-elements'),
'add_new' => esc_html__('Add New', 'axil-elements'),
'add_new_item' => esc_html__('Add New ' . $case_studies_label, 'axil-elements'),
'edit_item' => esc_html__('Edit ' . $case_studies_label, 'axil-elements'),
'new_item' => esc_html__('New ' . $case_studies_label, 'axil-elements'),
'view_item' => esc_html__('View ' . $case_studies_label, 'axil-elements'),
'search_items' => esc_html__('Search ' . $case_studies_label, 'axil-elements'),
'not_found' => esc_html__('No ' . $case_studies_label .' found', 'axil-elements'),
'not_found_in_trash' => esc_html__('No ' . $case_studies_label .' found in Trash', 'axil-elements'),
'parent_item_colon' => ''
);
register_post_type("{$prefix}-case-study", array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'show_in_rest' => true, // To use Gutenberg editor.
'show_in_nav_menus' => true,
'has_archive' => true,
'rewrite' => true,
'hierarchical' => false,
'menu_position' => 12,
'menu_icon' => 'dashicons-sos',
'supports' => array( 'title', 'thumbnail', 'editor', 'excerpt', 'page-attributes' ),
'rewrite' => array('slug' => esc_html__($case_studies_slug , 'axil-elements')),
));
$labels = array(
'name' => _x( 'Categories', $case_studies_label .'categories', 'axil-elements' ),
'singular_name' => _x( 'Categories', $case_studies_label .'category', 'axil-elements' ),
'search_items' => esc_html__('Search ' . $case_studies_label .' Categories' , 'axil-elements'),
'all_items' => esc_html__('All ' . $case_studies_label .' Categories' , 'axil-elements'),
'parent_item' => esc_html__('Parent ' . $case_studies_label .' Categories' , 'axil-elements'),
'parent_item_colon' => esc_html__('Parent ' . $case_studies_label .' Categories:' , 'axil-elements'),
'edit_item' => esc_html__('Edit ' . $case_studies_label .' Categories' , 'axil-elements'),
'update_item' => esc_html__('Update ' . $case_studies_label .' Categories' , 'axil-elements'),
'add_new_item' => esc_html__('Add New ' . $case_studies_label .' Categories' , 'axil-elements'),
'new_item_name' => esc_html__('New ' . $case_studies_label .' Categories Name' , 'axil-elements'),
'menu_name' => esc_html__('Categories' , 'axil-elements'),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_in_nav_menus' => true,
'show_ui' => null,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => $case_studies_cat_slug ),
);
register_taxonomy( "{$prefix}-case-studies-cat", array( "{$prefix}-case-study" ), $args );
}