<?php

add_action( 'init', 'create_post_type_faqs', 0 );
function create_post_type_faqs() {
 
    $labels = array(
        'name'                => _x( 'Faqs', 'Post Type General Name', 'felicityhealth' ),
        'singular_name'       => _x( 'Faq', 'Post Type Singular Name', 'felicityhealth' ),
        'menu_name'           => __( 'Faqs', 'felicityhealth' ),
        'parent_item_colon'   => __( 'Parent Faq:', 'felicityhealth' ),
        'all_items'           => __( 'All Faq', 'felicityhealth' ),
        'view_item'           => __( 'View Faq', 'felicityhealth' ),
        'add_new_item'        => __( 'Add New Faq', 'felicityhealth' ),
        'add_new'             => __( 'Add New Faq', 'felicityhealth' ),
        'edit_item'           => __( 'Edit Faq', 'felicityhealth' ),
        'update_item'         => __( 'Update Faq', 'felicityhealth' ),
        'search_items'        => __( 'Search Faq', 'felicityhealth' ),
        'not_found'           => __( 'No faqs found', 'felicityhealth' ),
        'not_found_in_trash'  => __( 'No faqs found in trash', 'felicityhealth' ),
    );
    $args = array(
        'label'               => __( 'Faqs', 'felicityhealth' ),
        'description'         => __( 'Faqs Description', 'felicityhealth' ),
        'labels'              => $labels,
        'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions', 'custom-fields', 'permalinks', 'featured_image' ),
        'show_in_rest'        => true,
        // 'taxonomies'          => array( 'category' ),
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'menu_icon'           => 'dashicons-admin-comments',
        'can_export'          => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'page'

    );
    register_post_type( 'faqs', $args );
}

  // Faqs categories
  add_action( 'init', 'register_taxonomy_faq_category', 0 );

  function register_taxonomy_faq_category() {

      $labels = array(
          // See list of labels in docs I linked above (bold and blue "here")     
      );
      $args = array(  

          // Custom labels? Remove them all to get "default"
          'labels'              => $labels,
          // Does these have child-parent relationships?
          'hierarchical'        => true,
          // Translatable pretty slugs?
          'rewrite'             => array( 'slug' => __( 'faq-category', 'review' ) ),
          // Generate a default UI for managing this taxonomy?
          'show_ui'             => true,
          // Allow automatic creation of taxonomy columns on associated post-types table?
          'show_admin_column'   => true,
          // Show in quick edit panel?
          'show_in_quick_edit'  => true,
          'show_in_rest'        => true,
      );

      register_taxonomy( 'faq-category', 'faqs', $args );
  }
