SHARE
TWEET

Untitled

a guest May 3rd, 2018 24 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php $wl_theme_options = corporal_options1();
  2. $portfolio_slug= $wl_theme_options['portfolio_slug'];
  3. $member_slug= $wl_theme_options['member_slug'];
  4. $service_slug= $wl_theme_options['service_slug'];
  5. function corporal_slider_function1()
  6. {   register_post_type( 'corporal_slider',
  7.         array(
  8.             'labels' => array(
  9.             'name' => __('Corporal Slider','corporal-premium'),
  10.             'add_new' => __('Add New Slide', 'corporal-premium'),
  11.             'add_new_item' => __('Add New Slide','corporal-premium'),
  12.             'edit_item' => __('Edit Slide','corporal-premium'),
  13.             'new_item' => __('New Slide','corporal-premium'),
  14.             'all_items' => __('All Slides','corporal-premium'),
  15.             'view_item' => __('View Slide','corporal-premium'),
  16.             'search_items' => __('Search Slides','corporal-premium'),
  17.             'not_found' =>  __('No Slides found','corporal-premium'),
  18.             'not_found_in_trash' => __('No Slide found in Trash','corporal-premium'),
  19.             ),
  20.         'supports' => array('title','thumbnail'),
  21.         'show_in' => true,
  22.         'show_in_nav_menus' => false,  
  23.         'public' => true,
  24.         'publicly_queryable' => false,
  25.         'menu_icon' => 'dashicons-laptop',
  26.         'exclude_from_search'=> true,
  27.         )
  28.     );
  29. }
  30. add_action( 'wp_loaded', 'corporal_slider_function1' );
  31.  
  32. function corporal_service_function1()
  33. {   register_post_type( 'corporal_service',
  34.         array(
  35.             'labels' => array(
  36.             'name' => __('Corporal Service','corporal-premium'),
  37.             'add_new' => __('Add New Service', 'corporal-premium'),
  38.             'add_new_item' => __('Add New Service','corporal-premium'),
  39.             'edit_item' => __('Edit Service','corporal-premium'),
  40.             'new_item' => __('New Service','corporal-premium'),
  41.             'all_items' => __('All Services','corporal-premium'),
  42.             'view_item' => __('View Service','corporal-premium'),
  43.             'search_items' => __('Search Services','corporal-premium'),
  44.             'not_found' =>  __('No Services found','corporal-premium'),
  45.             'not_found_in_trash' => __('No Service found in Trash','corporal-premium'),
  46.             ),
  47.         'supports' => array('title','editor'),
  48.         'show_in' => true,
  49.         'show_in_nav_menus' => false,
  50.         'rewrite' => array('slug' => $GLOBALS['service_slug']),    
  51.         'public' => true,
  52.         'menu_icon' => 'dashicons-screenoptions',
  53.         'exclude_from_search'=> true,
  54.         )
  55.     );
  56. }
  57. add_action( 'wp_loaded', 'corporal_service_function1' );
  58.  
  59. function corporal_portfolio_function1()
  60. {   register_post_type( 'corporal_portfolio',
  61.         array(
  62.             'labels' => array(
  63.             'name' => __('Corporal Portfolio','corporal-premium'),
  64.             'add_new' => __('Add New Portfolio', 'corporal-premium'),
  65.             'add_new_item' => __('Add New Portfolio','corporal-premium'),
  66.             'edit_item' => __('Edit Portfolio','corporal-premium'),
  67.             'new_item' => __('New Portfolio','corporal-premium'),
  68.             'all_items' => __('All Portfolios','corporal-premium'),
  69.             'view_item' => __('View Portfolio','corporal-premium'),
  70.             'search_items' => __('Search Portfolios','corporal-premium'),
  71.             'not_found' =>  __('No Portfolios found','corporal-premium'),
  72.             'not_found_in_trash' => __('No Portfolio found in Trash','corporal-premium'),
  73.             ),
  74.         'supports' => array('title','thumbnail','editor'),
  75.         'show_in' => true,
  76.         'show_in_nav_menus' => false,
  77.         'rewrite' => array('slug' => $GLOBALS['portfolio_slug']),      
  78.         'public' => true,
  79.         'menu_icon' => 'dashicons-images-alt',
  80.         'exclude_from_search'=> true,
  81.         )
  82.     );
  83. }
  84. add_action( 'wp_loaded', 'corporal_portfolio_function1' );
  85. function corporal_portfolio_taxonomy1() {
  86.     register_taxonomy('corporal_portfolio_categories','corporal_portfolio',
  87.     array(  'hierarchical' => true,
  88.             'show_in_nav_menus' => false,
  89.             'label' => 'Portfolio Categories',
  90.             'query_var' => true));
  91.    
  92.     // Get Default Category Id
  93.     $defualt_categories_id = get_option('portfolio_default_categories_id');
  94.     //quick update category
  95.     if((isset($_POST['action'])) && (isset($_POST['taxonomy']))){      
  96.         wp_update_term($_POST['tax_ID'], 'corporal_portfolio_categories', array(
  97.           'name' => $_POST['name'],
  98.           'slug' => $_POST['slug']
  99.         ));
  100.         update_option('portfolio_default_categories_id', $defualt_categories_id);
  101.     }
  102.     else
  103.     {   // Add default taxonomy
  104.         if(!$defualt_categories_id){
  105.             wp_insert_term('ALL','corporal_portfolio_categories', array('description'=> 'Default Category','slug' => 'ALL'));
  106.             $Current_text_id = term_exists('ALL', 'corporal_portfolio_categories');
  107.             update_option('portfolio_default_categories_id', $Current_text_id['term_id']);     
  108.         }
  109.        
  110.     }
  111.      // update  default taxonomy
  112.     if(isset($_POST['submit']) && isset($_POST['action']) )
  113.     {
  114.         if(isset($_POST['tag_ID']) && isset($_POST['name']) && isset($_POST['slug']) && isset($_POST['description']) ) {
  115.         wp_update_term($_POST['tag_ID'], 'corporal_portfolio_categories', array(
  116.               'name' => $_POST['name'],
  117.               'slug' => $_POST['slug'],
  118.               'description' =>$_POST['description']
  119.             ));
  120.         }
  121.     }
  122.     // Delete default category
  123.     if(isset($_POST['action']) && isset($_POST['tag_ID']) )
  124.     {   if(($_POST['tag_ID'] == $defualt_tex_id) && $_POST['action'] == "delete-tag")
  125.         {  
  126.             delete_option('portfolio_default_categories_id');
  127.         }
  128.     }  
  129. }
  130. add_action( 'wp_loaded', 'corporal_portfolio_taxonomy1' );
  131.  
  132. function corporal_testi_function1()
  133. {   register_post_type( 'corporal_testimonial',
  134.         array(
  135.             'labels' => array(
  136.             'name' => __('Corporal Testimonial','corporal-premium'),
  137.             'add_new' => __('Add New Testimonial', 'corporal-premium'),
  138.             'add_new_item' => __('Add New Testimonial','corporal-premium'),
  139.             'edit_item' => __('Edit Testimonial','corporal-premium'),
  140.             'new_item' => __('New Testimonial','corporal-premium'),
  141.             'all_items' => __('All Testimonials','corporal-premium'),
  142.             'view_item' => __('View Testimonial','corporal-premium'),
  143.             'search_items' => __('Search Testimonials','corporal-premium'),
  144.             'not_found' =>  __('No Testimonials found','corporal-premium'),
  145.             'not_found_in_trash' => __('No Testimonial found in Trash','corporal-premium'),
  146.             ),
  147.         'supports' => array('title','thumbnail'),
  148.         'show_in' => true,
  149.         'show_in_nav_menus' => false,  
  150.         'public' => true,
  151.         'publicly_queryable' => false,
  152.         'menu_icon' => 'dashicons-format-chat',
  153.         'exclude_from_search'=> true,
  154.         )
  155.     );
  156. }
  157. add_action( 'wp_loaded', 'corporal_testi_function1' );
  158.  
  159. function corporal_client_function1(){
  160.     register_post_type( 'corporal_client',
  161.         array(
  162.             'labels' => array(
  163.             'name' => __('Corporal Clients','corporal-premium'),
  164.             'add_new' => __('Add New Client', 'corporal-premium'),
  165.             'add_new_item' => __('Add New Client','corporal-premium'),
  166.             'edit_item' => __('Edit Client','corporal-premium'),
  167.             'new_item' => __('New Client','corporal-premium'),
  168.             'all_items' => __('All Clients','corporal-premium'),
  169.             'view_item' => __('View Client','corporal-premium'),
  170.             'search_items' => __('Search Clients','corporal-premium'),
  171.             'not_found' =>  __('No Clients found','corporal-premium'),
  172.             'not_found_in_trash' => __('No Client found in Trash','corporal-premium'),
  173.             ),
  174.         'supports' => array('title','thumbnail'),
  175.         'show_in' => true,
  176.         'show_in_nav_menus' => false,  
  177.         'public' => true,
  178.         'publicly_queryable' => false,
  179.         'menu_icon' => 'dashicons-nametag',
  180.         'exclude_from_search'=> true,
  181.         )
  182.     );
  183. }
  184. add_action( 'wp_loaded', 'corporal_client_function1' );
  185.  
  186. function corporal_team_function1()
  187. {   register_post_type( 'corporal_member',
  188.         array(
  189.             'labels' => array(
  190.             'name' => __('Corporal Members','corporal-premium'),
  191.             'add_new' => __('Add New Member', 'corporal-premium'),
  192.             'add_new_item' => __('Add New Member','corporal-premium'),
  193.             'edit_item' => __('Edit Member','corporal-premium'),
  194.             'new_item' => __('New Member','corporal-premium'),
  195.             'all_items' => __('All Members','corporal-premium'),
  196.             'view_item' => __('View Member','corporal-premium'),
  197.             'search_items' => __('Search Members','corporal-premium'),
  198.             'not_found' =>  __('No Members found','corporal-premium'),
  199.             'not_found_in_trash' => __('No Member found in Trash','corporal-premium'),
  200.             ),
  201.         'supports' => array('title','thumbnail','editor'),
  202.         'show_in' => true,
  203.         'show_in_nav_menus' => false,  
  204.         'rewrite' => array('slug' => $GLOBALS['member_slug']),
  205.         'public' => true,
  206.         'menu_icon' => 'dashicons-businessman',
  207.         'exclude_from_search'=> true,
  208.         )
  209.     );
  210. }
  211. add_action( 'wp_loaded', 'corporal_team_function1' );
  212.  
  213. function corporal_facts_function1(){
  214.     register_post_type( 'corporal_facts',
  215.         array(
  216.             'labels' => array(
  217.             'name' => __('Corporal Facts','corporal-premium'),
  218.             'add_new' => __('Add New Fact', 'corporal-premium'),
  219.             'add_new_item' => __('Add New Fact','corporal-premium'),
  220.             'edit_item' => __('Edit Fact','corporal-premium'),
  221.             'new_item' => __('New Fact','corporal-premium'),
  222.             'all_items' => __('All Facts','corporal-premium'),
  223.             'view_item' => __('View Fact','corporal-premium'),
  224.             'search_items' => __('Search Facts','corporal-premium'),
  225.             'not_found' =>  __('No Fact found','corporal-premium'),
  226.             'not_found_in_trash' => __('No Fact found in Trash','corporal-premium'),
  227.             ),
  228.         'supports' => array('title'),
  229.         'show_in' => true,
  230.         'show_in_nav_menus' => false,  
  231.         'public' => true,
  232.         'publicly_queryable' => false,
  233.         'menu_icon' => 'dashicons-chart-area',
  234.         'exclude_from_search'=> true,
  235.         )
  236.     );
  237. }
  238. add_action( 'wp_loaded', 'corporal_facts_function1' );
  239.  
  240. function corporal_skills_function1(){
  241.     register_post_type( 'corporal_skills',
  242.         array(
  243.             'labels' => array(
  244.             'name' => __('Corporal Skills','corporal-premium'),
  245.             'add_new' => __('Add New Skill', 'corporal-premium'),
  246.             'add_new_item' => __('Add New Skill','corporal-premium'),
  247.             'edit_item' => __('Edit Skill','corporal-premium'),
  248.             'new_item' => __('New Skill','corporal-premium'),
  249.             'all_items' => __('All Skills','corporal-premium'),
  250.             'view_item' => __('View Skill','corporal-premium'),
  251.             'search_items' => __('Search Skills','corporal-premium'),
  252.             'not_found' =>  __('No Skill found','corporal-premium'),
  253.             'not_found_in_trash' => __('No Skill found in Trash','corporal-premium'),
  254.             ),
  255.         'supports' => array('title'),
  256.         'show_in' => true,
  257.         'show_in_nav_menus' => false,  
  258.         'public' => true,
  259.         'publicly_queryable' => false,
  260.         'menu_icon' => 'dashicons-welcome-learn-more',
  261.         'exclude_from_search'=> true,
  262.         )
  263.     );
  264. }
  265. add_action( 'wp_loaded', 'corporal_skills_function1' );
  266.  
  267. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top