Die benutzerdefinierte Taxonomie funktioniert nicht vom Frontend nach dem Senden

Hallo, ich arbeite an einem Video-Sharing-Site-Projekt!

Ich habe eine Vorlagendatei erstellt, in der Leute ihren Beitrag als Video einreichen können! Alles funktionierte sehr gut, aber die benutzerdefinierte Taxonomie po nstars bekommt keine Daten. Das Tag funktioniert, aber wenn Leute po nstars einreichen feild die Posts pornstars feild wurde leer, aber alles ist korrekt! Meine Vorlagendatei ist –

success): $pornstars = trim( $_POST['post_pornstars'] ); $tags = $_POST['post_tags']; $uploaddir = wp_upload_dir(); $file = $_FILES['featured' ]; $uploadfile = $uploaddir['path'] . '/' . basename( $file['name'] ); move_uploaded_file( $file['tmp_name'] , $uploadfile ); $filename = basename( $uploadfile ); $wp_filetype = wp_check_filetype(basename($filename), null ); $attachment = array( 'post_mime_type' => $wp_filetype['type'], 'post_title' => preg_replace('/\.[^.]+$/', '', $filename), 'post_content' => '', 'post_status' => 'inherit', 'menu_order' => $_i + 1000 ); $attach_id = wp_insert_attachment( $attachment, $uploadfile ); $post_information = array( 'post_title' => esc_attr(strip_tags($_POST['video_title'])), 'post_content' => esc_attr(strip_tags($_POST['video_description'])), 'post-type' => 'post', 'post_status' => 'pending', 'tags_input' => $tags, 'tax_input' => array( $pornstars ), 'post_category' => array($_POST['category_selected']) ); $post_id = wp_insert_post($post_information); wp_set_object_terms($post_id,$pornstars,'post_pornstars'); if($post_id){ // Update Custom Meta update_post_meta($post_id,'_thumbnail_id',$attach_id); set_post_thumbnail( $post_id, $thumbnail_id ); update_post_meta($post_id, 'url_video', esc_attr(strip_tags($_POST['url_player']))); update_post_meta($post_id, 'url_player', esc_attr($_POST['url_player'])); update_post_meta($post_id, 'wpscript_embed', esc_attr($_POST['video_embed'])); update_post_meta($post_id, 'wpscript_thumb', esc_attr(strip_tags($_POST['video_thumb']))); if( ( isset($_POST['duration_hh']) ) && ( isset($_POST['duration_mm']) ) && ( isset($_POST['duration_ss']) ) ){ $duree_seconds = $_POST['duration_hh'] * 3600 + $_POST['duration_mm'] * 60 + $_POST['duration_ss']; update_post_meta($post_id, 'wpscript_duration', $duree_seconds); } set_post_format($post_id, 'video' ); } $succMsg = __( 'Thanks for submitting a video! Your submission is being moderated.', 'wp-script-theme-pro' ); else: $errMsg = __( 'Captcha verification failed, please try again.', 'wp-script-theme-pro' ); endif; else: $errMsg = __( 'Please click on the reCAPTCHA box.', 'wp-script-theme-pro' ); endif; else: $pornstars = trim( $_POST['post_pornstars'] ); $tags = $_POST['post_tags']; $uploaddir = wp_upload_dir(); $file = $_FILES['featured' ]; $uploadfile = $uploaddir['path'] . '/' . basename( $file['name'] ); move_uploaded_file( $file['tmp_name'] , $uploadfile ); $filename = basename( $uploadfile ); $wp_filetype = wp_check_filetype(basename($filename), null ); $attachment = array( 'post_mime_type' => $wp_filetype['type'], 'post_title' => preg_replace('/\.[^.]+$/', '', $filename), 'post_content' => '', 'post_status' => 'inherit', 'menu_order' => $_i + 1000 ); $attach_id = wp_insert_attachment( $attachment, $uploadfile ); $post_information = array( 'post_title' => esc_attr(strip_tags($_POST['video_title'])), 'post_content' => esc_attr(strip_tags($_POST['video_description'])), 'post-type' => 'post', 'post_status' => 'pending', 'tags_input' => $tags, 'tax_input' => array( $pornstars ), 'post_category' => array($_POST['category_selected']) ); $post_id = wp_insert_post($post_information); wp_set_object_terms($post_id,$pornstars,'post_pornstars'); if($post_id){ // Update Custom Meta update_post_meta($post_id,'_thumbnail_id',$attach_id); set_post_thumbnail( $post_id, $thumbnail_id ); update_post_meta($post_id, 'url_video', esc_attr(strip_tags($_POST['url_player']))); update_post_meta($post_id, 'url_player', esc_attr($_POST['url_player'])); update_post_meta($post_id, 'wpscript_embed', esc_attr($_POST['video_embed'])); update_post_meta($post_id, 'wpscript_thumb', esc_attr(strip_tags($_POST['video_thumb']))); if( ( isset($_POST['duration_hh']) ) && ( isset($_POST['duration_mm']) ) && ( isset($_POST['duration_ss']) ) ){ $duree_seconds = $_POST['duration_hh'] * 3600 + $_POST['duration_mm'] * 60 + $_POST['duration_ss']; update_post_meta($post_id, 'wpscript_duration', $duree_seconds); } set_post_format($post_id, 'video' ); $succMsg = __( 'Thanks for submitting a video! Your submission is being moderated.', 'wp-script-theme-pro' ); } endif; else: $errMsg = ''; $succMsg = ''; endif; get_header(); ?>  

<input type="text" name="url_player" id="url_player" value="" class="required" />
<textarea name="video_embed" id="video_embed" rows="4" cols="30" class="required">
<input type="file" name="featured" id="featured" value="" class="required" />
<input type="text" name="video_title" id="video_title" value="" class="required" /> <input type="text" name="post_tags" id="post_tags" value="" class="required" /> <input type="text" name="post_pornstars" id="post_pornstars" value="" class="required" /> 0 ) ); foreach ( (array)$categories as $category ): ?> <option value="term_id; ?>">name;?>
<textarea name="video_description" id="video_description" rows="8" cols="30" class="required">
<div class="g-recaptcha" data-sitekey="" data-theme="dark">
<?php /* */ ?>
<?php printf(__('You must be logged to submit a video. Please login or register a new account.', 'wp-script-theme-pro'), '#wpst-login', '#wpst-register'); ?>

Und das Taxonomie-Register ist –

   _x( 'Pornstars', 'wp-script-theme-pro' ), 'singular_name' => _x( 'Pornstar', 'wp-script-theme-pro' ), 'search_items' => __( 'Search Pornstars' ), 'popular_items' => __( 'Popular Pornstars' ), 'all_items' => __( 'All Pornstars' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Pornstar' ), 'update_item' => __( 'Update Pornstar' ), 'add_new_item' => __( 'Add New Pornstar' ), 'new_item_name' => __( 'New Pornstar Name' ), 'separate_items_with_commas' => __( 'Separate Pornstars with commas' ), 'add_or_remove_items' => __( 'Add or remove Pornstars' ), 'choose_from_most_used' => __( 'Choose from the most used Pornstars' ), 'menu_name' => __( 'Pornstars' ), ); // Now register the non-hierarchical taxonomy like tag register_taxonomy('pornstars','post', array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array( 'slug' => 'pornstar' ) )); } 

Die Pornstars-Taxonomie ist immer leer, fehlt mir etwas? Kann mir jemand dabei helfen?

Solutions Collecting From Web of "Die benutzerdefinierte Taxonomie funktioniert nicht vom Frontend nach dem Senden"