Ok understood, thanks for confirming. I’ll leave open here till they fix it.
John I think you’ve miss-read my email ? I’m referring to THIS forum.
Hi @aaronfrobb no sorry I didn’t.
I had admittedly slightly misunderstood the request of this post, there is clearly a different between field layouts and specific fields.
Still, if you do want to find subfields of a field in a field group try..
SELECT *
FROM wpas_postmeta pm, wpas_posts p
WHERE pm.meta_value LIKE "%paragraph_with_large_image%"
AND pm.post_id = p.ID
AND p.post_status = "publish"
This works well if you aren’t using repeaters/flexible content fields etc. If you are however and you want to search by an inner field then this won’t return any results.
Hi all, I’m so sorry this took me so long. I’m so short of time all personal projects don’t go very far normally and I knew I needed to clean this up before sharing it with anyone.
What I’ve done is now available with some basic documentation here: https://github.com/arkid/ACF-Fiddles/tree/master/ACF%20Repeater%20Copy-Paste
I hope it helps some of you, do share if it does!
So I fixed this myself with two new conditions in a custom JS file that uses jquery within the WP admin.
// run the code when the specific tab of the form group is clicked on
jQuery(document).on('click','*[data-key="field_123456789"]', function(event){
runCustomCodeFunction();
});
// also run my code if the page loads and this tab is visible (it isn't by default as it isn't the first tab)
if ( jQuery(".acf-field-123456789:visible").length > 0 ) {
runCustomCodeFunction();
}
The other option is to add this functionality as a bulk tool option in the dropdown at the bottom of the page that actually lists all the field groups. Ie you check off multiple field groups and then in the bulk drop down select “Batch create Local JSON” or something of that kind.
This really needs some kind of warning in the admin interface I feel to make it more user friendly! Its a very easy confusion to make and nothing suggests this could happen and not work as I believe 99% of people will imagine it would.
Same here, +1 !
I resolved this by adding $wp_query->is_main_query() to my clauses before the set command runs.
Same here and my fields are NOT added pragmatically at all, all via the standard ACF interface.
Please add a setting for height control Elliot!
I’ve answered this myself. I’ve used the hidden field addon plugin (https://github.com/erickertz/acf-hidden). If you set it to a width of 0.1% and don’t give it a title it appears very subtle within a repeater element and isn’t an eyesore.
I’ve then used the append JS ACF hook to capture new repeater rows being added and I then populate this field with a unix datetime stamp!
// catch newly created repeater rows...
acf.add_action('append', function( $el ){
var unixdatetime = Math.round((new Date()).getTime() / 1000);
var $row = $el.closest('.acf-row');
$row.find('.acf-field-5ad749e45b14f input').val(unixdatetime);
console.log("set date time stamp: "+unixdatetime);
});
Thanks so much for this teraviva, it was a very useful starting point for me to use the append JS hook.
Please please Elliot if you are reading this get gui control over the field added as soon as you can, its really inconsistent to not have it considering that the textarea field supports this.
Hi John thanks for the info. I’m just going to do
function my_acf_save_post( $post_id ) {
if ($post_id=="options"){
// my stuff to do...
}
}
and then go from there to keep it simple. I didn’t know about the post id appearing as options and I can confirm it’s plural, with the s. Cheers!
Hi @James thanks for the response. The second route sounds very much more feasible, I might have a go at this and if I do I will share the results.
Just another vote here to get this put into the admin, its really inconsistent that you can set the height of a textarea box in the admin and not the height of this field.
I can’t see this function in the ACF code, does it still exist @paulhuisman ?
@elliot Is there a possibility to add this as a setting soon as i often find I’m having to add css to do this change manually. More than anything it does’t seem a very suitable solution as due to the complex rendering of the wysiwyg element in most browsers the resizing of the iframe via code such as that shown above only comes into effect a second or so after the page has visibly rendered, resulting in a noticeable change and moving of all content below the field.
Fantastic thanks!
Latest v5
Yep I can confirm it is fixed as well now. Cheers @elliot
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.