Making WordPress.org

Changeset 4922


Ignore:
Timestamp:
02/18/2017 11:22:10 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Use Ratings_Compat::review_exists() to set the text for "Add Review" or "Edit Review" link in plugin/theme sidebar.

This ensures the correct link text in case the previous review was archived.

See #2199.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
Files:
2 edited

Legend:

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

    r4918 r4922  
    106106        $create_label = '';
    107107        if ( isset( $this->ratings ) && $this->ratings->is_rating_view() && bbp_current_user_can_access_create_topic_form() ) {
    108             $create_label = \WPORG_Ratings::get_user_rating( 'plugin', $this->slug(), get_current_user_id() ) ?
     108            $create_label = $this->ratings->review_exists() ?
    109109                __( 'Edit Review', 'wporg-forums' ) :
    110110                __( 'Add Review', 'wporg-forums' );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-theme-directory-compat.php

    r4918 r4922  
    101101        $create_label = '';
    102102        if ( isset( $this->ratings ) && $this->ratings->is_rating_view() && bbp_current_user_can_access_create_topic_form() ) {
    103             $create_label = \WPORG_Ratings::get_user_rating( 'theme', $this->slug(), get_current_user_id() ) ?
     103            $create_label = $this->ratings->review_exists() ?
    104104                __( 'Edit Review', 'wporg-forums' ) :
    105105                __( 'Add Review', 'wporg-forums' );
Note: See TracChangeset for help on using the changeset viewer.