Support

Account

Forum Replies Created

  • Just figured out the solution to this myself so I share it here

    		$nfl_question_repeater = get_field('nl_form_questions', 'options' );
    //Just change the number here to specify the first repeater row
    		$row_outer = $nfl_question_repeater[0];
    		$row_question = $row_outer['question'];
    //Just change the number here to specify the nested repeater row
    		$row_inner = $row_question[1];
    		$row_inner_value = $row_inner['uses'];
  • If you want to search for custom fields you should use a plugin called Relevanssi (https://wordpress.org/plugins/relevanssi/).

    This plugin enables the standard wp search to look for terms inside custom fields also (it basically overrides the standard wp search).

    There is a setting in relevanssi that you can enable in order to make all custom fields searchable.

  • Great, thank you James for your help and support!

  • Perfect, thank you for that.

    Would this also be suitable to do if I want to differ from posts that are new or updated?

    Or is there a better solution for identifying if the post already exists or if it is new with acf/save_post? Because I want to send an email to the author when they create the post but not when they update it.

    I send an url query that identifies if the form should update an existing post or create a new one (by sending post=79 for example). I also use some checks to identify if it is the correct author.

    if(isset($_GET['post'])) {
    		$post_id = $_GET['post'];
    	}
    	$correct_author = true;
    	if(empty($post_id)) {
    		$post_id = 'new_post';
    		$submit_value = 'create';
    	} else {
    		$submit_value = 'update';
    		$post_author = get_post_field('post_author', $post_id);
    		$current_user = get_current_user_id();
    		
    		if( $post_author == $current_user ) {
    			$correct_author = true;
    		} else {
    			$correct_author = false;
    		}
    
    	}
    acf_form(array(
        'html_after_fields' => '<input type="hidden" name="acf[' . $submit_value .']" value="true"/>',
    ));
Viewing 4 posts - 1 through 4 (of 4 total)