Making WordPress.org

Changeset 14957


Ignore:
Timestamp:
06/11/2026 08:35:32 AM (2 months ago)
Author:
yani.iliev
Message:

Profiles: Link the handbook page from handbook-update activity items.

The activity notifier already sends the page title and permalink on handbook updates, but the handler's digest path discarded them. While a digest holds a single update, link the page itself: "Updated the handbook page [title] on [site]". Multiple same-day updates still collapse to the existing "Made N updates" summary. The singular string is percent-escaped because digest_bump() passes it back through sprintf().

Props dd32
Fixes #8228

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-activity-handler/wporg-profiles-activity-handler.php

    r14821 r14957  
    846846                                $primary_link = sanitize_url( $data['blog_url'] ); // To group digest entries by site.
    847847
    848                                 $singular = sprintf(
    849                                         'Updated a handbook page on <a href="%s">%s</a>.',
    850                                         sanitize_url( $data['blog_url'] ),
    851                                         sanitize_text_field( $data['blog'] )
    852                                 );
     848                                if ( ! empty( $data['url'] ) && ! empty( $data['title'] ) ) {
     849                                        // Link the page itself while the digest holds a single update (#8228).
     850                                        $singular = sprintf(
     851                                                'Updated the handbook page <i><a href="%s">%s</a></i> on <a href="%s">%s</a>.',
     852                                                esc_url( $data['url'] ),
     853                                                sanitize_text_field( $data['title'] ),
     854                                                sanitize_url( $data['blog_url'] ),
     855                                                sanitize_text_field( $data['blog'] )
     856                                        );
     857                                        // `digest_bump()` runs this through sprintf(); escape literal
     858                                        // percent signs from encoded URLs or titles.
     859                                        $singular = str_replace( '%', '%%', $singular );
     860                                } else {
     861                                        $singular = sprintf(
     862                                                'Updated a handbook page on <a href="%s">%s</a>.',
     863                                                sanitize_url( $data['blog_url'] ),
     864                                                sanitize_text_field( $data['blog'] )
     865                                        );
     866                                }
    853867
    854868                                $plural = sprintf(
Note: See TracChangeset for help on using the changeset viewer.