Answers for "update acf custom post"

C
0

acf add options page to custom post type

if( function_exists('acf_add_options_page') ) {
    
    acf_add_options_sub_page(array(
        'page_title'     => 'Offers Page Content',
        'menu_title'    => 'offers-page-content',
        'parent_slug'    => 'edit.php?post_type=offers',
    ));

}
Posted by: Guest on April-02-2020
0

acf form update post

<?php function my_pre_save_post( $post_id ) {
      // Create a new post
      $post = array(
      	'post_status'  => 'publish' ,
      	'post_type'		=> 'acquisitions',
   		//Use the ACF fields to create the title or any other field.
      	'post_title'  => 'Acquisition' . ' ' . current_time( 'd/m/Y H:i:s', $gmt = 0 ),
      );  

      // insert the post
      $post_id = wp_insert_post( $post );
   	 // return the new ID
   	 return $post_id;
    }

add_filter('acf/pre_save_post' , 'my_pre_save_post', 1, 1 ); ?>

<?php acf_form_head(); ?>

<?php get_header(); ?>
Posted by: Guest on December-27-2020

Code answers related to "C"

Browse Popular Code Answers by Language