Support

Account

Forum Replies Created

  • I was able to bypass this issue by moving the settings to an ACF options page for the time being.

  • Or what if I removed the post-editor support from the custom post type? Would that work if the issue is the jquery in the post-editor.js?

  • I too am having the same issue. Divi theme ACF. No time picker field. Do we have a workaround at least temporary for this? We are launching a site tomorrow that is for an event producer so having a time picker is fairly important. lol. I know it’s last minute, as things always are it seems. Can I simply unenqueue divi’s time picker js from all the custom post type entry pages? Or will it also have to be removed from the front end? I’m not using any of Divi’s time features that I’m aware of.

  • Thanks @acf-support !

    What I posted in my code above is after trying just about everything. I tried placing the the slug (irish-eyes) in the get_post_type() function and it didn’t work either.

    As for the $_POST[‘acf’] variable, I tried get_fields() as well. In my followup comment from above, I was able to finally get it to save to the post content, but this is what it saves:

    before the fieldsArrayafter the fields

    How to I get that “Array” text to save all the content of the fields from the post and not the word Array?

  • Thanks James!

    What I posted in my code above is after trying just about everything. I tried placing the the slug (irish-eyes) in the get_post_type() function and it didn’t work either.

    As for the $_POST[‘acf’] variable, I tried get_fields() as well. In my followup comment from above, I was able to finally get it to save to the post content, but this is what it saves:

    before the fieldsArrayafter the fields

    How to I get that “Array” text to save all the content of the fields from the post and not the word Array?

  • I was able to get it to work by changing the calls to act/save_post to save_post. But its showing the content as Array. Not sure where to go from here now….

    function my_acf_save_post( $post_id ){
    
    		if( isset($_POST['acf']) ){
    			$fields = $_POST['acf'];
    			$new_content = 'before the fields';
    			$new_content .= $fields;			
    			$new_content .= 'after the fields';
    			
    			$my_post = array(
    			'ID'           => $post_id,
    			'post_content' => $new_content
    			);
    
    			remove_action('save_post', 'my_acf_save_post', 20);
    			wp_update_post( $my_post );
    			add_action('save_post', 'my_acf_save_post', 20);
    		}
    	
    }
     
    // run after ACF saves the $_POST['acf'] data
    add_action('save_post', 'my_acf_save_post', 20);
    
Viewing 6 posts - 1 through 6 (of 6 total)