Changeset 3505 for branches/plugin/bbp-includes/bbp-extend-akismet.php
- Timestamp:
- 09/10/2011 10:27:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-extend-akismet.php
r3498 r3505 74 74 * @param string $post_data 75 75 * 76 * @global bbPress $bbp77 *78 76 * @uses get_userdata() To get the user data 79 77 * @uses bbp_filter_anonymous_user_data() To get anonymous user data … … 89 87 */ 90 88 public function check_post( $post_data ) { 91 global $bbp;92 89 93 90 // Declare local variables … … 96 93 97 94 // Post is not published 98 if ( 'publish'!= $post_data['post_status'] )95 if ( bbp_get_public_status_id() != $post_data['post_status'] ) 99 96 return $post_data; 100 97 … … 167 164 168 165 // This is spam 169 $post_data['post_status'] = $bbp->spam_status_id;166 $post_data['post_status'] = bbp_get_spam_status_id(); 170 167 171 168 // We don't want your spam tags here … … 192 189 * @param int $post_id 193 190 * 194 * @global bbPress $bbp195 191 * @global WP_Query $wpdb 196 192 * @global string $akismet_api_host … … 214 210 */ 215 211 public function submit_post( $post_id = 0 ) { 216 global $ bbp, $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site;212 global $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site; 217 213 218 214 // Innocent until proven guilty … … 251 247 252 248 // Bail if we're spamming, but the post_status isn't spam 253 if ( ( 'spam' == $request_type ) && ( $bbp->spam_status_id!= $post->post_status ) )249 if ( ( 'spam' == $request_type ) && ( bbp_get_spam_status_id() != $post->post_status ) ) 254 250 return; 255 251 … … 404 400 * @param object $post 405 401 * 406 * @global bbPress $bbp407 402 * @global object $this->last_post 408 403 * … … 414 409 */ 415 410 public function update_post_meta( $post_id = 0, $post = false ) { 416 global $bbp;417 411 418 412 // Define local variable(s) … … 452 446 453 447 // If post_status isn't the spam status, as expected, leave a note 454 if ( $post->post_status != $bbp->spam_status_id) {448 if ( $post->post_status != bbp_get_spam_status_id() ) { 455 449 $this->update_post_history( $post_id, sprintf( __( 'Post status was changed to %s', 'bbpress' ), $post->post_status ), 'status-changed-' . $post->post_status ); 456 450 } … … 464 458 465 459 // If post_status is the spam status, which isn't expected, leave a note 466 if ( $post->post_status == $bbp->spam_status_id) {460 if ( $post->post_status == bbp_get_spam_status_id() ) { 467 461 468 462 // @todo Use wp_blacklist_check() … … 554 548 * @param int $reply_id 555 549 * 556 * @global bbPress $bbp557 *558 550 * @uses bbp_get_reply_id() To get the reply_id 559 551 * @uses bbp_get_topic_id() To get the topic_id … … 564 556 */ 565 557 public function filter_post_terms( $terms = '', $topic_id = 0, $reply_id = 0 ) { 566 global $bbp;567 558 568 559 // Validate the reply_id and topic_id … … 696 687 if ( !defined( 'AKISMET_VERSION' ) ) return; 697 688 689 // Bail if bbPress is not loaded 690 if ( 'bbPress' !== get_class( $bbp ) ) return; 691 698 692 // Instantiate Akismet for bbPress 699 693 $bbp->extend->akismet = new BBP_Akismet();
Note: See TracChangeset
for help on using the changeset viewer.