Markdown: enable for posts whenever the module is active.#6608
Markdown: enable for posts whenever the module is active.#6608dereksmart merged 3 commits intomasterfrom
Conversation
3fb4e3d to
c54efbd
Compare
|
This'll work, but it'll also cause an extra DB hit on every page load. Is there a way to get a little bit more discrete with how/when we call this? Maybe hook it onto plugin_upgrade? |
modules/markdown.php
Outdated
| // Step 1. Force the option on whenever this file is loaded (i.e. when the module is acive). | ||
| add_filter( 'pre_option_' . WPCom_Markdown::POST_OPTION, '__return_true' ); | ||
|
|
||
| /** |
There was a problem hiding this comment.
@dereksmart Shouldn't we keep hiding that field, to avoid confusion? We don't really want folks to be fiddling with that field, do we?
There was a problem hiding this comment.
I don't see that change in the diff, have you reviewed an older version?
eliorivero
left a comment
There was a problem hiding this comment.
This LGTM since it will set the option to true if it doesn't exist. It will also set it to true if it's set to false, but we don't have that situation currently and it will only be done once during plugin upgrade.
We do need to remember to remove this when the new settings UI is released.
cc @tyxla so he's aware of this change. We need this since users activating the module don't have the option set to true (it was previously faked as true with a filter that was always returning true). We're setting it to true only once during next plugin upgrade.
@samhotchkiss, if you look at the conditional this is in, you'll see that it will only hit when the versions do not match, i.e. when the plugin has been upgraded. |
jeherve
left a comment
There was a problem hiding this comment.
This worked in my tests! LGTM 🚢
|
merged to 4.7 71752a9 |
Enable markdown for posts on plugin upgrade.
The filter that forcefully enabled this when markdown was enabled was removed in #6406. On plugin upgrade it will be re-enabled.
Fixes #6605
Related:
Proposed changelog entry for your changes: