Making WordPress.org


Ignore:
Timestamp:
04/14/2025 12:42:12 AM (12 months ago)
Author:
dd32
Message:

Translate: Link to the correct location for some Rosetta strings, and don't link to private files.

Fixes #7950.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php

    r12511 r14419  
    368368            $source_url = "https://github.com/WordPress/wporg-gutenberg/blob/trunk/{$file}#L{$line}";
    369369        }
     370
     371    } elseif ( 'meta/rosetta' === $project->path ) {
     372
     373        // For Rosetta plugins, they're stored in the WordPress.org svn path.
     374        if ( str_starts_with( $file, 'plugins/' ) && str_contains( $source_url, 'meta.trac.wordpress.org' ) ) {
     375            $source_url = str_replace( '/global.wordpress.org/', '/wordpress.org/', $source_url );
     376
     377        // Not all Rosetta mu-plugins are public, don't attempt to link to them.
     378        } elseif(
     379            str_starts_with( $file, 'mu-plugins/' ) &&
     380            ! (
     381                str_starts_with( $file, 'mu-plugins/downloads/' ) ||
     382                str_starts_with( $file, 'mu-plugins/roles/' ) ||
     383                str_starts_with( $file, 'mu-plugins/showcase/' )
     384            )
     385        ) {
     386            $source_url = false;
     387        }
    370388    }
    371389
Note: See TracChangeset for help on using the changeset viewer.