_x("Products Extra", "Products Extra"), 'singular_name' => _x("Products Extra", "Products Extra"), 'menu_name' => 'Products Extra', 'add_new' => _x("Add New Entry", "Products Extra"), 'add_new_item' => __("Add New"), 'edit_item' => __("Edit Entry"), 'new_item' => __("New Entry"), 'view_item' => __("View Entry"), 'search_items' => __("Search Entries"), 'not_found' => __("No Entries Found"), 'not_found_in_trash' => __("No Entries Found in Trash"), 'parent_item_colon' => '' ); // Register post type register_post_type('sp_product_extra' , array( 'labels' => $labels, 'public' => true, 'menu_position' => 100, 'has_archive' => false, 'hierarchical' => false, 'publicly_queryable' => false, 'menu_icon' => plugins_url( 'icon.png', __FILE__ ), 'capabilities' => array( 'edit_post' => 'update_core', 'read_post' => 'update_core', 'delete_post' => 'update_core', 'edit_posts' => 'update_core', 'edit_others_posts' => 'update_core', 'delete_posts' => 'update_core', 'publish_posts' => 'update_core', 'read_private_posts' => 'update_core' ), 'rewrite' => array('slug' => '', 'with_front' => false), 'supports' => array('title') ) ); } add_action( 'init', 'create_sp_product_extra', 0 ); _x("Subjects Extra", "Subjects Extra"), 'singular_name' => _x("Subjects Extra", "Subjects Extra"), 'menu_name' => 'Subjects Extra', 'add_new' => _x("Add New Entry", "Subjects Extra"), 'add_new_item' => __("Add New"), 'edit_item' => __("Edit Entry"), 'new_item' => __("New Entry"), 'view_item' => __("View Entry"), 'search_items' => __("Search Entries"), 'not_found' => __("No Entries Found"), 'not_found_in_trash' => __("No Entries Found in Trash"), 'parent_item_colon' => '' ); // Register post type register_post_type('sp_subjects' , array( 'labels' => $labels, 'public' => true, 'menu_position' => 100, 'has_archive' => false, 'hierarchical' => false, 'publicly_queryable' => true, 'menu_icon' => plugins_url( 'icon.png', __FILE__ ), 'rewrite' => array('slug' => 'subjects', 'with_front' => false), 'supports' => array('title') ) ); } add_action( 'init', 'create_sp_subjects', 10 ); function get_subjects_post_type_template($single_template) { global $post; if ($post->post_type == 'sp_subjects') { $single_template = dirname( __FILE__ ) . '/subject-type-template.php'; } return $single_template; } add_filter( 'single_template', 'get_subjects_post_type_template' ); $categories_array = array(); require_once( ABSPATH . '/wp-content/plugins/supapress/includes/functions.php' ); if(function_exists('supapress_call_supafolio') && is_admin()) { $sup_pub_theme_search_filter_categories = supapress_call_supafolio('searchfilter', array( 'filters' => 'category' )); if(!empty($sup_pub_theme_search_filter_categories->filters) && $sup_pub_theme_search_filter_categories->filters !== null && isset($sup_pub_theme_search_filter_categories->filters->category) && isset($sup_pub_theme_search_filter_categories->filters->category->values) ) { foreach($sup_pub_theme_search_filter_categories->filters->category->values as $categories) { $categories_array[$categories->seo_name] = $categories->name; } } } if( function_exists('acf_add_local_field_group') ): acf_add_local_field_group(array ( 'key' => 'group_595fb0c9f090d', 'title' => 'Subjects Fields', 'fields' => array ( array ( 'key' => 'field_595fb0cb0c3w5', 'label' => 'Select Subjects', 'name' => 'sp_subjects_extra_subjects', 'type' => 'select', 'instructions' => '', 'required' => 1, 'conditional_logic' => 0, 'wrapper' => array ( 'width' => '', 'class' => '', 'id' => '', ), 'choices' => $categories_array, 'default_value' => array(), 'allow_null' => 0, 'multiple' => 0, 'ui' => 1, 'ajax' => 0, 'return_format' => 'value', 'placeholder' => '', ), array ( 'key' => 'field_595fb0ca04d81', 'label' => 'Intro copy', 'name' => 'sp_subjects_extra_text_copy', 'type' => 'wysiwyg', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array ( 'width' => '', 'class' => '', 'id' => '', ), 'default_value' => '', 'tabs' => 'all', 'toolbar' => 'full', 'media_upload' => 1, 'delay' => 0, ), array ( 'key' => 'field_595fb0ca04eae', 'label' => 'Search results shortcode', 'name' => 'sp_subjects_extra_search_shortcode', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array ( 'width' => '', 'class' => '', 'id' => '', ), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'sp_subjects', ), ), ), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => '', 'active' => 1, 'description' => '', )); endif; about - Weldon Owen about - Weldon Owen