Making WordPress.org

Changeset 6453


Ignore:
Timestamp:
01/28/2018 05:49:47 PM (9 years ago)
Author:
ocean90
Message:

Rosetta Roles: Link project names to their page on translate.wordpress.org.

Fixes #3228.

Location:
sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/class-translation-editors-list-table.php

    r3951 r6453  
    344344                                                /* translators: 1: Parent project name, 2: Child project name */
    345345                                                __( '%1$s →  %2$s', 'rosetta' ),
    346                                                 esc_html( $parent->name ),
    347                                                 esc_html( $this->projects[ $project_id ]->name )
     346                                                $parent->name,
     347                                                $this->projects[ $project_id ]->name
    348348                                        );
    349349                                } else {
    350                                         $name = esc_html( $this->projects[ $project_id ]->name );
     350                                        $name = $this->projects[ $project_id ]->name;
    351351                                }
     352
     353                                $name = sprintf(
     354                                        '<a href="%s">%s</a>',
     355                                        esc_url( 'https://translate.wordpress.org/projects/' . $this->projects[ $project_id ]->path ),
     356                                        esc_html( $name )
     357                                );
     358
    352359                                $projects[] = $name;
    353360                        }
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php

    r5048 r6453  
    570570        public function ajax_rosetta_get_projects() {
    571571                $projects = $this->get_translate_projects();
     572                array_walk( $projects, function( $value ) {
     573                        unset( $value->path ); // Path is not needed.
     574                } );
    572575                $project_tree = $this->get_project_tree( $projects, 0, 1 );
    573576
    … …  
    699702
    700703                $_projects = $wpdb->get_results( '
    701                         SELECT id, name, parent_project_id, slug
     704                        SELECT id, name, parent_project_id, slug, path
    702705                        FROM translate_projects
    703706                        WHERE
Note: See TracChangeset for help on using the changeset viewer.