Changeset 4129
- Timestamp:
- 09/25/2016 07:23:22 PM (8 years ago)
- 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 28 28 add_filter( 'bbp_register_view_no_replies', array( $this, 'exclude_compat_forums' ) ); 29 29 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' ) ); 30 34 } 31 35 … … 176 180 $r['post_parent__not_in'] = array( Plugin::THEMES_FORUM_ID, Plugin::PLUGINS_FORUM_ID, Plugin::REVIEWS_FORUM_ID ); 177 181 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 } 178 199 } 179 200
Note: See TracChangeset
for help on using the changeset viewer.