Making WordPress.org

Changeset 4129


Ignore:
Timestamp:
09/25/2016 07:23:22 PM (8 years ago)
Author:
jmdodd
Message:

Support Forums: Remove context search from editor link modal.

This frequently times out and needs improvement before it will work with the support forums.

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

Legend:

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

    r4023 r4129  
    2828        add_filter( 'bbp_register_view_no_replies', array( $this, 'exclude_compat_forums' ) );
    2929        add_filter( 'bbp_register_view_all_topics', array( $this, 'exclude_compat_forums' ) );
     30
     31        // Editor.
     32        add_action( 'wp_ajax_wp-link-ajax', array( $this, 'disable_wp_link_ajax' ), -1 );
     33        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
    3034    }
    3135
     
    176180        $r['post_parent__not_in'] = array( Plugin::THEMES_FORUM_ID, Plugin::PLUGINS_FORUM_ID, Plugin::REVIEWS_FORUM_ID );
    177181        return $r;
     182    }
     183
     184    /**
     185     * Replace link AJAX with a short-circuited version.
     186     * @todo Replace link with a custom modal to avoid AJAX call entirely.
     187     */
     188    public function disable_wp_link_ajax() {
     189        if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
     190            remove_action( 'wp_ajax_wp-link-ajax', 'wp_ajax_wp_link_ajax', 1 );
     191            add_action( 'wp_ajax_wp-link-ajax', '__return_zero', 1 );
     192        }
     193    }
     194
     195    public function enqueue_styles() {
     196        if ( current_user_can( 'participate' ) ) {
     197            wp_enqueue_style( 'support-forums-participants', plugins_url( 'css/styles-participants.css', __DIR__ ) );
     198        }
    178199    }
    179200
Note: See TracChangeset for help on using the changeset viewer.