body.post-type-%s #edit-slug-box, body.post-type-%s .row-actions .view { display: none; }', $this->post_type, $this->post_type ); } function post_type() { register_post_type( $this->post_type, array( 'labels' => array( 'name' => __( 'Anton Accordions', ANTON_ACCORDION ), 'singular_name' => __( 'Anton Accordion', ANTON_ACCORDION ), 'add_new' => __( 'Add Accordion', ANTON_ACCORDION ), 'add_new_item' => __( 'Add New Accordion', ANTON_ACCORDION ), 'edit_item' => __( 'Edit Accordion', ANTON_ACCORDION ), 'all_items' => __( 'Accordions', ANTON_ACCORDION ), 'menu_name' => __( 'Anton Accordions', ANTON_ACCORDION ), 'view_item' => false ), 'public' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'show_in_nav_menus' => false, 'exclude_from_search' => true, 'supports' => array( 'title', 'editor', 'revisions' ), 'taxonomies' => array( $this->taxonomy ), ) ); register_taxonomy( $this->taxonomy, $this->post_type, array( 'labels' => array( 'name' => __( 'Category', 'taxonomy general name', ANTON_ACCORDION ), 'add_new_item' => __( 'Add New Category', ANTON_ACCORDION ), 'new_item_name' => __( 'New Category', ANTON_ACCORDION ), ), 'exclude_from_search' => true, 'has_archive' => true, 'hierarchical' => true, 'rewrite' => false, ) ); } function manage_taxonomies( $taxonomies ) { $taxonomies[] = $this->taxonomy; return $taxonomies; } function template_redirect(){ if( get_post_type() == $this->post_type ){ wp_redirect( get_bloginfo( 'url' ) ); exit(); } } function add_meta_box(){ add_meta_box( 'anton_theme_meta_box', __( 'Extra Fields', ANTON_ACCORDION ), array( $this, 'meta_box_callback' ), $this->post_type, 'normal' ); } function meta_box_callback( $post ) { wp_nonce_field( 'anton_accordion_meta_box', 'anton_accordion_meta_box_nonce' ); $img_url = ANTON_WIDGETS_IMG_URL . '/no-image.png'; if( wp_get_attachment_image_url( get_post_meta( $post->ID, 'cover_image', true ), 'full' ) ){ $img_url = wp_get_attachment_image_url( get_post_meta( $post->ID, 'cover_image', true ), 'full' ); } ?>

post_type == $_POST['post_type'] ) { if ( ! current_user_can( 'edit_page', $post_id ) ) { return; } } else { if ( ! current_user_can( 'edit_post', $post_id ) ) { return; } } update_post_meta( $post_id, 'gender', sanitize_text_field( $_POST['gender'] ) ); update_post_meta( $post_id, 'position', sanitize_text_field( $_POST['position'] ) ); update_post_meta( $post_id, 'counrty', sanitize_text_field( $_POST['counrty'] ) ); } } new Anton_Accordions_Post_Type;