%PDF- %PDF-
| Direktori : /var/www/projetos/stb.ind.br/wp-content/themes/stb/includes/ |
| Current File : /var/www/projetos/stb.ind.br/wp-content/themes/stb/includes/class-stb-cases.php |
<?php
namespace STB_Cases;
if ( ! defined( 'ABSPATH' ) ) {
die( 'Not allowed' );
}
class STB_Cases
{
function __construct() {
add_action( 'init', array( __CLASS__, 'register_cases_ctp' ) );
add_action( 'init', array( __CLASS__, 'register_services_tax' ) );
}
public static function register_cases_ctp() {
$labels = array(
'name' => __( 'Cases', 'stb' ),
'singular_name' => __( 'Case', 'stb' ),
'all_items' => __( 'All Cases', 'stb' ),
'view_item' => __( 'View Case', 'stb' ),
'edit_item' => __( 'Edit Case', 'stb' ),
'search_items' => __( 'Search Cases', 'stb' ),
);
$args = array(
'label' => __( 'Cases', 'stb' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' ),
'taxonomies' => array( 'services' ),
'hierarchical' => true,
'public' => true,
'has_archive' => false,
'publicly_queryable' => true,
'menu_icon' => 'dashicons-awards',
);
register_post_type( 'cases', $args );
}
public static function register_services_tax() {
$labels = array(
'name' => __( 'Services', 'stb' ),
'singular_name' => __( 'Service', 'stb' ),
'all_items' => __( 'All Services', 'stb' ),
'edit_item' => __( 'Edit Service', 'stb' ),
'menu_name' => __( 'Services', 'stb' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'rewrite' => array(
'slug' => 'servicos'
),
);
register_taxonomy( 'services', array( 'cases' ), $args );
}
}
new STB_Cases();