Forum Replies Created

Viewing 6 replies - 16 through 21 (of 21 total)
  • badlydrawnben

    (@badlydrawnben)

    +1 for a good solution to this.

    It’s a great plugin and works brilliantly ‘out-of-the-box’. In my testing though, the background video loads and plays on Chrome on my Android phone, but it shows the fallback image on my iPad.

    I would like to be able to show the video on tablets but hide it on phones, so personally I’d like to be able to load the videos according to screen width (though I know that’s getting more complicated than it used to be with high resolution devices etc)

    Thanks,
    Ben

    Thread Starter badlydrawnben

    (@badlydrawnben)

    Hi Jack,

    At the moment I’m just using ‘Not published’ for Before and ‘Published’ for After. Seems to work OK.

    Thanks,
    Ben

    Thread Starter badlydrawnben

    (@badlydrawnben)

    Hi Jack,

    Just a quick update on this – I got the email notifications working ‘out of the box’ with ACF front-end user submissions via this plugin https://www.ads-software.com/support/plugin/post-status-notifier-lite

    I’m nowhere near smart enough to know how/why that one worked. I’m just posting it as a reference here in case you ever needed to revisit the ACF problem again in the future.

    Thanks,
    Ben

    Thread Starter badlydrawnben

    (@badlydrawnben)

    Hi Jack,

    No luck with that I’m afraid. I tried it just in functions.php and also in the custom page template that has all the front-end-ACF post creation stuff in. I put in this hook, but I’m not sure that’s the right place for it to go?

    ...other code
    add_filter('acf/pre_save_post' , 'bb_do_pre_save_post' );
    function bb_do_pre_save_post( $post_id ) {
    	// Bail if not logged in or not able to post
    	if ( ! ( is_user_logged_in() || current_user_can('publish_posts') ) ) {
    		return;
    	}
    	// check if this is to be a new post
    	if( $post_id != 'new' ) {
    		return $post_id;
    	}
    	// Create a new post
    	$post = array(
    		'post_type'     => 'sponsorship', // Your post type ( post, page, custom post type )
    		'post_status'   => 'publish', // (publish, draft, private, etc.)
    		'post_title'    => wp_strip_all_tags($_POST['acf']['field_xxxxxxxxxxxx']), // Post Title ACF field key
    		'post_content'  => $_POST['acf']['field_xxxxxxxx'], // Post Content ACF field key
    	);
    	// insert the post
    	$post_id = wp_insert_post( $post );
    	// Get Better Notifications plugin to work when New sponsorship page created
    	add_filter( 'bnfw_trigger_insert_post', '__return_true' );
    	// Save the fields to the post
    	do_action( 'acf/save_post' , $post_id );
    	return $post_id;
    }
    Thread Starter badlydrawnben

    (@badlydrawnben)

    Hi Jack,

    I have tried to pare it back to the most basic setup – so only the ACF, email log and BNFW plugins activated, and using the 2016 theme out of the box (with and without that functions.php snippet in your Support Docs).

    I am also trying the most basic version of the ACF form setup using this tutorial https://www.advancedcustomfields.com/resources/using-acf_form-to-create-a-new-post/ (the first page-new-post.php file).

    That creates a new Post and saves it fine. Still no notification though.

    Do you have ACF installed on any of your test sites? If so, could you try this as a page template and see if it triggers a notification for ‘New Post creation’

    <?php 
    
    acf_form_head();
    
    get_header();
    
    ?>
    <div id="content">
    
    	<?php
    
    	acf_form(array(
    		'post_id'		=> 'new_post',
    		'post_title'	=> true,
    		'post_content'	=> true,
    	));
    
    	?>
    
    </div>
    
    <?php get_footer(); ?>

    Thanks,
    Ben

    Thread Starter badlydrawnben

    (@badlydrawnben)

    Hi Jack,

    Thanks for your quick reply.

    I am using latest version of WP and the relevant plugins. The poster in that other support thread did seem to have the notifications working when creating a CPT via an ACF front-end form. It’s not working in my case though.

    His was set to create the posts as ‘pending’ status. I have tried that as well as ‘new’ and ‘published’ but the notifications don’t trigger. I have notifications triggered for New posts and post updates. Neither is working though. If I create a new post in the ‘back end’ (the WP dashboard) then I do get the notification email.

    I have tried it both with and without the bnfw_insert_post_themes function in my functions.php file.

    There is a hook in the acf_form() functionality called ‘acf/save_post’. If I manually code in a test wp_mail function hooked into there, then that does send me the test email. I want to be able to customise the notifications in the WP dashboard though.

    Sorry – I’m sure that’s not much to go on, but I’m reporting it here in case a solution may become apparent in time.

    Thanks,
    Ben

Viewing 6 replies - 16 through 21 (of 21 total)