Support

Account

Home Forums Front-end Issues Front End Form PayPal Reply To: Front End Form PayPal

  • Let’s start by trying include the PayPal field last.

    
    
    // custom action for saving the front end form
    	function my_pre_save_post( $post_id )
    	{
    	    // check if this is to be a new post
    	    if( $post_id != 'new' )
    	    {
    	        return $post_id;
    	    }
    	 
    	    // Create a new post
    	    $post = array(
    	        'post_status'  => 'draft' ,
    	        'post_title'  => $_POST['title'],
    	        'tax_input'     => array('job-category' => $_POST['job-category']),
    	        'post_type'  => 'jobs_post' ,
    	    );  
    	 
    	    // insert the post
    	    $post_id = wp_insert_post( $post ); 
    	 
    	 	// now set the taxonomy
    	 	wp_set_object_terms($post_id, array($_POST['job-category']), 'job-category');
    //	 	wp_set_object_terms($post_id, array($_POST['salary-range']), 'salary-range');
    	 
    	    // return the new ID
    	    return $post_id;
    	}
    	add_filter('acf/pre_save_post' , 'my_pre_save_post' );
    	
    	//Rename Options Menu ACF	
    	function my_acf_options_page_settings( $settings )
    	{
    		$settings['title'] = 'Theme Options';
    		$settings['pages'] = array('Email', 'Google AdSense', 'Google Analytics', 'Logo', 'Theme Colors');
    	 
    		return $settings;
    	}
    	 
    	add_filter('acf/options_page/settings', 'my_acf_options_page_settings');	
    	//end
    
    	include_once('add-ons/advanced-custom-fields/acf.php');
    	include_once('add-ons/acf-location-field-master/acf-location.php');
    	include_once('add-ons/acf-repeater/acf-repeater.php');
    	include_once('add-ons/acf-options-page/acf-options-page.php');
    	include_once('add-ons/acf-taxonomy-field-master/taxonomy-field.php');
    
    	require ( get_template_directory() . '/add-ons/custom-widgets.php' );
    	require ( get_template_directory() . '/add-ons/custom-form.php' );
    
    //ACF PayPal 
    	add_action('acf/register_fields', 'my_register_fields');
    	
    	function my_register_fields()
    	{
    	    include_once('add-ons/acf-paypal-field-master/paypal_item-v4.php');
    	}