Making WordPress.org


Ignore:
Timestamp:
02/29/2024 11:54:42 PM (22 months ago)
Author:
coffee2code
Message:

Photo Directory: Display notice atop single photo pages that were loaded as a result of being randomly shown.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-photos/template-parts/photo-single.php

    r12864 r13257  
    99
    1010namespace WordPressdotorg\Photo_Directory\Theme;
     11use WordPressdotorg\Photo_Directory\Random;
    1112use WordPressdotorg\Photo_Directory\Template_Tags;
    1213
     
    1617<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1718    <header class="entry-header">
     19        <?php if ( Random::was_photo_random() ) : ?>
     20            <div class="randomly-chosen-photo"><?php
     21                printf(
     22                    /* translators: %s: Link to load another random photo. */
     23                    __( 'This photo was randomly chosen. %s', 'wporg-photos' ),
     24                    sprintf(
     25                        '<a href="%s">' . __( 'Load another random photo?', 'wporg-photos' ) . '</a>',
     26                        home_url( '/' . Random::PATH . '/' )
     27                    )
     28                );
     29            ?></div>
     30        <?php endif; ?>
    1831        <?php printf(
    1932            '<a href="%s" class="photo-author">%s</a>',
Note: See TracChangeset for help on using the changeset viewer.