Plugin Directory

Changeset 3738613


Ignore:
Timestamp:
10/10/2026 07:52:06 PM (6 weeks ago)
Author:
tobylloyd
Message:

Release 1.1.4: show album photos with Polylang media translation, site date format

Location:
lloyd-gallery
Files:
4 added
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • lloyd-gallery/tags/1.1.4/includes/class-lloyga-admin-pages.php

    r3716027 r3738613  
    487487                                        echo esc_html( sprintf( _n( '%d photo', '%d photos', $count, 'lloyd-gallery' ), $count ) );
    488488                                        ?>
    489                                         &middot; <?php echo esc_html( get_the_date( 'j M Y', $album ) ); ?>
     489                                        &middot; <?php echo esc_html( get_the_date( '', $album ) ); ?>
    490490                                </span>
    491491                        </a>
  • lloyd-gallery/tags/1.1.4/includes/class-lloyga-frontend.php

    r3716043 r3738613  
    233233                }
    234234
    235                 $date = '<p class="lg-event-date">' . esc_html( get_the_date( 'j F Y', $current ) ) . '</p>';
     235                // No format of our own: the site's date format (Settings > General)
     236                // decides the order of day, month and year, and WordPress translates
     237                // the month name, so the date reads naturally in any language. The
     238                // album cards and the admin album list follow the same rule.
     239                $date = '<p class="lg-event-date">' . esc_html( get_the_date( '', $current ) ) . '</p>';
    236240
    237241                // WordPress has already decided this visitor may see this album by
    … …  
    342346                                </span>
    343347                                <span class="lg-album-card-title"><?php echo esc_html( get_the_title( $album ) ); ?></span>
    344                                 <span class="lg-album-card-date"><?php echo esc_html( get_the_date( 'j F Y', $album ) ); ?></span>
     348                                <span class="lg-album-card-date"><?php echo esc_html( get_the_date( '', $album ) ); ?></span>
    345349                        </a>
    346350                </li>
    … …  
    430434                $lightbox_data = self::visitor_image( $photo->ID );
    431435                $lightbox_url  = $lightbox_data['url'];
    432                 $lightbox_w    = $lightbox_data['width'] ?: $width;
    433                 $lightbox_h    = $lightbox_data['height'] ?: $height;
     436                $lightbox_w    = $lightbox_data['width'] ? $lightbox_data['width'] : $width;
     437                $lightbox_h    = $lightbox_data['height'] ? $lightbox_data['height'] : $height;
    434438
    435439                $grid_sizes = array_filter( $breakpoints, static fn( $size ) => $size >= 768 );
  • lloyd-gallery/tags/1.1.4/includes/class-lloyga-photos.php

    r3716027 r3738613  
    221221                }
    222222
    223                 return get_posts(
     223                /**
     224                 * Filters the query that loads an album's photos.
     225                 *
     226                 * The IDs come from the album's own stored list, so the query is
     227                 * meant to return exactly those attachments. A plugin that filters
     228                 * attachment queries site-wide (by language, for example) would
     229                 * otherwise drop some of them from the album, so its integration
     230                 * can use this to keep the list whole. This plugin adds nothing here
     231                 * itself.
     232                 *
     233                 * @param array $query_args WP_Query arguments.
     234                 * @param int   $album_id   Album ID.
     235                 */
     236                $query_args = apply_filters(
     237                        'lloyga_album_photos_query_args',
    224238                        array(
    225239                                'post_type'      => 'attachment',
    … …  
    228242                                'orderby'        => 'post__in',
    229243                                'posts_per_page' => -1,
    230                         )
    231                 );
     244                        ),
     245                        $album_id
     246                );
     247
     248                return get_posts( $query_args );
    232249        }
    233250
  • lloyd-gallery/tags/1.1.4/includes/class-lloyga-rest.php

    r3716027 r3738613  
    11051105                // the photo is left in the Media Library for the client to delete
    11061106                // for good if they want the space back. (Its post_parent is left
    1107                 // alone too, so it won't necessarily show as "Unattached" there.)
     1107                // alone too, so it won't necessarily show as "Unattached" there).
    11081108                $result = LLOYGA_Photos::remove( $album_id, $photo_id );
    11091109                if ( is_wp_error( $result ) ) {
  • lloyd-gallery/tags/1.1.4/lloyd-gallery.php

    r3716043 r3738613  
    33 * Plugin Name:       Lloyd Gallery
    44 * Description:       Album-based photo galleries for clients who don't want to think about photo editing. Automatic orientation, compression and WebP conversion on upload.
    5  * Version:           1.1.3
     5 * Version:           1.1.4
    66 * Requires at least: 6.7
    77 * Requires PHP:      8.1
    … …  
    1919}
    2020
    21 define( 'LLOYGA_VERSION', '1.1.3' );
     21define( 'LLOYGA_VERSION', '1.1.4' );
    2222define( 'LLOYGA_PLUGIN_FILE', __FILE__ );
    2323define( 'LLOYGA_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    … …  
    5151
    5252/**
     53 * Loads the Polylang integration, and only when Polylang itself starts up.
     54 * `pll_init` is Polylang's own action, fired from `plugins_loaded` once
     55 * its API exists, so on a site without Polylang the file is never read.
     56 */
     57function lloyga_load_polylang(): void {
     58        require_once LLOYGA_PLUGIN_DIR . 'includes/integrations/class-lloyga-polylang.php';
     59        LLOYGA_Polylang::boot();
     60}
     61add_action( 'pll_init', 'lloyga_load_polylang' );
     62
     63/**
    5364 * Creates the gallery page, registers the post type against that page's
    5465 * actual path, creates the membership table and then flushes, so album
  • lloyd-gallery/tags/1.1.4/readme.txt

    r3716043 r3738613  
    55Tested up to: 7.1
    66Requires PHP: 8.1
    7 Stable tag: 1.1.3
     7Stable tag: 1.1.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    175175== Changelog ==
    176176
     177= 1.1.4 =
     178* Album photos now show on sites using Polylang with media translation switched on. Before, photos in another language, and every photo uploaded before Polylang was installed, were missing from album pages and the album screen.
     179* Album dates now use your site's own date format from Settings > General, so they read naturally in any language. Before, they were always shown as day, month, year.
     180
    177181= 1.1.3 =
    178182* Your galleries, album list and lightbox now always show visitors resized copies of your photos, never the original files, so the location data phones store in photos isn't shared.
    … …  
    253257== Upgrade Notice ==
    254258
     259= 1.1.4 =
     260Fixes missing album photos on sites that use Polylang's media translation. Album dates now follow your site's date format.
     261
    255262= 1.1.3 =
    256263Stops original photo files, which can contain location data, being shown to visitors. Recommended for everyone.
  • lloyd-gallery/trunk/includes/class-lloyga-admin-pages.php

    r3716027 r3738613  
    487487                                        echo esc_html( sprintf( _n( '%d photo', '%d photos', $count, 'lloyd-gallery' ), $count ) );
    488488                                        ?>
    489                                         &middot; <?php echo esc_html( get_the_date( 'j M Y', $album ) ); ?>
     489                                        &middot; <?php echo esc_html( get_the_date( '', $album ) ); ?>
    490490                                </span>
    491491                        </a>
  • lloyd-gallery/trunk/includes/class-lloyga-frontend.php

    r3716043 r3738613  
    233233                }
    234234
    235                 $date = '<p class="lg-event-date">' . esc_html( get_the_date( 'j F Y', $current ) ) . '</p>';
     235                // No format of our own: the site's date format (Settings > General)
     236                // decides the order of day, month and year, and WordPress translates
     237                // the month name, so the date reads naturally in any language. The
     238                // album cards and the admin album list follow the same rule.
     239                $date = '<p class="lg-event-date">' . esc_html( get_the_date( '', $current ) ) . '</p>';
    236240
    237241                // WordPress has already decided this visitor may see this album by
    … …  
    342346                                </span>
    343347                                <span class="lg-album-card-title"><?php echo esc_html( get_the_title( $album ) ); ?></span>
    344                                 <span class="lg-album-card-date"><?php echo esc_html( get_the_date( 'j F Y', $album ) ); ?></span>
     348                                <span class="lg-album-card-date"><?php echo esc_html( get_the_date( '', $album ) ); ?></span>
    345349                        </a>
    346350                </li>
    … …  
    430434                $lightbox_data = self::visitor_image( $photo->ID );
    431435                $lightbox_url  = $lightbox_data['url'];
    432                 $lightbox_w    = $lightbox_data['width'] ?: $width;
    433                 $lightbox_h    = $lightbox_data['height'] ?: $height;
     436                $lightbox_w    = $lightbox_data['width'] ? $lightbox_data['width'] : $width;
     437                $lightbox_h    = $lightbox_data['height'] ? $lightbox_data['height'] : $height;
    434438
    435439                $grid_sizes = array_filter( $breakpoints, static fn( $size ) => $size >= 768 );
  • lloyd-gallery/trunk/includes/class-lloyga-photos.php

    r3716027 r3738613  
    221221                }
    222222
    223                 return get_posts(
     223                /**
     224                 * Filters the query that loads an album's photos.
     225                 *
     226                 * The IDs come from the album's own stored list, so the query is
     227                 * meant to return exactly those attachments. A plugin that filters
     228                 * attachment queries site-wide (by language, for example) would
     229                 * otherwise drop some of them from the album, so its integration
     230                 * can use this to keep the list whole. This plugin adds nothing here
     231                 * itself.
     232                 *
     233                 * @param array $query_args WP_Query arguments.
     234                 * @param int   $album_id   Album ID.
     235                 */
     236                $query_args = apply_filters(
     237                        'lloyga_album_photos_query_args',
    224238                        array(
    225239                                'post_type'      => 'attachment',
    … …  
    228242                                'orderby'        => 'post__in',
    229243                                'posts_per_page' => -1,
    230                         )
    231                 );
     244                        ),
     245                        $album_id
     246                );
     247
     248                return get_posts( $query_args );
    232249        }
    233250
  • lloyd-gallery/trunk/includes/class-lloyga-rest.php

    r3716027 r3738613  
    11051105                // the photo is left in the Media Library for the client to delete
    11061106                // for good if they want the space back. (Its post_parent is left
    1107                 // alone too, so it won't necessarily show as "Unattached" there.)
     1107                // alone too, so it won't necessarily show as "Unattached" there).
    11081108                $result = LLOYGA_Photos::remove( $album_id, $photo_id );
    11091109                if ( is_wp_error( $result ) ) {
  • lloyd-gallery/trunk/lloyd-gallery.php

    r3716043 r3738613  
    33 * Plugin Name:       Lloyd Gallery
    44 * Description:       Album-based photo galleries for clients who don't want to think about photo editing. Automatic orientation, compression and WebP conversion on upload.
    5  * Version:           1.1.3
     5 * Version:           1.1.4
    66 * Requires at least: 6.7
    77 * Requires PHP:      8.1
    … …  
    1919}
    2020
    21 define( 'LLOYGA_VERSION', '1.1.3' );
     21define( 'LLOYGA_VERSION', '1.1.4' );
    2222define( 'LLOYGA_PLUGIN_FILE', __FILE__ );
    2323define( 'LLOYGA_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    … …  
    5151
    5252/**
     53 * Loads the Polylang integration, and only when Polylang itself starts up.
     54 * `pll_init` is Polylang's own action, fired from `plugins_loaded` once
     55 * its API exists, so on a site without Polylang the file is never read.
     56 */
     57function lloyga_load_polylang(): void {
     58        require_once LLOYGA_PLUGIN_DIR . 'includes/integrations/class-lloyga-polylang.php';
     59        LLOYGA_Polylang::boot();
     60}
     61add_action( 'pll_init', 'lloyga_load_polylang' );
     62
     63/**
    5364 * Creates the gallery page, registers the post type against that page's
    5465 * actual path, creates the membership table and then flushes, so album
  • lloyd-gallery/trunk/readme.txt

    r3716043 r3738613  
    55Tested up to: 7.1
    66Requires PHP: 8.1
    7 Stable tag: 1.1.3
     7Stable tag: 1.1.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    175175== Changelog ==
    176176
     177= 1.1.4 =
     178* Album photos now show on sites using Polylang with media translation switched on. Before, photos in another language, and every photo uploaded before Polylang was installed, were missing from album pages and the album screen.
     179* Album dates now use your site's own date format from Settings > General, so they read naturally in any language. Before, they were always shown as day, month, year.
     180
    177181= 1.1.3 =
    178182* Your galleries, album list and lightbox now always show visitors resized copies of your photos, never the original files, so the location data phones store in photos isn't shared.
    … …  
    253257== Upgrade Notice ==
    254258
     259= 1.1.4 =
     260Fixes missing album photos on sites that use Polylang's media translation. Album dates now follow your site's date format.
     261
    255262= 1.1.3 =
    256263Stops original photo files, which can contain location data, being shown to visitors. Recommended for everyone.
Note: See TracChangeset for help on using the changeset viewer.