WP 4.1.1 + ACF 5.1.9.1. Still have this issue on attachment pages slash attachment permalinks. Somehow the attachment image gets included/injected in all following wysiwyg fields after the attachment (as in the footer in my case). This is really weird and if I remember correctly this actually have been solved in a earlier version, so I suspect it’s a bug that has come back.
Let us know if you can have a look on this issue..
Thanks!
Hmm, an update is that this only seems to be happening when running the installation locally.. Investigating further..
Just an update to say that this ‘bug’ is fixed in the latest version.
Thanks!
A quick update on that this bug still exist in the latest version (5.1.5).
Still hoping that this will get fixed.. ..or should I start considering other solutions to get around the problem? Anyone?
I can confirm that this bug is still active for me also (ACF PRO 5.1.2). So when viewing a WP attachment permalink page, that attachment image also gets inserted into wysiwyg option fields that I have in my footer file for any odd reason. Any clue?
Just to confirm that 5.1.2 does resolve the issues for me.
Thanks Elliot.
I can confirm this bug/issue also. Staying on the 5.1 for now.
Any updates on this? I basically just need a function to run after an option page has been saved.. Should be possible right?
Gesen, did you get it working somehow?
Hello Elliot
The suggested validate logic is not solving the issue for me unfortunately. Any chance of bringing back the save_post logic or any specific reason you’ve removed it? I was generating a stylesheet upon Options Save with the following code:
function generate_stylesheet() {
// Generate stylesheet
}
// After theme options save
add_action('acf/save_post', 'generate_stylesheet', 20);
.. so it was dependent on the action to run AFTER the Save as all the new values needs to be fully saved in db before it triggers the stylesheet creation.
If acf/save_post after action is gone forever, what would be your recommendation for a comparable solution in my case?
Thanks!
I can confirm this bug with the 5/PRO (5.08) version as well.
Any thoughts?
Hello, just to confirm that I’m experience the same thing.. Any fixes solutions yet? (I’m on ACF 4.3.8)
Just to confirm this bug is affecting me to: http://support.advancedcustomfields.com/forums/topic/color-picker-issue-on-the-latest-version/
Thanks for the input Elliot.
I ended up doing it like this:
function updateoptionkeys() {
$fields = array (
"field_515d9fcb5bee9"=>1,
"field_515d933e4347c"=>'value',
// etc etc.
);
foreach ($fields as $key=>$value) {
$existence = get_field_object($key, "options", false);
if (!get_field($existence[name], "options")) {
update_field($key, $value, "options");
}
}
}
function myactivationfunction($oldname, $oldtheme=false) {
updateoptionkeys();
}
add_action("after_switch_theme", "myactivationfunction");
Update. I have now improved this to be an associate array instead:
function updateoptionkeys() {
$fields = array (
"field_515d9fcb5bee9"=>0,
"field_515d933e4347c"=>50,
// etc...
);
foreach ($fields as $key=>$value) {
update_field($key, $value, "options");
}
}
function myactivationfunction($oldname, $oldtheme=false) {
updateoptionkeys();
}
add_action("after_switch_theme", "myactivationfunction");
But this means it will revert back to default values everytime the user switch on/off the theme…
Doesn’t get_field() work with field keyvalues instead of id/name anymore?
Current approach:
(in functions.php)
// Update option keys on theme activation
function updateoptionkeys() {
// BASE
if (!get_field("field_515d9fcb5bee9", "options")) {update_field("field_515d9fcb5bee9", 0, "options");}
if (!get_field("field_515d933e4347c", "options")) {update_field("field_515d933e4347c", 50, "options");}
//...etc
}
// When switching Theme Hook
function myactivationfunction($oldname, $oldtheme=false) {
// IF Theme options is not set, do set/update them when activating theme
updateoptionkeys();
}
add_action("after_switch_theme", "myactivationfunction");
For some reason this approach doesn’t seem to work with the latest v. of WP & ACF…
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.