Created
October 9, 2018 07:57
-
-
Save oterox/208101a019e2f592f20d39a5d7b31483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: ox Core | |
* Plugin URI: https://github.com/citricamente/ox-core | |
* Version: 0.2 | |
* Author: Citricamente | |
* License: GPL2 | |
* Text Domain: barcelo-core | |
* Domain Path: /languages | |
*/ | |
class OXBarceloCore{ | |
/** | |
* Constructor. Called when plugin is initialised | |
*/ | |
function OXBarceloCore() { | |
add_action( 'plugins_loaded', array( &$this, 'ox_load_plugin_textdomain' ) ); | |
add_action( 'init', array( &$this, 'register_cpt_destination' )); | |
add_action( 'init', array( &$this, 'register_cpt_plan' )); | |
add_action( 'init', array( &$this, 'register_cpt_itinerary' )); | |
add_action( 'init', array( &$this, 'register_cpt_area' )); | |
add_action( 'init', array( &$this, 'register_cpt_accommodation' )); | |
add_action( 'init', array( &$this, 'register_tax_destination' )); | |
//add_action( 'init', array( &$this, 'register_tax_tipo_plan' )); | |
add_action( 'init', array( &$this, 'register_tax_destination' )); | |
add_action( 'init', array( &$this, 'register_tax_main_category' )); | |
add_action( 'init', array( &$this, 'register_tax_target' )); | |
add_action( 'init', array( &$this, 'register_tax_duration' )); | |
add_action( 'init', array( &$this, 'register_tax_season' )); | |
add_action( 'init', array( &$this, 'register_tax_popularity' )); | |
add_action( 'init', array( &$this, 'register_tax_zone' )); | |
add_action( 'init', array( &$this, 'register_tax_tipo_experiencia' )); | |
add_action( 'init', array( &$this, 'register_tax_stay_duration' )); | |
add_action( 'init', array( &$this, 'register_tax_tourist_attraction' )); | |
add_action( 'init', array( &$this, 'register_tax_rango_precios' )); | |
add_action( 'init', array( &$this, 'register_tax_idiomas' )); | |
add_action( 'init', array( &$this, 'flush_rewrites' )); | |
add_action( 'admin_head', array( &$this,'barcelo_admin_menu_icons_css' )); | |
} | |
function ox_load_plugin_textdomain() { | |
load_plugin_textdomain( 'barcelo-core', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); | |
} | |
/** | |
* Registers a Custom Post Type called destination | |
*/ | |
function register_cpt_destination() { | |
register_post_type('destination', array( | |
'labels' => array( | |
'name' => _x( 'Destinations', 'post type general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Destination', 'post type singular name', 'barcelo-core' ), | |
'menu_name' => _x( 'Destinations', 'admin menu', 'barcelo-core' ), | |
'name_admin_bar' => _x( 'Destination', 'add new on admin bar', 'barcelo-core' ), | |
'add_new' => _x( 'Add New', 'destination', 'barcelo-core' ), | |
'add_new_item' => __( 'Add New Destination', 'barcelo-core' ), | |
'new_item' => __( 'New Destination', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Destination', 'barcelo-core' ), | |
'view_item' => __( 'View Destination', 'barcelo-core' ), | |
'all_items' => __( 'All Destinations', 'barcelo-core' ), | |
'search_items' => __( 'Search Destinations', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Parent Destinations:', 'barcelo-core' ), | |
'not_found' => __( 'No destinations found.', 'barcelo-core' ), | |
'not_found_in_trash' => __( 'No destinations found in Trash.', 'barcelo-core' ), | |
), | |
// Frontend | |
'has_archive' => true, | |
'public' => true, | |
'publicly_queryable' => true, | |
// Admin | |
'capability_type' => 'post', | |
'menu_icon' => 'dashicons-admin-site', | |
'rewrite' => array( 'slug' => 'destinos' ), | |
'menu_position' => 10, | |
'query_var' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => true, | |
'show_ui' => true, | |
'supports' => array( | |
'title', | |
'editor', | |
'thumbnail', | |
'excerpt', | |
'page-attributes' | |
), | |
)); | |
} | |
/** | |
* Registers a Custom Post Type called Plan | |
*/ | |
function register_cpt_plan() { | |
register_post_type('plan', array( | |
'labels' => array( | |
'name' => _x( 'Plans', 'post type general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Plan', 'post type singular name', 'barcelo-core' ), | |
'menu_name' => _x( 'Plans', 'admin menu', 'barcelo-core' ), | |
'name_admin_bar' => _x( 'Plan', 'add new on admin bar', 'barcelo-core' ), | |
'add_new' => _x( 'Add New', 'plan', 'barcelo-core' ), | |
'add_new_item' => __( 'Add New Plan', 'barcelo-core' ), | |
'new_item' => __( 'New Plan', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Plan', 'barcelo-core' ), | |
'view_item' => __( 'View Plan', 'barcelo-core' ), | |
'all_items' => __( 'All Plans', 'barcelo-core' ), | |
'search_items' => __( 'Search Plans', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Parent Plans:', 'barcelo-core' ), | |
'not_found' => __( 'No plans found.', 'barcelo-core' ), | |
'not_found_in_trash' => __( 'No plans found in Trash.', 'barcelo-core' ), | |
), | |
// Frontend | |
'has_archive' => true, | |
'public' => true, | |
'publicly_queryable' => true, | |
// Admin | |
'capability_type' => 'post', | |
'menu_icon' => 'dashicons-location-alt', | |
'rewrite' => array( 'slug' => 'planes' ), | |
'menu_position' => 10, | |
'query_var' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => true, | |
'show_ui' => true, | |
'supports' => array( | |
'title', | |
'editor', | |
'thumbnail', | |
'excerpt', | |
'page-attributes' | |
), | |
)); | |
} | |
/** | |
* Registers a Custom Post Type called Itinerary | |
*/ | |
function register_cpt_itinerary() { | |
register_post_type('itinerary', array( | |
'labels' => array( | |
'name' => _x( 'Itineraries', 'post type general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Itinerary', 'post type singular name', 'barcelo-core' ), | |
'menu_name' => _x( 'Itineraries', 'admin menu', 'barcelo-core' ), | |
'name_admin_bar' => _x( 'Itinerary', 'add new on admin bar', 'barcelo-core' ), | |
'add_new' => _x( 'Add New', 'itinerary', 'barcelo-core' ), | |
'add_new_item' => __( 'Add New Itinerary', 'barcelo-core' ), | |
'new_item' => __( 'New Itinerary', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Itinerary', 'barcelo-core' ), | |
'view_item' => __( 'View Itinerary', 'barcelo-core' ), | |
'all_items' => __( 'All Itineraries', 'barcelo-core' ), | |
'search_items' => __( 'Search Itineraries', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Parent Itineraries:', 'barcelo-core' ), | |
'not_found' => __( 'No itineraries found.', 'barcelo-core' ), | |
'not_found_in_trash' => __( 'No itineraries found in Trash.', 'barcelo-core' ), | |
), | |
// Frontend | |
'has_archive' => true, | |
'public' => true, | |
'publicly_queryable' => true, | |
// Admin | |
'capability_type' => 'post', | |
'menu_icon' => 'dashicons-redo', | |
'rewrite' => array( 'slug' => 'itinerarios' ), | |
'menu_position' => 10, | |
'query_var' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => true, | |
'show_ui' => true, | |
'supports' => array( | |
'title', | |
'editor', | |
'thumbnail', | |
'excerpt', | |
'page-attributes' | |
), | |
)); | |
} | |
/** | |
* Registers a Custom Post Type called Area | |
*/ | |
function register_cpt_area() { | |
register_post_type('area', array( | |
'labels' => array( | |
'name' => _x( 'Areas', 'post type general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Area', 'post type singular name', 'barcelo-core' ), | |
'menu_name' => _x( 'Areas', 'admin menu', 'barcelo-core' ), | |
'name_admin_bar' => _x( 'Area', 'add new on admin bar', 'barcelo-core' ), | |
'add_new' => _x( 'Add New', 'area', 'barcelo-core' ), | |
'add_new_item' => __( 'Add New Area', 'barcelo-core' ), | |
'new_item' => __( 'New Area', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Area', 'barcelo-core' ), | |
'view_item' => __( 'View Area', 'barcelo-core' ), | |
'all_items' => __( 'All Areas', 'barcelo-core' ), | |
'search_items' => __( 'Search Areas', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Parent Areas:', 'barcelo-core' ), | |
'not_found' => __( 'No areas found.', 'barcelo-core' ), | |
'not_found_in_trash' => __( 'No areas found in Trash.', 'barcelo-core' ), | |
), | |
// Frontend | |
'has_archive' => true, | |
'public' => true, | |
'publicly_queryable' => true, | |
// Admin | |
'capability_type' => 'post', | |
'menu_icon' => 'dashicons-chart-area', | |
'rewrite' => array( 'slug' => 'zonas' ), | |
'menu_position' => 10, | |
'query_var' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => true, | |
'show_ui' => true, | |
'supports' => array( | |
'title', | |
'editor', | |
'thumbnail', | |
'excerpt', | |
'page-attributes' | |
), | |
)); | |
} | |
/** | |
* Registers a Custom Post Type called Accommodation | |
*/ | |
function register_cpt_accommodation() { | |
register_post_type('accommodation', array( | |
'labels' => array( | |
'name' => _x( 'Accommodations', 'post type general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Accommodation', 'post type singular name', 'barcelo-core' ), | |
'menu_name' => _x( 'Accommodations', 'admin menu', 'barcelo-core' ), | |
'name_admin_bar' => _x( 'Accommodation', 'add new on admin bar', 'barcelo-core' ), | |
'add_new' => _x( 'Add New', 'accommodation', 'barcelo-core' ), | |
'add_new_item' => __( 'Add New Accommodation', 'barcelo-core' ), | |
'new_item' => __( 'New Accommodation', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Accommodation', 'barcelo-core' ), | |
'view_item' => __( 'View Accommodation', 'barcelo-core' ), | |
'all_items' => __( 'All Accommodations', 'barcelo-core' ), | |
'search_items' => __( 'Search Accommodations', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Parent Accommodations:', 'barcelo-core' ), | |
'not_found' => __( 'No accommodations found.', 'barcelo-core' ), | |
'not_found_in_trash' => __( 'No accommodations found in Trash.', 'barcelo-core' ), | |
), | |
// Frontend | |
'has_archive' => true, | |
'public' => true, | |
'publicly_queryable' => true, | |
// Admin | |
'capability_type' => 'post', | |
'menu_icon' => 'dashicons-admin-home', | |
'rewrite' => array( 'slug' => 'alojamientos' ), | |
'menu_position' => 10, | |
'query_var' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => true, | |
'show_ui' => true, | |
'supports' => array( | |
'title', | |
'editor', | |
'thumbnail', | |
'excerpt', | |
'page-attributes' | |
), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Tipo Plan | |
*/ | |
function register_tax_destination() { | |
$labels = array( | |
'name' => _x( 'Destino', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Destino', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Buscar por Destino', 'barcelo-core' ), | |
'all_items' => __( 'Todos los destinos', 'barcelo-core' ), | |
'parent_item' => __( 'Destino padre', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Destino padre:', 'barcelo-core' ), | |
'edit_item' => __( 'Editar Destino', 'barcelo-core' ), | |
'update_item' => __( 'Actualizar Destino', 'barcelo-core' ), | |
'add_new_item' => __( 'Añadir nuevo Destino', 'barcelo-core' ), | |
'new_item_name' => __( 'Nombre del nuevo Destino', 'barcelo-core' ), | |
); | |
register_taxonomy( 'tax_destination', array( 'plan', 'product', 'area', 'itinerary', 'accommodation' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'meta_box_cb' => false, | |
'query_var' => true, | |
//'rewrite' => array( 'slug' => 'destination' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Tipo Plan | |
*/ | |
function register_tax_tipo_plan() { | |
$labels = array( | |
'name' => _x( 'Tipos de plan', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Tipo de plan', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Buscar por tipo de plan', 'barcelo-core' ), | |
'all_items' => __( 'Todos los tipos de plan', 'barcelo-core' ), | |
'parent_item' => __( 'Tipo de plan padre', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Tipo de plan padre:', 'barcelo-core' ), | |
'edit_item' => __( 'Editar Tipo de Plan', 'barcelo-core' ), | |
'update_item' => __( 'Actualizar Tipo de Plan', 'barcelo-core' ), | |
'add_new_item' => __( 'Añadir nuevo Tipo de Plan', 'barcelo-core' ), | |
'new_item_name' => __( 'Nombre del nuevo Tipo de Plan', 'barcelo-core' ), | |
); | |
register_taxonomy( 'plan_type', array( 'plan' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'plan-type' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Main Category | |
*/ | |
function register_tax_main_category() { | |
$labels = array( | |
'name' => _x( 'Main Categories', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Main Category', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Main Category', 'barcelo-core' ), | |
'all_items' => __( 'All Main Categories', 'barcelo-core' ), | |
'parent_item' => __( 'Main category parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Main category parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Main Category', 'barcelo-core' ), | |
'update_item' => __( 'Update Main category', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Main Category', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Main Category', 'barcelo-core' ), | |
); | |
register_taxonomy( 'main_category', array( 'plan','itinerary','area' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'tematica' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Target | |
*/ | |
function register_tax_target() { | |
$labels = array( | |
'name' => _x( 'Targets', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Target', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Target', 'barcelo-core' ), | |
'all_items' => __( 'All Targets', 'barcelo-core' ), | |
'parent_item' => __( 'Target parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Target parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Target', 'barcelo-core' ), | |
'update_item' => __( 'Update Target', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Target', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Target', 'barcelo-core' ), | |
); | |
register_taxonomy( 'target', array( 'plan','itinerary' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'target' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Season | |
*/ | |
function register_tax_season() { | |
$labels = array( | |
'name' => _x( 'Seasons', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Season', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Seasons', 'barcelo-core' ), | |
'all_items' => __( 'All Seasons', 'barcelo-core' ), | |
'parent_item' => __( 'Season parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Season parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Season', 'barcelo-core' ), | |
'update_item' => __( 'Update Season', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Season', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Season', 'barcelo-core' ), | |
); | |
register_taxonomy( 'season', array( 'plan','itinerary' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'meta_box_cb' => false, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'season' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Duration | |
*/ | |
function register_tax_duration() { | |
$labels = array( | |
'name' => _x( 'Durations', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Duration', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Durations', 'barcelo-core' ), | |
'all_items' => __( 'All Durations', 'barcelo-core' ), | |
'parent_item' => __( 'Duration parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Duration parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Duration', 'barcelo-core' ), | |
'update_item' => __( 'Update Duration', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Duration', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Duration', 'barcelo-core' ), | |
); | |
register_taxonomy( 'duration', array( 'plan', 'product' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'duration' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Popularity | |
*/ | |
function register_tax_popularity() { | |
$labels = array( | |
'name' => _x( 'Popularity', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Popularity', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Popularity', 'barcelo-core' ), | |
'all_items' => __( 'All Popularities', 'barcelo-core' ), | |
'parent_item' => __( 'Popularity parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Popularity parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Popularity', 'barcelo-core' ), | |
'update_item' => __( 'Update Popularity', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Popularity', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Popularity', 'barcelo-core' ), | |
); | |
register_taxonomy( 'popularity', array( 'plan' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'popularity' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Tax Zone | |
*/ | |
function register_tax_zone() { | |
$labels = array( | |
'name' => _x( 'Zones', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Zone', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Zone', 'barcelo-core' ), | |
'all_items' => __( 'All Zones', 'barcelo-core' ), | |
'parent_item' => __( 'Zone parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Zone parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Zone', 'barcelo-core' ), | |
'update_item' => __( 'Update Zone', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Zone', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Zone', 'barcelo-core' ), | |
); | |
register_taxonomy( 'zone', array( 'plan', 'itinerary','accommodation' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'zone' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Tipo Experiencia | |
*/ | |
function register_tax_tipo_experiencia() { | |
$labels = array( | |
'name' => _x( 'Tipos de experiencia', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Tipo de experiencia', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Buscar por tipo de experiencia', 'barcelo-core' ), | |
'all_items' => __( 'Todos los tipos de experiencia', 'barcelo-core' ), | |
'parent_item' => __( 'Tipo de experiencia padre', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Tipo de experiencia padre:', 'barcelo-core' ), | |
'edit_item' => __( 'Editar Tipo de experiencia', 'barcelo-core' ), | |
'update_item' => __( 'Actualizar Tipo de experiencia', 'barcelo-core' ), | |
'add_new_item' => __( 'Añadir nuevo Tipo de experiencia', 'barcelo-core' ), | |
'new_item_name' => __( 'Nombre del nuevo Tipo de experiencia', 'barcelo-core' ), | |
); | |
register_taxonomy( 'exp_type', array( 'product' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'exp-type' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Stay Duration | |
*/ | |
function register_tax_stay_duration() { | |
$labels = array( | |
'name' => _x( 'Stay duration', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Stay duration', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Durations', 'barcelo-core' ), | |
'all_items' => __( 'All Durations', 'barcelo-core' ), | |
'parent_item' => __( 'Duration parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Duration parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Duration', 'barcelo-core' ), | |
'update_item' => __( 'Update Duration', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Duration', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Duration', 'barcelo-core' ), | |
); | |
register_taxonomy( 'stay_duration', array( 'itinerary' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
//'rewrite' => array( 'slug' => 'duration' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Tax Zone | |
*/ | |
function register_tax_tourist_attraction() { | |
$labels = array( | |
'name' => _x( 'Tourist Attraction', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Tourist Attraction', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for Attraction', 'barcelo-core' ), | |
'all_items' => __( 'All Attractions', 'barcelo-core' ), | |
'parent_item' => __( 'Tourist Attraction parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Tourist Attraction parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit Attraction', 'barcelo-core' ), | |
'update_item' => __( 'Update Attraction', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new Attraction', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Tourist Attraction', 'barcelo-core' ), | |
); | |
register_taxonomy( 'tourist_attraction', array( 'plan', 'product' ), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'attraction' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called RangoPrecios | |
*/ | |
function register_tax_rango_precios() { | |
$labels = array( | |
'name' => _x( 'Price range', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Price range', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search for range', 'barcelo-core' ), | |
'all_items' => __( 'All Ranges', 'barcelo-core' ), | |
'parent_item' => __( 'Range parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Range parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit', 'barcelo-core' ), | |
'update_item' => __( 'Update', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new', 'barcelo-core' ), | |
'new_item_name' => __( 'Title for Price range', 'barcelo-core' ), | |
); | |
register_taxonomy( 'price_range', array( 'product' ), array( | |
'hierarchical' => false, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'show_admin_column' => true, | |
'meta_box_cb' => false, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'price-range' ), | |
)); | |
} | |
/** | |
* Registers a Taxonomy called Idiomas | |
*/ | |
function register_tax_idiomas() { | |
$labels = array( | |
'name' => _x( 'Idiomas', 'taxonomy general name', 'barcelo-core' ), | |
'singular_name' => _x( 'Idioma', 'taxonomy singular name', 'barcelo-core' ), | |
'search_items' => __( 'Search', 'barcelo-core' ), | |
'all_items' => __( 'All', 'barcelo-core' ), | |
'parent_item' => __( 'Parent', 'barcelo-core' ), | |
'parent_item_colon' => __( 'Parent:', 'barcelo-core' ), | |
'edit_item' => __( 'Edit', 'barcelo-core' ), | |
'update_item' => __( 'Update', 'barcelo-core' ), | |
'add_new_item' => __( 'Add new', 'barcelo-core' ), | |
'new_item_name' => __( 'Title', 'barcelo-core' ), | |
); | |
register_taxonomy( 'idioma', array( 'product' ), array( | |
'hierarchical' => false, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'show_admin_column' => true, | |
'meta_box_cb' => false, | |
'query_var' => true, | |
)); | |
} | |
function flush_rewrites(){ | |
flush_rewrite_rules(); | |
} | |
} | |
$OXcpt = new OXCore; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment