Changeset 11668
- Timestamp:
- 03/11/2022 09:41:43 PM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-components.php
r11373 r11668 6 6 const POST_TYPE_NAME = 'component'; 7 7 8 protected $trac; 9 10 protected $tracs_supported = array( 'core', 'meta' ); 11 8 12 function __construct( $api ) { 9 $this->api = $api; 13 $make_site = explode( '/', home_url( '' ) ); 14 $trac = $make_site[3]; 15 if ( $make_site[2] !== 'make.wordpress.org' || ! in_array( $trac, $this->tracs_supported ) ) { 16 return; 17 } 18 19 $this->trac = $trac; 20 $this->api = $api; 21 10 22 add_action( 'init', array( $this, 'init' ) ); 11 23 add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) ); … … 20 32 add_filter( 'wp_nav_menu_objects', array( $this, 'highlight_menu_component_link' ) ); 21 33 add_filter( 'map_meta_cap', [ $this, 'map_meta_cap' ], 10, 4 ); 34 } 35 36 function trac_url() { 37 return 'https://' . $this->trac . '.trac.wordpress.org'; 38 } 39 40 function trac_name() { 41 return ucfirst( $this->trac ); 22 42 } 23 43 … … 342 362 ) ); 343 363 if ( $recent_posts->have_posts() ) { 344 echo "<h3>Recent posts on the make/ coreblog</h3>\n<ul>";364 echo "<h3>Recent posts on the make/{$this->trac} blog</h3>\n<ul>"; 345 365 while ( $recent_posts->have_posts() ) { 346 366 $recent_posts->the_post(); … … 404 424 } 405 425 406 echo "\n" . "Many contributors help maintain one or more components. These maintainers are vital to keeping WordPress development running as smoothly as possible. They triage new tickets, look after existing ones, spearhead or mentor tasks, pitch new ideas, curate roadmaps, and provide feedback to other contributors. Longtime maintainers with a deep understanding of particular areas of coreare always seeking to mentor others to impart their knowledge.\n\n";407 echo "<strong>Want to help? Start following this component!</strong> <a href='/ core/notifications/'>Adjust your notifications here</a>. Feel free to dig into any ticket." . "\n\n";426 echo "\n" . "Many contributors help maintain one or more components. These maintainers are vital to keeping WordPress development running as smoothly as possible. They triage new tickets, look after existing ones, spearhead or mentor tasks, pitch new ideas, curate roadmaps, and provide feedback to other contributors. Longtime maintainers with a deep understanding of particular areas of {$this->trac_name()} are always seeking to mentor others to impart their knowledge.\n\n"; 427 echo "<strong>Want to help? Start following this component!</strong> <a href='/{$this->trac}/notifications/'>Adjust your notifications here</a>. Feel free to dig into any ticket." . "\n\n"; 408 428 409 429 $followers = $this->api->get_component_followers( $post->post_title ); … … 479 499 480 500 if ( is_singular() ) { 481 echo '<div><a class="create-new-ticket button button-large button-primary" href="https://login.wordpress.org/?redirect_to=' . urlencode( 'https://core.trac.wordpress.org/newticket?component=' . urlencode( $component ) ) . '" rel="nofollow">Create a new ticket</a></div>';501 echo '<div><a class="create-new-ticket button button-large button-primary" href="https://login.wordpress.org/?redirect_to=' . urlencode( $this->trac_url() . '/newticket?component=' . urlencode( $component ) ) . '" rel="nofollow">Create a new ticket</a></div>'; 482 502 } 483 503 … … 596 616 $args['status'] = '!closed'; 597 617 } 598 return add_query_arg( $args, 'https://core.trac.wordpress.org/query' );618 return add_query_arg( $args, $this->trac_url() . '/query' ); 599 619 } 600 620 … … 603 623 foreach ( $tickets as $ticket ) { 604 624 $ticket = (object) $ticket; 605 echo '<li><a href=" https://core.trac.wordpress.org/ticket/' . $ticket->id . '">#' . $ticket->id . '</a> ' . esc_html( $ticket->summary );625 echo '<li><a href="' . $this->trac_url() . '/ticket/' . $ticket->id . '">#' . $ticket->id . '</a> ' . esc_html( $ticket->summary ); 606 626 if ( ! empty( $ticket->focuses ) ) { 607 627 echo ' <span class="focus">' . implode( '</span> <span class="focus">', explode( ', ', esc_html( $ticket->focuses ) ) ) . '</span>'; … … 625 645 $both = in_array( 'focus', $topics ) && in_array( 'component', $topics ); 626 646 627 echo '<select class="tickets-by-topic" data-location=" https://core.trac.wordpress.org/">';647 echo '<select class="tickets-by-topic" data-location="' . $this->trac_url() . '/">'; 628 648 if ( $both ) { 629 649 $default = 'Select a focus or component'; … … 691 711 $open_tickets = array_sum( $this->breakdown_component_type[ $component ] ); 692 712 } 693 echo '<td class="right"><a href=" https://core.trac.wordpress.org/component/' . esc_attr( rawurlencode( $component ) ) . '">' . $open_tickets . '</a></td>';713 echo '<td class="right"><a href="' . $this->trac_url() . '/component/' . esc_attr( rawurlencode( $component ) ) . '">' . $open_tickets . '</a></td>'; 694 714 if ( $history['change'] ) { 695 715 $count = sprintf( "%+d", $history['change'] ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php
r11374 r11668 30 30 $this->api = new Trac_Notifications_HTTP_Client( $this->trac_url() . '/wpapi', TRAC_NOTIFICATIONS_API_KEY ); 31 31 32 if ( 'core' === $trac ) {32 if ( 'core' === $trac || 'meta' === $trac ) { 33 33 require __DIR__ . '/trac-components.php'; 34 34 $this->components = new Make_Core_Trac_Components( $this->api ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/archive-component.php
r4819 r11668 4 4 */ 5 5 6 $trac_name = 'Core'; 7 if ( isset( $wporg_trac_notifications ) ) { 8 $trac_name = $wporg_trac_notifications->trac_name(); 9 } 6 10 ?> 7 11 <?php get_header(); ?> … … 9 13 <div id="primary" class="content-area"> 10 14 <div role="main"> 11 <h1> WordPress Core Components</h1>15 <h1><?php printf( 'WordPress %s Components', $trac_name ); ?></h1> 12 16 13 17 <?php
Note: See TracChangeset
for help on using the changeset viewer.