PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | class-jetpack-gallery-settings.php +14 -1 12.0.3 → 16.3-a.1 View file →
@@ -6,13 +6,26 @@
6 6 */
7 7
8 8 use Automattic\Jetpack\Assets;
9 9
10 +if ( ! defined( 'ABSPATH' ) ) {
11 + exit( 0 );
12 +}
13 +
10 14 /**
11 15 * Renders extra controls in the Gallery Settings section of the new media UI.
16 + *
17 + * @phan-constructor-used-for-side-effects
12 18 */
13 19 class Jetpack_Gallery_Settings {
14 20 /**
21 + * Available gallery types.
22 + *
23 + * @var array
24 + */
25 + public $gallery_types;
26 +
27 + /**
15 28 * The constructor.
16 29 */
17 30 public function __construct() {
18 31 add_action( 'admin_init', array( $this, 'admin_init' ) );
@@ -33,9 +46,9 @@
33 46 */
34 47 $this->gallery_types = apply_filters( 'jetpack_gallery_types', array( 'default' => __( 'Thumbnail Grid', 'jetpack' ) ) );
35 48
36 49 // Enqueue the media UI only if needed.
37 - if ( count( $this->gallery_types ) > 1 ) {
50 + if ( is_countable( $this->gallery_types ) && count( $this->gallery_types ) > 1 ) {
38 51 add_action( 'wp_enqueue_media', array( $this, 'wp_enqueue_media' ) );
39 52 add_action( 'print_media_templates', array( $this, 'print_media_templates' ) );
40 53 }
41 54 // Add Slideshow and Galleries functionality to core's media gallery widget.