Exemple #1
0
 /**
  * Register the landing pages post type.
  *
  *
  * @return    null
  */
 public function register_post_types()
 {
     $labels = array('name' => _x('Tours', 'lsx-tours'), 'singular_name' => _x('Tour', 'lsx-tours'), 'add_new' => _x('Add New', 'lsx-tours'), 'add_new_item' => _x('Add New Tour', 'lsx-tours'), 'edit_item' => _x('Edit Tour', 'lsx-tours'), 'new_item' => _x('New Tour', 'lsx-tours'), 'all_items' => _x('All Tours', 'lsx-tours'), 'view_item' => _x('View Tour', 'lsx-tours'), 'search_items' => _x('Search Tours', 'lsx-tours'), 'not_found' => _x('No tours found', 'lsx-tours'), 'not_found_in_trash' => _x('No tours found in Trash', 'lsx-tours'), 'parent_item_colon' => '', 'menu_name' => _x('Tours', 'lsx-tours'));
     $args = array('menu_icon' => 'dashicons-admin-site', 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => 'tour'), 'capability_type' => 'post', 'has_archive' => 'tours', 'hierarchical' => false, 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'custom-fields'));
     lsx_register_post_type('tour', $args);
     //Register the Taxonomies
     $labels = array('name' => _x('Experience', 'lsx-tours'), 'singular_name' => _x('Experience', 'lsx-tours'), 'search_items' => __('Search Experiences', 'lsx-tours'), 'all_items' => __('Experiences', 'lsx-tours'), 'parent_item' => __('Parent Experience', 'lsx-tours'), 'parent_item_colon' => __('Parent Experience:', 'lsx-tours'), 'edit_item' => __('Edit Experience', 'lsx-tours'), 'update_item' => __('Update Experience', 'lsx-tours'), 'add_new_item' => __('Add New Experience', 'lsx-tours'), 'new_item_name' => __('New Room Experience', 'lsx-tours'), 'menu_name' => __('Experiences', 'lsx-tours'));
     // Now register the taxonomy
     lsx_register_taxonomy('experience', array('tour'), array('hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'experience')));
     $labels = array('name' => _x('Tour Types', 'lsx-tours'), 'singular_name' => _x('Tour Type', 'lsx-tours'), 'search_items' => __('Search Tour Types', 'lsx-tours'), 'all_items' => __('Tour Types', 'lsx-tours'), 'parent_item' => __('Parent Tour Type', 'lsx-tours'), 'parent_item_colon' => __('Parent Tour Type:', 'lsx-tours'), 'edit_item' => __('Edit Tour Type', 'lsx-tours'), 'update_item' => __('Update Tour Type', 'lsx-tours'), 'add_new_item' => __('Add New Tour Type', 'lsx-tours'), 'new_item_name' => __('New Room Tour Type', 'lsx-tours'), 'menu_name' => __('Tour Types', 'lsx-tours'));
     // Now register the taxonomy
     lsx_register_taxonomy('tour-type', array('tour'), array('hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'tour-type')));
 }
 /**
  * Register the properties post types.
  *
  *
  * @return    null
  */
 public function activate_post_types()
 {
     // define the properties post type
     $args = array('labels' => array('name' => __('Properties', 'happybeds-properties'), 'singular_name' => __('Property', 'happybeds-properties'), 'add_new' => __('Add New', 'happybeds-properties'), 'add_new_item' => __('Add New Property', 'happybeds-properties'), 'edit_item' => __('Edit Property', 'happybeds-properties'), 'all_items' => __('All Properties', 'happybeds-properties'), 'view_item' => __('View Property', 'happybeds-properties'), 'search_items' => __('Search Properties', 'happybeds-properties'), 'not_found' => __('No properties defined', 'happybeds-properties'), 'not_found_in_trash' => __('No properties in trash', 'happybeds-properties'), 'parent_item_colon' => '', 'menu_name' => __('Properties', 'happybeds-properties')), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => 'property'), 'exclude_from_search' => false, 'capability_type' => 'post', 'has_archive' => 'properties', 'hierarchical' => false, 'menu_position' => null, 'menu_icon' => "dashicons-building", 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'author'));
     // register post type
     lsx_register_post_type('property', $args);
     $labels = array('name' => _x('Spoken Languages', 'lsx'), 'singular_name' => _x('language', 'lsx'), 'menu_name' => __('Languages'));
     // Now register the taxonomy
     lsx_register_taxonomy('spoken_languages', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Special Interests', 'lsx'), 'singular_name' => _x('Special Interests', 'lsx'), 'menu_name' => __('Special Interests'));
     // Now register the taxonomy
     lsx_register_taxonomy('special_interests', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Property Facilities', 'lsx'), 'singular_name' => _x('Property Facility', 'lsx'), 'menu_name' => __('Property Facilities'));
     // Now register the taxonomy
     lsx_register_taxonomy('property_facilities', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Room Facilities', 'lsx'), 'singular_name' => _x('Room Facility', 'lsx'), 'menu_name' => __('Room Facilities'));
     // Now register the taxonomy
     lsx_register_taxonomy('room_facilities', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Available Services', 'lsx'), 'singular_name' => _x('Available Service', 'lsx'), 'menu_name' => __('Available Services'));
     // Now register the taxonomy
     lsx_register_taxonomy('available_services', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('On Site Activities', 'lsx'), 'singular_name' => _x('On Site Activity', 'lsx'), 'menu_name' => __('On Site Activities'));
     // Now register the taxonomy
     lsx_register_taxonomy('activities_on_site', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Off Site Activities', 'lsx'), 'singular_name' => _x('Off Site Activity', 'lsx'), 'menu_name' => __('Off Site Activities'));
     // Now register the taxonomy
     lsx_register_taxonomy('activities_off_site', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Friendly', 'lsx'), 'singular_name' => _x('Friendly', 'lsx'), 'menu_name' => __('Friendly'));
     // Now register the taxonomy
     lsx_register_taxonomy('friendly', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Types', 'lsx'), 'singular_name' => _x('Type', 'lsx'), 'menu_name' => __('Types'));
     // Now register the taxonomy
     lsx_register_taxonomy('property_type', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
     $labels = array('name' => _x('Locations', 'lsx'), 'singular_name' => _x('Location', 'lsx'), 'menu_name' => __('Locations'));
     // Now register the taxonomy
     lsx_register_taxonomy('locations', array('property'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'exclude_from_search' => false, 'show_admin_column' => true, 'query_var' => true));
 }