Found my solution (below)
function custom_user_profile_fields($user){
?>
<script>
(function($) {$(function() {
document.getElementById("send_user_notification").checked = false;
//JS HERE
});})( jQuery );
</script>
<?php
}
//add_action( 'show_user_profile', 'custom_user_profile_fields' );
//add_action( 'edit_user_profile', 'custom_user_profile_fields' );
add_action( "user_new_form", "custom_user_profile_fields" );
thank you, this was exactly what I was looking for and it answered my question.
I’m using Oxygen Builder so i dont have access to the header.php or theme pages which made me put the acf_form_head() in the functions.php file and the init hook callback works like a charm!
thank you jonyhayama and Log1x for provding a pretty good solution, but it would be amazing if ACF had a builtin phone number field
any luck with this? im also trying to do something similar to this
Basically, I want to get the product category by the ACF repeater field from a regular page
can’t make another edit but I think I need to clarify what I want to do…
I want to do a WP_Query with a search term that would go through the ACF repeater field and return the category if that entry exists.
Hey,
is there a way to limit the user roles to only custom/subscribers user roles?
FYI: This can be done through the User field now
https://www.advancedcustomfields.com/resources/user/
Thanks John for sharing the resources..
How would I pass a repeater subfield data into the localize script?
Edit:
Solved my own question:
https://allisontarr.com/2017/09/15/function-wp_localize_script/
You dont need the .descriptor_list on acf_vars.list_parent
I create a shortcode and place the shortcode inside the module
function foobar_func( $atts ){
ob_start();
//ACF fields here
return ob_get_clean();
}
add_shortcode( 'foobar', 'foobar_func' );
I use a shortcode to build out what I want then place the shortcode into the divi module
function foobar_func( $atts ){
ob_start();
//ACF fields here
return ob_get_clean();
}
add_shortcode( 'foobar', 'foobar_func' );
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!
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.