Making WordPress.org


Ignore:
Timestamp:
03/03/2017 07:10:34 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Use home_url() instead of hardcoded URLs in theme and plugin forums.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php

    r4936 r5061  
    116116                    $notice = _x( 'This is your review of %1$s, you can <a href="%2$s">edit your review</a> at any time.', 'plugin', 'wporg-forums' );
    117117                    $object_link = sprintf( '<a href="//wordpress.org/plugins/%s/">%s</a>', esc_attr( $this->slug ), esc_html( $this->object->post_title ) );
    118                     $edit_url = sprintf( '//wordpress.org/support/plugin/%s/reviews/#new-post', esc_attr( $this->slug ) );
     118                    $edit_url = sprintf( home_url( '/plugin/%s/reviews/#new-post' ), esc_attr( $this->slug ) );
    119119                    break;
    120120                case 'theme' :
     
    122122                    $notice = _x( 'This is your review of %1$s, you can <a href="%2$s">edit your review</a> at any time.', 'theme', 'wporg-forums' );
    123123                    $object_link = sprintf( '<a href="//wordpress.org/themes/%s/">%s</a>', esc_attr( $this->slug ), esc_html( $this->object->post_title ) );
    124                     $edit_url = sprintf( '//wordpress.org/support/theme/%s/reviews/#new-post', esc_attr( $this->slug ) );
     124                    $edit_url = sprintf( home_url( '/theme/%s/reviews/#new-post' ), esc_attr( $this->slug ) );
    125125                    break;
    126126            }
     
    201201                ?>
    202202                <div class="counter-container">
    203                 <a href="<?php echo esc_url( sprintf( 'https://wordpress.org/support/%s/%s/reviews/?filter=%s', $this->compat, $this->slug, $rating ) ); ?>"
     203                <a href="<?php echo esc_url( sprintf( home_url( '/%s/%s/reviews/?filter=%s' ), $this->compat, $this->slug, $rating ) ); ?>"
    204204                    title="<?php echo esc_attr( $stars_title ); ?>">
    205205                    <span class="counter-label" style="float:left;margin-right:5px;min-width:58px;"><?php echo esc_html( $stars_text ); ?></span>
     
    242242                    add_query_arg(
    243243                        'redirect_to',
    244                         urlencode( esc_url_raw( sprintf( 'https://wordpress.org/support/%s/%s/reviews/', $this->compat, $this->slug ) ) ),
     244                        urlencode( esc_url_raw( sprintf( home_url( '/%s/%s/reviews/' ), $this->compat, $this->slug ) ) ),
    245245                        'https://login.wordpress.org/'
    246246                    )
     
    269269                /* translators: %s: plugin/theme reviews URL */
    270270                __( '<a href="%s">Click here</a> to see all reviews.', 'wporg-forums' ),
    271                 esc_url( sprintf( '//wordpress.org/support/%s/%s/reviews/', $this->compat, $this->slug ) )
     271                esc_url( sprintf( home_url( '/%s/%s/reviews/' ), $this->compat, $this->slug ) )
    272272            );
    273273            echo "</p>\n";
     
    332332                add_query_arg(
    333333                    'redirect_to',
    334                     urlencode( esc_url_raw( sprintf( 'https://wordpress.org/support/%s/%s/reviews/', $this->compat, $this->slug ) ) ),
     334                    urlencode( esc_url_raw( sprintf( home_url( '/%s/%s/reviews/' ), $this->compat, $this->slug ) ) ),
    335335                    'https://login.wordpress.org/'
    336336                )
     
    381381        <p><?php _e( 'When posting a review, follow these guidelines:', 'wporg-forums' ); ?></p>
    382382        <ul>
    383             <li><?php printf( $report, esc_url( sprintf( 'https://wordpress.org/support/%s/%s/', $this->compat, $this->slug ) ) ); ?></li>
     383            <li><?php printf( $report, esc_url( sprintf( home_url( '/%s/%s/' ), $this->compat, $this->slug ) ) ); ?></li>
    384384            <li><?php echo esc_html( $rate ); ?></li>
    385385            <li><?php esc_html_e( 'Please provide as much detail as you can to justify your rating and to help others.', 'wporg-forums' ); ?></li>
Note: See TracChangeset for help on using the changeset viewer.