diff options
author | Yury German <blueknight@gentoo.org> | 2022-01-23 18:37:36 -0500 |
---|---|---|
committer | Yury German <blueknight@gentoo.org> | 2022-01-23 18:37:36 -0500 |
commit | f18b23a3a9378fb0a98856d436aa9ebf94e47429 (patch) | |
tree | e418433e22854ebd2d77eaa869d5d0470a973317 /plugins/jetpack/modules/tiled-gallery/tiled-gallery.php | |
parent | Add classic-editor 1.5 (diff) | |
download | blogs-gentoo-f18b23a3a9378fb0a98856d436aa9ebf94e47429.tar.gz blogs-gentoo-f18b23a3a9378fb0a98856d436aa9ebf94e47429.tar.bz2 blogs-gentoo-f18b23a3a9378fb0a98856d436aa9ebf94e47429.zip |
Updating Classic Editor, Google Authenticatior, Jetpack, Public Post Preview, Table of Contents, Wordpress Importer
Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/tiled-gallery/tiled-gallery.php')
-rw-r--r-- | plugins/jetpack/modules/tiled-gallery/tiled-gallery.php | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/plugins/jetpack/modules/tiled-gallery/tiled-gallery.php b/plugins/jetpack/modules/tiled-gallery/tiled-gallery.php index f99e7558..768f8749 100644 --- a/plugins/jetpack/modules/tiled-gallery/tiled-gallery.php +++ b/plugins/jetpack/modules/tiled-gallery/tiled-gallery.php @@ -72,18 +72,18 @@ class Jetpack_Tiled_Gallery { } public function get_attachments() { - extract( $this->atts ); + $atts = $this->atts; - if ( ! empty( $include ) ) { - $include = preg_replace( '/[^0-9,]+/', '', $include ); + if ( ! empty( $atts['include'] ) ) { + $include = preg_replace( '/[^0-9,]+/', '', $atts['include'] ); $_attachments = get_posts( array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', - 'order' => $order, - 'orderby' => $orderby, + 'order' => $atts['order'], + 'orderby' => $atts['orderby'], 'suppress_filters' => false, ) ); @@ -92,34 +92,37 @@ class Jetpack_Tiled_Gallery { foreach ( $_attachments as $key => $val ) { $attachments[ $val->ID ] = $_attachments[ $key ]; } - } elseif ( 0 == $id ) { - // Should NEVER Happen but infinite_scroll_load_other_plugins_scripts means it does - // Querying with post_parent == 0 can generate stupidly memcache sets on sites with 10000's of unattached attachments as get_children puts every post in the cache. - // TODO Fix this properly + } elseif ( 0 === $atts['id'] ) { + /* + * Should NEVER Happen but infinite_scroll_load_other_plugins_scripts means it does + * Querying with post_parent == 0 can generate stupidly memcache sets + * on sites with 10000's of unattached attachments as get_children puts every post in the cache. + * TODO Fix this properly. + */ $attachments = array(); - } elseif ( ! empty( $exclude ) ) { - $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); + } elseif ( ! empty( $atts['exclude'] ) ) { + $exclude = preg_replace( '/[^0-9,]+/', '', $atts['exclude'] ); $attachments = get_children( array( - 'post_parent' => $id, + 'post_parent' => $atts['id'], 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', - 'order' => $order, - 'orderby' => $orderby, + 'order' => $atts['order'], + 'orderby' => $atts['orderby'], 'suppress_filters' => false, ) ); } else { $attachments = get_children( array( - 'post_parent' => $id, + 'post_parent' => $atts['id'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', - 'order' => $order, - 'orderby' => $orderby, + 'order' => $atts['order'], + 'orderby' => $atts['orderby'], 'suppress_filters' => false, ) ); @@ -134,7 +137,7 @@ class Jetpack_Tiled_Gallery { '_inc/build/tiled-gallery/tiled-gallery/tiled-gallery.min.js', 'modules/tiled-gallery/tiled-gallery/tiled-gallery.js' ), - array( 'jquery' ) + array() ); wp_enqueue_style( 'tiled-gallery', plugins_url( 'tiled-gallery/tiled-gallery.css', __FILE__ ), array(), '2012-09-21' ); wp_style_add_data( 'tiled-gallery', 'rtl', 'replace' ); @@ -184,7 +187,7 @@ class Jetpack_Tiled_Gallery { if ( $gallery_html && class_exists( 'Jetpack' ) && class_exists( 'Jetpack_Photon' ) ) { // Tiled Galleries in Jetpack require that Photon be active. // If it's not active, run it just on the gallery output. - if ( ! in_array( 'photon', Jetpack::get_active_modules() ) && ! ( new Status() )->is_development_mode() ) { + if ( ! in_array( 'photon', Jetpack::get_active_modules(), true ) && ! ( new Status() )->is_offline_mode() ) { $gallery_html = Jetpack_Photon::filter_the_content( $gallery_html ); } } |