Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Not possible to override OG data when page contains global Fusion Builder container #1804
Issue reported by Nicolas D. via e-mail.
It's not possible to override OG data (title, description) in AIOSEOP when someone is using the Fusion Builder plugin to create his pages and added a global container to his page.
To reproduce this, install both All in One SEO Pack and Fusion Builder, create a new page, add a container and save that container as a global element. Then, change the OG data and confirm that it hasn't changed after updating the page.
@wpsmort, could you please verify this again on your end?
We also have this issue with WooCommerce and Fusion Builder - #1682. We should get a fix or two out since this is a pretty popular plugin (comes with the Avada theme).
I have access to the repositories of Theme Fusion's plugins and their Avada theme. Contact me in case you need them.
@arnaudbroes @wpsmort looks like this is because of https://github.com/semperfiwebdesign/all-in-one-seo-pack/blob/master/admin/aioseop_module_class.php#L2095-L2098.
What happens when we save a global container is this:
The above code thus is fired for ID 123 first and then "locks" the method so that when it is the turn of post ID 100, the variable
If I comment out https://github.com/semperfiwebdesign/all-in-one-seo-pack/blob/master/admin/aioseop_module_class.php#L2097 it works as expected and the data is saved.
I'm not sure why this
This was introduced in 2.0.4, though I'm not sure exactly why. The changelog just says "Bugfixes for issues reported by users in WordPress.org support forums"
The naming of the variable $update is confusing, but this is likely meant to keep the function from running multiple times on the same update/save/publish/etc. I'm not exactly sure what the fix is, but off the top of my head maybe there's some way to see what post we're trying to save, and make sure it's currently 100 instead of 123?
@michaeltorbert If the intent was to keep the function from running multiple times on the same save etc. then the approach is incorrect. The correct way is to remove the hook and then add it back again.
Do you want to (1) leave this bug as it is, (2) correct the behavior by removing/adding hooks or (3) by checking if there is a specific way this functionality can be overridden only for posts that are built with fusion builder?