I’m confirming the issue reported by terranovamarina18, occurring with WP 4.5.2 and Jetpack 4.0.2. I’m using two functionalities: Carousel and Tiled Galleries.
The observed behavior is different, according to the method of triggering the “development mode”, as explained here:
https://jetpack.com/support/development-mode/
If the development mode is set in wp-config.php
with the line define( 'JETPACK_DEV_DEBUG', true);
, then both Carousel and Tiled Galleries work fine.
It’s different if the development mode is set in the theme’s functions.php
, with the filter add_filter( 'jetpack_development_mode', '__return_true' );
.
Jetpack seems fine, it says “In Development Mode, via the jetpack_development_mode filter.”, and I can activate the Carousel and Tiled Galleries on the Jetpack Settings page.
However, neither Carousel nor Tiled Galleries are working.
Not sure if this a bug, or if the filter works only in a plugin, not in a theme’s functions.php ?
Not sure if this a bug, or if the filter works only in a plugin, not in a theme’s functions.php ?
Indeed, this appears to be the case: the filter has no effect when run in functions.php of a theme, but works when running inside a functionality plugin.
For the filter issue on in a theme vs a plugin, we’ll take a closer look at it. The code that we to use to load the modules runs at the plugins_loaded
hook which fires before the theme’s functions.php has loaded.
For the original issue, if you’re on a local site isn’t in dev mode (because of the issue above) and not connected to WordPress.com, then the carousel option would not show.
I’m not sure if the restructuring needed to load everything else later is something that is feasible right now, but I opened up https://github.com/Automattic/jetpack/issues/3827 to get additional input.
Cheers!
Thanks for the follow-up!
So this confirms my assumptions that putting the filter in a plugin won’t work. That’s good to know – the documentation didn’t make it entirely clear, and the message in Jetpack’s dashboard was misleading.
As far as I know, it should work in a plugin, but works oddly in a theme’s functions.php. In either event, please do follow the conversation in the GitHub issue.
Cheers!