Making WordPress.org


Ignore:
Timestamp:
02/21/2017 05:23:13 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Reduce the list of inline topic admin links to Edit, Close, Spam, Unapprove, Archive:

  • This helps to avoid visual clutter and provide enough room for translations.
  • Less commonly used actions (Merge, Stick) are still available via "Topic Admin" sidebar section.
  • Reply link is removed completely, as it's redundant since [4720] introduced a sidebar link for the same purpose.

Fixes #2398.

File:
1 edited

Legend:

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

    r4970 r4974  
    4343
    4444    /**
    45      * Remove "Trash" from admin links. Trashing a topic or reply will eventually
    46      * permanently delete it when the trash is emptied. Better to mark it as
    47      * pending or spam.
     45     * Remove some unneeded or redundant admin links for topics and replies,
     46     * move less commonly used inline quick links to 'Topic Admin' sidebar section.
    4847     *
    4948     * @param array $r       Admin links array.
     
    5251     */
    5352    public function admin_links( $r, $post_id ) {
     53        /*
     54         * Remove 'Trash' from admin links. Trashing a topic or reply will eventually
     55         * permanently delete it when the trash is emptied. Better to mark it as pending or spam.
     56         */
    5457        unset( $r['trash'] );
     58
     59        /*
     60         * Remove 'Reply' link. The theme adds its own 'Reply to Topic' sidebar link
     61         * for quick access to reply form, making the default inline link redundant.
     62         */
     63        unset( $r['reply'] );
     64
     65        /*
     66         * The following actions are removed from inline quick links as less commonly used,
     67         * but are still available via 'Topic Admin' sidebar section.
     68         */
     69        if ( ! did_action( 'wporg_compat_single_topic_sidebar_pre' ) ) {
     70            // Remove 'Merge' link.
     71            unset( $r['merge'] );
     72
     73            // Remove 'Stick' link for moderators, but keep it for plugin/theme authors and contributors.
     74            if ( current_user_can( 'moderate', $post_id ) ) {
     75                unset( $r['stick'] );
     76            }
     77        }
    5578
    5679        return $r;
Note: See TracChangeset for help on using the changeset viewer.