Search
 
SCRIPT & CODE EXAMPLE
 

PHP

acf create post with fields

// CREATE NEW POST + CREATE ACF FIELDS
$new_post = array(
'post_title' => $message,
'post_content' => $content,
'post_status' => 'publish',
'post_type' => 'post', // page or your custom post type
);
$post_id = wp_insert_post($new_post);

// CREATE FIELDS ACF inside on the created post
update_field("type", $acf_type, $post_id); // params: field, value, postId
update_field("sendMail", "yes", $post_id);
Comment

PREVIOUS NEXT
Code Example
Php :: mysql get number of rows php 
Php :: config clear without artisan 
Php :: how to acces sql with php 
Php :: php mail in localhost wamp 
Php :: file_get_contents php 
Php :: PHP strtoupper — Make a string uppercase 
Php :: php quotations within quotations 
Php :: remove last comma from string php foreach 
Php :: php insert array into mysql 
Php :: eloquent where raw 
Php :: php artisan tinker encription cmd 
Php :: how condition for multiple row by orwhere laravel 
Php :: jquery code to trigger php function 
Php :: sass mix laravel 
Php :: how to execute php function on button click 
Php :: apache using wrong php version 
Php :: codeigniter 3 where not in 
Php :: php one hour in the future 
Php :: Unknown column type "double" requested. Any Doctrine type that you use has to be registered with DoctrineDBALTypesType::addType 
Php :: php pdo sql server connect 
Php :: magento2 get full details of order collection 
Php :: Set a minimum subtotal amount in Woocommerce cart 
Php :: php != operator 
Php :: symfony messenger conf 
Php :: php foreach loop 
Php :: mysql Cannot pass parameter 2 by reference 
Php :: group_concat mysql limit issue 
Php :: laravel use config 
Php :: php shortcode wordpress return content with shortcodes 
Php :: utc time php 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =