Making WordPress.org

Changeset 11457


Ignore:
Timestamp:
01/20/2022 03:29:37 AM (3 years ago)
Author:
dd32
Message:

Translate: Some of the meta/wordpress-org strings exist within a different repo.

See https://github.com/WordPress/wporg-mu-plugins/issues/46
See r18321-dotorg.

File:
1 edited

Legend:

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

    r11456 r11457  
    337337
    338338/**
     339 * Update the URL reference for wordpress-org wporg-mu-plugin file locations.
     340 *
     341 * @param string $source_url
     342 * @param \GP_Project $project
     343 * @param string $file
     344 * @param string $line
     345 *
     346 * @return Source URL.
     347 */
     348function wporg_references_wordpress_org_github( $source_url, $project, $file, $line ) {
     349    if (
     350        'meta/wordpress-org' === $project->path &&
     351        str_starts_with( $file, 'mu-plugins/' ) &&
     352        ! str_starts_with( $file, 'mu-plugins/pub/' )
     353    ) {
     354        $source_url = "https://github.com/WordPress/wporg-mu-plugins/blob/trunk/{$file}#L{$line}";
     355    }
     356
     357    return $source_url;
     358}
     359add_filter( 'gp_reference_source_url', 'wporg_references_wordpress_org_github', 10, 4 );
     360
     361/**
    339362 * Whether to show the context or not.
    340363 *
Note: See TracChangeset for help on using the changeset viewer.