Changeset 4549 for trunk/templates/default/bbpress-functions.php
- Timestamp:
- 12/06/2012 09:40:15 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/default/bbpress-functions.php
r4543 r4549 85 85 /** Scripts ***********************************************************/ 86 86 87 add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS 88 add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS 89 add_filter( 'bbp_enqueue_scripts', array( $this, 'localize_topic_script' ) ); // Enqueue theme script localization 90 add_action( 'bbp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head> 91 add_action( 'wp_ajax_dim-favorite', array( $this, 'ajax_favorite' ) ); // Handles the ajax favorite/unfavorite 92 add_action( 'wp_ajax_dim-subscription', array( $this, 'ajax_subscription' ) ); // Handles the ajax subscribe/unsubscribe 93 add_action( 'wp_ajax_nopriv_dim-favorite', array( $this, 'ajax_favorite' ) ); // Handles the ajax favorite/unfavorite 94 add_action( 'wp_ajax_nopriv_dim-subscription', array( $this, 'ajax_subscription' ) ); // Handles the ajax subscribe/unsubscribe 87 add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS 88 add_action( 'bbp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS 89 add_filter( 'bbp_enqueue_scripts', array( $this, 'localize_topic_script' ) ); // Enqueue theme script localization 90 add_action( 'bbp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head> 91 add_action( 'bbp_ajax_favorite', array( $this, 'ajax_favorite' ) ); // Handles the ajax favorite/unfavorite 92 add_action( 'bbp_ajax_subscription', array( $this, 'ajax_subscription' ) ); // Handles the ajax subscribe/unsubscribe 95 93 96 94 /** Template Wrappers *************************************************/ … … 179 177 // Topic favorite/subscribe 180 178 if ( bbp_is_single_topic() ) { 181 wp_enqueue_script( 'bbpress-topic', $this->url . 'js/topic.js', array( 'jquery' ), $this->version , true);179 wp_enqueue_script( 'bbpress-topic', $this->url . 'js/topic.js', array( 'jquery' ), $this->version ); 182 180 } 183 181 … … 198 196 */ 199 197 public function head_scripts() { 200 ?> 198 199 // Bail if no extra JS is needed 200 if ( ! bbp_is_single_user_edit() && ! bbp_use_wp_editor() ) 201 return; ?> 201 202 202 203 <script type="text/javascript"> 203 204 /* <![CDATA[ */ 204 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';205 206 205 <?php if ( bbp_is_single_user_edit() ) : ?> 207 206 if ( window.location.hash == '#password' ) { … … 264 263 265 264 wp_localize_script( 'bbpress-topic', 'bbpTopicJS', array( 266 ' ajaxurl' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' )),265 'bbp_ajaxurl' => bbp_get_ajax_url(), 267 266 'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ), 268 267 'is_user_logged_in' => is_user_logged_in(),
Note: See TracChangeset
for help on using the changeset viewer.