Support » Plugin: Jetpack - WP Security, Backup, Speed, & Growth » Dev mode auto Activate a module using the modules list only

  • Resolved christinemerrifield2

    (@christinemerrifield2)


    Hi,

    I have tried to auto activate markdown in php using a option_jetpack_active_modules filter. This does not consistently activate Markdown.

    I cannot use Settings->Writing as this needs to be hidden from the users, so the module has to be activated through the modules list page or activated by default using php. The modules list page does not always activate Markdown either, even if the module page list says it is activated.

    We are also using Classic editor and Gutenberg is not suitable for our users.

    Any help would be gratefully received to consistently activate Markdown.

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    The modules list page does not always activate Markdown either, even if the module page list says it is activated.

    That does seem to indicate some issues with your setup. Could you let us know how you’ve used the option_jetpack_active_modules filter?

    Hi

    Thanks for your reply,

    Yes I have been using option_jetpack_active_modules to activate Markdown.

    Hi
    Using the option_jetpack_active_modules to activate Markdown appears to show Markdown as activated in the Modules list, but on Settings->Writing the slider is not turned on.

    Using WordPress 5.4.2, Jetpack 8.7.1 and PHP 7.2

    Thanks

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Yes I have been using option_jetpack_active_modules to activate Markdown.

    Could you post the code you’ve been using on your site here?

    christinemerrifield2

    (@christinemerrifield2)

    Hi thanks for your support. Sorry it has been a while.

    I have tested this code on a small test site with 3 themes and 6 plugins, one being Jetpack in dev mode. (All plugins, apart from Jetpack, have been Network disabled)

    add_filter( 'option_jetpack_active_modules', 'jetpack_docs_filter_active_modules' );
    function jetpack_docs_filter_active_modules( $modules ) {
    	return array_values( array_merge( $modules, array( 'markdown' ) ) );
    }
    

    On the modules list the module is showing as active but the toggle switch on the Settings-> Writing page is off.

    As I mentioned in a previous comment, we can only use the modules list and cannot view the Settings page at all, so using the Settings page to activate Markdown is not available to us.

    I am using this in a Multi site and I have added this code to the functions.php file of my theme, if I can get this to work I will add it to a custom plugin that will be an mu-plugin.

    (Also as an additional note both carousel and custom-content-types Configure links from the modules page go to the Settings page and not the WordPress Admin pages, this does not work for those using the modules only page)

    Thank you

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Thanks for the extra details. I believe this is happening because you enable the feature programatically.

    Could you try adding the following snippet, to enable the option as you enable the feature?
    add_filter( 'pre_option_wpcom_publish_posts_with_markdown', '__return_true' );

    as an additional note both carousel and custom-content-types Configure links from the modules page go to the Settings page and not the WordPress Admin pages

    That’s indeed done on purpose.

    Could you tell me more about your setup, how and why you’ve restricted access to the Settings page, and what we could change to make that page more useful / usable for you? Maybe we can figure out a way to make that settings screen better for you, so you don’t have to rely on the modules list?

    christinemerrifield2

    (@christinemerrifield2)

    Hi @jeherve

    Thank you for your response, I will be testing this.

    The deploy is a children’s educational environment and is very tightly governed, no one, not even the Network Admin, is able to add plugins, themes or sign up for any additional services. The governing body decides what is available and visible within the environment. There is also a short list of approved Jetpack modules that are available to the children.

    Jetpack Settings page has quite a few notifications, adverts and links that are not appropriate for this environment, so the simple modules page suits the requirements well. To allow these very young users to use the Settings there would need to be a way of ‘removing’ any adverts, upgrade links, notifications or html links that were seen to be unsuitable, inappropriate, or confusing for children.

    Thank you

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Thanks for the extra details!

    To allow these very young users to use the Settings there would need to be a way of ‘removing’ any adverts, upgrade links, notifications or html links that were seen to be unsuitable, inappropriate, or confusing for children.

    It may be worth trying to use a combination of the filters described here (especially jetpack_get_available_modules) to remove the modules you don’t want to show from the UI, as well as the jetpack_show_promotions filter to remove more elements from the UI. It may bring you to a point where fewer things are accessible to students.

    If there are still things that you’d rather not show and cannot seem to be able to hide, let me know and I’ll see what we could do to help you remove those.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.