Костомные поля !
Пожалуйста подскажите как быть с кастомными полями, как мне их вставить в запись посредством обработчика формы ?
обработчик у меня выглядит вот так !
<?php /* Define these, So that WP functions work inside this file */ define('WP_USE_THEMES', false); require( $_SERVER['DOCUMENT_ROOT'] .'/wp-blog-header.php'); ?> <?php if(isset($_POST['send']) == '1') { $post_title = $_POST['title']; $post_category = $_POST['cat']; $post_content = $_POST['description']; $external_featured_image[url]=$_POST['external_featured_image[url]']; $new_post = array( 'ID' => '', 'post_author' => $user->ID, 'post_category' => array($post_category), 'post_content' => $post_content, 'post_title' => $post_title, 'post_status' => 'pending' ); $post_id = wp_insert_post($new_post); // This will redirect you to the newly created post $post = get_post($post_id); wp_redirect($post->guid); } ?>
обработчик формы отправляет стандартные поля , но как добавить кастомные поля ума не приложу помогите пожалуйста очень вас прошу !
эти кастомные поля из плагина я не могу отправить их в базу данных сайта.
<p style="text-align: center;"><input name="external_featured_image[url]" type="text" value="" placeholder="Enter the Image URL" /></p> <p style="text-align: center;"><input id="acf-field_5848664f865df" class="" maxlength="20" name="acf[field_5848664f865df]" type="text" value="" placeholder="Pages: '" /></p> <p style="text-align: center;"><input id="acf-field_58486845865e0" class="" maxlength="20" name="acf[field_58486845865e0]" type="text" value="" placeholder="Size: '" /></p> <p style="text-align: center;"><input id="acf-field_584868abf14de" class="" name="acf[field_584868abf14de]" type="url" value="" placeholder="Uploaded.net Link*" /></p> <p style="text-align: center;"><input id="acf-field_584869f8f14df" class="" name="acf[field_584869f8f14df]" type="url" value="" placeholder="Keep2share.cc Link*" /></p> <p style="text-align: center;"><input id="acf-field_58486a4cf14e0" class="" name="acf[field_58486a4cf14e0]" type="url" value="" placeholder="Fileboom.me Link*" /></p> <p style="text-align: center;"><textarea id="acf-field_58486aa8f14e1-59cf9fc1e7fc4" class="wp-editor-area" style="height: 150px; width: 600px;" name="acf[field_58486aa8f14e1]"></textarea></p> <p style="text-align: center;"><textarea id="acf-field_58486aa8f14e1-59cf9fc1e7fc4" class="wp-editor-area" style="height: 100px; width: 600px;" name="acf[field_58486aa8f14e1]"></textarea></p>