Making WordPress.org


Ignore:
Timestamp:
01/18/2017 07:20:06 PM (8 years ago)
Author:
coffee2code
Message:

Support Forums: For plugin/theme support forum sidebars, add link to "Create Topic", "Add Review", or "Edit Review" based on context.

Adds an above-the-fold link that leads to the down-page form (which is otherwise only discoverable by scrolling).

Fixes #169.
See #1977.

File:
1 edited

Legend:

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

    r4553 r4721  
    9999        $active  = sprintf( '<a href="//wordpress.org/support/plugin/%s/active">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) );
    100100        $reviews = sprintf( '<a href="//wordpress.org/support/plugin/%s/reviews/">Reviews</a>', esc_attr( $this->slug() ) );
     101        $create  = '';
     102
     103        $create_label = '';
     104        if ( $this->ratings && $this->ratings->is_rating_view() && bbp_current_user_can_access_create_reply_form() ) {
     105            $create_label = \WPORG_Ratings::get_user_rating( 'plugin', $this->slug(), get_current_user_id() ) ?
     106                __( 'Edit Review', 'wporg-forums' ) :
     107                __( 'Add Review', 'wporg-forums' );
     108        } else {
     109            $create_label = __( 'Create Topic', 'wporg-forums' );
     110        }
     111        if ( $create_label ) {
     112            $create = sprintf( '<a href="#new-post">%s</a>', $create_label );
     113        }
    101114        ?>
     115
    102116        <div>
    103117            <h3>About this Plugin</h3>
     
    111125                <li><?php echo $active; ?></li>
    112126                <li><?php echo $reviews; ?></li>
     127                <li class="create-topic"><?php echo $create; ?></li>
    113128            </ul>
    114129        </div>
Note: See TracChangeset for help on using the changeset viewer.