February 2, 2014 at 12:46 pm #88202
WordPress has a DISALLOW_FILE_EDIT constant which is used to tell plugins and themes to not edit the file system under any circumstances. Looking through the code for the genesis auto-update system, it doesn't look like Genesis respects this constant though.
When DISALLOW_FILE_EDIT is set to true WordPress hides items such as the theme code editor, and plugin installation page, so it'd make sense that Genesis should completely hide the auto-update option field, and never check for updates.
It might not be a bad idea to also introduce some of your own constants to control Genesis auto updating.
February 3, 2014 at 3:06 am #88299
- This topic was modified 3 years, 3 months ago by benValice.
- This topic was modified 3 years, 3 months ago by Susan.
I'm afraid you're mistaken - the constant is for disallowing the editing of files via the built-in Theme and Plugin Editors - not for disabling auto-updates of themes, plugins or core. As such, Genesis should not be looking for this constant.
If you want to disable auto-updates, there's the theme setting. If you want to disable programatically then you can use add
remove_theme_support( 'genesis-auto-updates' );sometime after the genesis_init priority 10 hook fires. Removing theme support will also hide the corresponding options on the Theme Settings page, so users won't even know about it.
Question is, why would you want to disable automatic updates?
February 3, 2014 at 2:28 pm #88398
Excuse me, I linked to the wrong constant, you're correct about DISALLOW_FILE_EDIT, I was thinking about DISALLOW_FILE_MODS; my mistake. I use these constants because we manage WordPress sites with git and composer, composer managing plugin and theme dependencies (such as Genesis). Allowing WordPress or Genesis to autoupdate makes the production, development, and staging go out of sync; which can cause issues during development.February 3, 2014 at 7:04 pm #88447
I've not dived into it fully, but the WP core already checks for DISALLOW_FILE_MODS, and disables all updates accordingly, so it may be that Genesis can't update anyway if that constant is true.
You could try setting Genesis version to 2.0.1, defining the constant to be true, then visiting the Updates page (or waiting at least 12 hours), and see if Genesis says an update is available. If so, then there's a problem (with a relatively simple fix in Genesis that would probably be in 2.1 if so), and if not, then everything is working. Do let me know the result.
As stated earlier, if you want to explicitly disable Genesis automatic updates, regardless of whether the constant is defined as true, you can do.
February 3, 2014 at 7:36 pm #88452
Perhaps I'm misunderstanding the system. Looking through it now it seems you're actually handing off to WordPress to update the files, and providing information for it using the genesis_update_push function? If so then WordPress would respect the constant and not attempt to update?
If so, then really I'd just recommend hiding the option panel if DISALLOW_FILE_MODS is set to true, as the options are no longer used anywhere.
You must be logged in to reply to this topic.