Making WordPress.org

Ticket #2398: meta-2398.patch

File meta-2398.patch, 1.8 KB (added by SergeyBiryukov, 9 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

     
    4242        }
    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.
    5049         * @param int   $post_id Topic or reply ID.
     
    5150         * @return array Filtered 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'] );
    5558
     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                }
     78
    5679                return $r;
    5780        }
    5881