Home › Forums › Front-end Issues › Front End Form PayPal › Reply To: Front End Form PayPal
Thanks Mike, I appreciate it! Here is all the code in my functions.php relating to acf:
// 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' );
//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');
}
//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' );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp
— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.