summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2019-05-22 00:42:33 -0400
committerYury German <blueknight@gentoo.org>2019-05-22 00:42:33 -0400
commite89abce1b01dda89efdf230101d1aa3c877b3b6c (patch)
treecfb27a564c1f4cfff30d18dbf591efd48283b154 /plugins/jetpack/functions.gallery.php
parentAdding Twentyninetten (diff)
downloadblogs-gentoo-e89abce1b01dda89efdf230101d1aa3c877b3b6c.tar.gz
blogs-gentoo-e89abce1b01dda89efdf230101d1aa3c877b3b6c.tar.bz2
blogs-gentoo-e89abce1b01dda89efdf230101d1aa3c877b3b6c.zip
Updating of Plugins and Themes
List of Plugins updates -- akismet.4.1.2 google-authenticator.0.52 jetpack.7.3.1 List of Themes Updates -- mantra.3.2.0 twentyfifteen.2.5 twentyfourteen.2.7 Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/functions.gallery.php')
-rw-r--r--plugins/jetpack/functions.gallery.php101
1 files changed, 0 insertions, 101 deletions
diff --git a/plugins/jetpack/functions.gallery.php b/plugins/jetpack/functions.gallery.php
deleted file mode 100644
index 7fc90611..00000000
--- a/plugins/jetpack/functions.gallery.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-
-/**
- * Renders extra controls in the Gallery Settings section of the new media UI.
- */
-class Jetpack_Gallery_Settings {
- function __construct() {
- add_action( 'admin_init', array( $this, 'admin_init' ) );
- }
-
- function admin_init() {
- /**
- * Filter the available gallery types.
- *
- * @module shortcodes, tiled-gallery
- *
- * @since 2.5.1
- *
- * @param array $value Array of the default thumbnail grid gallery type. Default array contains one key, ‘default’.
- *
- */
- $this->gallery_types = apply_filters( 'jetpack_gallery_types', array( 'default' => __( 'Thumbnail Grid', 'jetpack' ) ) );
-
- // Enqueue the media UI only if needed.
- if ( count( $this->gallery_types ) > 1 ) {
- add_action( 'wp_enqueue_media', array( $this, 'wp_enqueue_media' ) );
- add_action( 'print_media_templates', array( $this, 'print_media_templates' ) );
- }
- // Add Slideshow and Galleries functionality to core's media gallery widget.
- add_filter( 'widget_media_gallery_instance_schema', array( $this, 'core_media_widget_compat' ) );
- }
-
- /**
- * Updates the schema of the core gallery widget so we can save the
- * fields that we add to Gallery Widgets, like `type` and `conditions`
- *
- * @param $schema The current schema for the core gallery widget
- *
- * @return array the updated schema
- */
- public function core_media_widget_compat( $schema ) {
- $schema['type'] = array(
- 'type' => 'string',
- 'enum' => array_keys( $this->gallery_types ),
- 'description' => __( 'Type of gallery.', 'jetpack' ),
- 'default' => 'default',
- );
- return $schema;
- }
-
- /**
- * Registers/enqueues the gallery settings admin js.
- */
- function wp_enqueue_media() {
- if ( ! wp_script_is( 'jetpack-gallery-settings', 'registered' ) ) {
- /**
- * This only happens if we're not in Jetpack, but on WPCOM instead.
- * This is the correct path for WPCOM.
- */
- wp_register_script(
- 'jetpack-gallery-settings',
- Jetpack::get_file_url_for_environment( '_inc/build/gallery-settings.min.js', '_inc/gallery-settings.js' ),
- array( 'media-views' ),
- '20121225'
- );
- }
-
- wp_enqueue_script( 'jetpack-gallery-settings' );
- }
-
- /**
- * Outputs a view template which can be used with wp.media.template
- */
- function print_media_templates() {
- /**
- * Filter the default gallery type.
- *
- * @module tiled-gallery
- *
- * @since 2.5.1
- *
- * @param string $value A string of the gallery type. Default is ‘default’.
- *
- */
- $default_gallery_type = apply_filters( 'jetpack_default_gallery_type', 'default' );
-
- ?>
- <script type="text/html" id="tmpl-jetpack-gallery-settings">
- <label class="setting">
- <span><?php _e( 'Type', 'jetpack' ); ?></span>
- <select class="type" name="type" data-setting="type">
- <?php foreach ( $this->gallery_types as $value => $caption ) : ?>
- <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $default_gallery_type ); ?>><?php echo esc_html( $caption ); ?></option>
- <?php endforeach; ?>
- </select>
- </label>
- </script>
- <?php
- }
-}
-new Jetpack_Gallery_Settings;