I found some solution to my own question.
I could use render_field
hook to modify wrapper ID or class to give a form unique name so that I can target specific field to insert HTML.
Sorry I wrongfully set the button field value.
Pls remove this topic.
Having read this topic(https://support.advancedcustomfields.com/forums/topic/add-field-group-to-a-custom-plugin-page/) I cannot add ACF fields to custom admin page.
The rule is still applicable now, right?
I found the problem. As you said, I deactivated all plugins except ACF, and rechecked functions.php
then I found a little function I wrote to reorder posts by date in admin page. That was it.
I am really really embarrassed and sorry for the trouble.
Just in case,
function my_stupid_function($wp-query) {
global $pagenow;
if ( is_admin() && 'edit.php' == $pagenow && !isset($_GET['orderby'])) {
$wp_query->set( 'orderby', 'date' );
$wp_query->set( 'order', 'DESC' );
}
}
add_filter('pre_get_posts', 'my_stupid_function' );
Thanks for the solution.
But unfortunately didn’t work for me.
I did put the code in my functions.php
and removed init
hook as you suggested, but still ignoring my settings.
I will keep finding the solution, however, since there are all fields I need I just use it as is.
Thank you.
@tuskotrush thanks for the very nice plugin!
Working great as I expected.
I have one question. I posted my question here.
It’s about fields order and strange redirection.
Will you help me out whenever you have time.
thank you.
anyone has idea?
I go more specific about my setting.
In my field group, there are 3 sets of field.
First set is select box to switch displaying following sets of field.
So if I chose A for example in the first set, 2nd set of field will be displayed, and if I chose B, 3rd set of field will appear.
In 2nd set, there are one level nested repeater field.
Then I try to add parent level repeater field that’s OK, but when I try to add child level repeater field, all the text input fields have “disabled” attribute in HTML so that I cannot type anything.
Any help or help with some link will be appreciate.
I missed @yitwail ‘s answer. Problem fixed!
Lessons learned. DO NOT USE ‘$acf’ for variable name.
Got it now 🙂
Same here.
In my case, this error occurs when using two functions together.
get_field_object() and get_fields().
Using get_fields() before get_field_object() leads me to this error.
Still no answer?
Same issue here.
I have tons of posts that uses ACF’s image field…
Migrating method that exporting the xml from test server to production server perform no good for image field, I had no solution but headache.
So I better off using plugin that migrates entire db.
All in on WP migration did good for me though.
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.