Making WordPress.org


Ignore:
Timestamp:
07/30/2019 09:11:33 AM (5 years ago)
Author:
dd32
Message:

Theme Directory: When a theme update older than two years is uploaded, do not auto-approve the Trac ticket.

Previously the Theme Directory was incorrectly applying the 2 year cutoff to the query that the Trac Sync uses, seemingly by accident as as it was coded all updates should've been auto-approved.

Now theme updates older than two years will not have their Trac ticket auto-closed as live, and theme reviewers can review the open theme update tickets, mark as live on Trac, and have the Trac sync mark the version as live in WordPress.

See #4634.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/query-modifications.php

    r2920 r9086  
    108108    }
    109109
    110     // Unless a specific theme, or author is being requested, limit results to the last 2 years.
    111     if ( empty( $query->query_vars['name'] ) && empty( $query->query_vars['author_name'] ) && ! in_array( $query->query_vars['browse'], array( 'favorites', 'new', 'updated' ) ) ) {
     110    // Unless a specific theme/author is being requested, or it's an internal query, limit results to the last 2 years.
     111    if (
     112        empty( $query->query_vars['name'] ) &&
     113        empty( $query->query_vars['author_name'] ) &&
     114        ! in_array( $query->query_vars['browse'], array( 'favorites', 'new', 'updated' ) ) &&
     115        empty( $query->query_vars['meta_query']['trac_sync_ticket_id'] ) // jobs/class-trac-sync.php - Always needs to find the post, and looks up via a meta search.
     116    ) {
    112117        $query->query_vars['date_query']['recent_themes_only'] = array(
    113118            'column' => 'post_modified',
     
    117122
    118123    // Prioritize translated themes for localized requests, except when viewing a specific ordered themes.
    119     if ( 'en_US' !== get_locale() && ! in_array( $query->query_vars['browse'], array( 'favorites', 'new', 'updated' ) )  ) {
     124    if (
     125        'en_US' !== get_locale() &&
     126        ! in_array( $query->query_vars['browse'], array( 'favorites', 'new', 'updated' ) )
     127    ) {
    120128        add_filter( 'posts_clauses', 'wporg_themes_prioritize_translated_posts_clauses' );
    121129    }
Note: See TracChangeset for help on using the changeset viewer.