Skip to content

Commit

Permalink
Use Urls class
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Apr 24, 2024
1 parent 2bdf8ca commit 75d72aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions templates/event-translations-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/* translators: %s: Event title. */
gp_title( sprintf( __( 'Translation Events - %s' ), esc_html( $event->title() ) ) );
gp_breadcrumb_translation_events( array( '<a href="' . esc_attr( gp_url( wp_make_link_relative( get_the_permalink( $event->id() ) ) ) ) . '">' . esc_html( $event->title() ) . '</a>', __( 'Translations', 'glotpress' ), $locale->english_name ) );
gp_breadcrumb_translation_events( array( '<a href="' . esc_url( Urls::event_details( $event->id() ) ) . '">' . esc_html( $event->title() ) . '</a>', __( 'Translations', 'glotpress' ), $locale->english_name ) );
gp_enqueue_scripts( array( 'gp-editor', 'gp-translations-page' ) );
wp_localize_script(
'gp-translations-page',
Expand Down Expand Up @@ -52,11 +52,11 @@
<?php
if ( trim( $status, '/' ) !== 'waiting' ) {
?>
<a href="<?php echo esc_url( gp_url_join( gp_url(), wp_make_link_relative( get_the_permalink( $event->id() ) ), $locale->slug, 'waiting' ) ); ?>"><?php esc_html_e( 'Show only waiting translations', 'glotpress' ); ?></a>
<a href="<?php echo esc_url( Urls::event_translations( $event->id(), $locale->slug, 'waiting' ) ); ?>"><?php esc_html_e( 'Show only waiting translations', 'glotpress' ); ?></a>
<?php
} else {
?>
<a href="<?php echo esc_url( gp_url_join( gp_url(), wp_make_link_relative( get_the_permalink( $event->id() ) ), $locale->slug ) ); ?>"><?php esc_html_e( 'Show all contributed translations', 'glotpress' ); ?></a>
<a href="<?php echo esc_url( Urls::event_translations( $event->id(), $locale->slug ) ); ?>"><?php esc_html_e( 'Show all contributed translations', 'glotpress' ); ?></a>
<?php
}
?>
Expand Down
4 changes: 2 additions & 2 deletions templates/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
<?php foreach ( $event_stats->rows() as $_locale => $row ) : ?>
<tr>
<td title="<?php echo esc_html( $_locale ); ?> "><a href="<?php echo esc_url( gp_url_join( gp_url( '/languages' ), $row->language->slug ) ); ?>"><?php echo esc_html( $row->language->english_name ); ?></a></td>
<td><a href="<?php echo esc_url( wp_make_link_relative( gp_url_join( get_the_permalink( $event_id ), 'translations', $row->language->slug ) ) ); ?>"><?php echo esc_html( $row->created ); ?></a></td>
<td><a href="<?php echo esc_url( wp_make_link_relative( gp_url_join( get_the_permalink( $event_id ), 'translations', $row->language->slug, 'waiting' ) ) ); ?>"><?php echo esc_html( $row->waiting ); ?></a></td>
<td><a href="<?php echo esc_url( Urls::event_translations( $event->id(), $row->language->slug ) ); ?>"><?php echo esc_html( $row->created ); ?></a></td>
<td><a href="<?php echo esc_url( Urls::event_translations( $event->id(), $row->language->slug, 'waiting' ) ); ?>"><?php echo esc_html( $row->waiting ); ?></a></td>
<td><?php echo esc_html( $row->reviewed ); ?></td>
<td><?php echo esc_html( $row->users ); ?></td>
</tr>
Expand Down

0 comments on commit 75d72aa

Please sign in to comment.