Changeset 5829
- Timestamp:
- 07/14/2015 12:46:38 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bbpress.php
r5823 r5829 637 637 global $wp_post_statuses; 638 638 639 if ( ! empty( $wp_post_statuses['trash'] ) ) {639 if ( ! empty( $wp_post_statuses['trash'] ) ) { 640 640 641 641 // User can view trash so set internal to false -
trunk/src/includes/admin/admin.php
r5827 r5829 317 317 */ 318 318 public static function new_install() { 319 if ( ! bbp_is_install() ) {319 if ( ! bbp_is_install() ) { 320 320 return; 321 321 } … … 360 360 361 361 // Toggle the section if core integration is on 362 if ( ( true === $settings_integration ) && ! empty( $section['page'] ) ) {362 if ( ( true === $settings_integration ) && ! empty( $section['page'] ) ) { 363 363 $page = $section['page']; 364 364 } else { … … 373 373 374 374 // Add the field 375 if ( ! empty( $field['callback'] ) && ! empty( $field['title'] ) ) {375 if ( ! empty( $field['callback'] ) && ! empty( $field['title'] ) ) { 376 376 add_settings_field( $field_id, $field['title'], $field['callback'], $page, $section_id, $field['args'] ); 377 377 } -
trunk/src/includes/admin/converter.php
r5827 r5829 320 320 321 321 // Save step and count so that it can be restarted. 322 if ( ! get_option( '_bbp_converter_step' ) || ( ! empty( $_POST['_bbp_converter_restart'] ) ) ) {322 if ( ! get_option( '_bbp_converter_step' ) || ( ! empty( $_POST['_bbp_converter_restart'] ) ) ) { 323 323 update_option( '_bbp_converter_step', 1 ); 324 324 update_option( '_bbp_converter_start', 0 ); … … 332 332 333 333 // Bail if platform did not get saved 334 $platform = ! empty( $_POST['_bbp_converter_platform' ] ) ? $_POST['_bbp_converter_platform' ] : get_option( '_bbp_converter_platform' );334 $platform = ! empty( $_POST['_bbp_converter_platform' ] ) ? $_POST['_bbp_converter_platform' ] : get_option( '_bbp_converter_platform' ); 335 335 if ( empty( $platform ) ) { 336 336 return; … … 344 344 // STEP 1. Clean all tables. 345 345 case 1 : 346 if ( ! empty( $_POST['_bbp_converter_clean'] ) ) {346 if ( ! empty( $_POST['_bbp_converter_clean'] ) ) { 347 347 if ( $converter->clean( $start ) ) { 348 348 update_option( '_bbp_converter_step', $step + 1 ); … … 365 365 // STEP 2. Convert users. 366 366 case 2 : 367 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) {367 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) { 368 368 if ( $converter->convert_users( $start ) ) { 369 369 update_option( '_bbp_converter_step', $step + 1 ); … … 385 385 // STEP 3. Clean passwords. 386 386 case 3 : 387 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) {387 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) ) { 388 388 if ( $converter->clean_passwords( $start ) ) { 389 389 update_option( '_bbp_converter_step', $step + 1 ); … … 639 639 require_once( ABSPATH . '/wp-admin/includes/upgrade.php' ); 640 640 641 if ( ! empty( $bbp_db->charset ) ) {641 if ( ! empty( $bbp_db->charset ) ) { 642 642 $charset_collate = "DEFAULT CHARACTER SET $bbp_db->charset"; 643 643 } 644 644 645 if ( ! empty( $bbp_db->collate ) ) {645 if ( ! empty( $bbp_db->collate ) ) { 646 646 $charset_collate .= " COLLATE $bbp_db->collate"; 647 647 } … … 958 958 959 959 // Get the fields from the destination table 960 if ( ! empty( $tablename ) ) {960 if ( ! empty( $tablename ) ) { 961 961 $tablefield_array = $this->get_fields( $tablename ); 962 962 } … … 968 968 969 969 // Yay a match, and we have a from table, too 970 if ( ( $item['to_type'] == $to_type ) && ! empty( $item['from_tablename'] ) ) {970 if ( ( $item['to_type'] == $to_type ) && ! empty( $item['from_tablename'] ) ) { 971 971 972 972 // $from_tablename was set from a previous loop iteration … … 974 974 975 975 // Doing some joining 976 if ( ! in_array( $item['from_tablename'], $from_tables ) && in_array( $item['join_tablename'], $from_tables ) ) {976 if ( ! in_array( $item['from_tablename'], $from_tables ) && in_array( $item['join_tablename'], $from_tables ) ) { 977 977 $from_tablename .= ' ' . $item['join_type'] . ' JOIN ' . $this->opdb->prefix . $item['from_tablename'] . ' AS ' . $item['from_tablename'] . ' ' . $item['join_expression']; 978 978 } … … 984 984 985 985 // Specific FROM expression data used 986 if ( ! empty( $item['from_expression'] ) ) {986 if ( ! empty( $item['from_expression'] ) ) { 987 987 988 988 // No 'WHERE' in expression … … 1005 1005 1006 1006 // We have a $from_tablename, so we want to get some data to convert 1007 if ( ! empty( $from_tablename ) ) {1007 if ( ! empty( $from_tablename ) ) { 1008 1008 1009 1009 // Get some data from the old forums … … 1016 1016 1017 1017 // Query returned some results 1018 if ( ! empty( $forum_array ) ) {1018 if ( ! empty( $forum_array ) ) { 1019 1019 1020 1020 // Loop through results … … 1054 1054 // Destination field is not empty, so we might need 1055 1055 // to do some extra work or set a default. 1056 } elseif ( ! empty( $row['to_fieldname'] ) ) {1056 } elseif ( ! empty( $row['to_fieldname'] ) ) { 1057 1057 1058 1058 // Allows us to set default fields. … … 1252 1252 $has_update = false; 1253 1253 1254 if ( ! empty( $this->sync_table ) ) {1254 if ( ! empty( $this->sync_table ) ) { 1255 1255 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_forum_parent_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows; 1256 1256 } else { … … 1284 1284 $has_update = false; 1285 1285 1286 if ( ! empty( $this->sync_table ) ) {1286 if ( ! empty( $this->sync_table ) ) { 1287 1287 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status_id" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows; 1288 1288 } else { … … 1315 1315 $has_update = false; 1316 1316 1317 if ( ! empty( $this->sync_table ) ) {1317 if ( ! empty( $this->sync_table ) ) { 1318 1318 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status_id" AND meta_value = "super-sticky" LIMIT ' . $start . ', ' . $this->max_rows; 1319 1319 } else { … … 1346 1346 $has_update = false; 1347 1347 1348 if ( ! empty( $this->sync_table ) ) {1348 if ( ! empty( $this->sync_table ) ) { 1349 1349 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_closed_status_id" AND meta_value = "closed" LIMIT ' . $start . ', ' . $this->max_rows; 1350 1350 } else { … … 1373 1373 $has_update = false; 1374 1374 1375 if ( ! empty( $this->sync_table ) ) {1375 if ( ! empty( $this->sync_table ) ) { 1376 1376 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_reply_to_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows; 1377 1377 } else { … … 1403 1403 $has_update = false; 1404 1404 1405 if ( ! empty( $this->sync_table ) ) {1405 if ( ! empty( $this->sync_table ) ) { 1406 1406 $query = 'SELECT sync_table1.value_id AS topic_id, sync_table1.meta_value AS topic_is_anonymous, sync_table2.meta_value AS topic_author 1407 1407 FROM ' . $this->sync_table_name . ' AS sync_table1 … … 1449 1449 $has_update = false; 1450 1450 1451 if ( ! empty( $this->sync_table ) ) {1451 if ( ! empty( $this->sync_table ) ) { 1452 1452 $query = 'SELECT sync_table1.value_id AS reply_id, sync_table1.meta_value AS reply_is_anonymous, sync_table2.meta_value AS reply_author 1453 1453 FROM ' . $this->sync_table_name . ' AS sync_table1 … … 1523 1523 $users = $this->wpdb->get_results( $query, ARRAY_A ); 1524 1524 1525 if ( ! empty( $users ) ) {1525 if ( ! empty( $users ) ) { 1526 1526 foreach ( $users as $value ) { 1527 1527 wp_delete_user( $value['value_id'] ); … … 1552 1552 $bbconverter = $this->wpdb->get_results( $query, ARRAY_A ); 1553 1553 1554 if ( ! empty( $bbconverter ) ) {1554 if ( ! empty( $bbconverter ) ) { 1555 1555 1556 1556 foreach ( $bbconverter as $value ) { … … 1612 1612 public function callback_pass( $username, $password ) { 1613 1613 $user = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT * FROM ' . $this->wpdb->users . ' WHERE user_login = "%s" AND user_pass = "" LIMIT 1', $username ) ); 1614 if ( ! empty( $user ) ) {1614 if ( ! empty( $user ) ) { 1615 1615 $usermeta = $this->wpdb->get_row( 'SELECT * FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_password" AND user_id = "' . $user->ID . '" LIMIT 1' ); 1616 1616 1617 if ( ! empty( $usermeta ) ) {1617 if ( ! empty( $usermeta ) ) { 1618 1618 if ( $this->authenticate_pass( $password, $usermeta->meta_value ) ) { 1619 1619 $this->wpdb->query( 'UPDATE ' . $this->wpdb->users . ' ' . 'SET user_pass = "' . wp_hash_password( $password ) . '" ' . 'WHERE ID = "' . $user->ID . '"' ); … … 1631 1631 */ 1632 1632 private function callback_forumid( $field ) { 1633 if ( ! isset( $this->map_forumid[$field] ) ) {1634 if ( ! empty( $this->sync_table ) ) {1633 if ( ! isset( $this->map_forumid[$field] ) ) { 1634 if ( ! empty( $this->sync_table ) ) { 1635 1635 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_forum_id" AND meta_value = "%s" LIMIT 1', $field ) ); 1636 1636 } else { … … 1654 1654 */ 1655 1655 private function callback_topicid( $field ) { 1656 if ( ! isset( $this->map_topicid[$field] ) ) {1657 if ( ! empty( $this->sync_table ) ) {1656 if ( ! isset( $this->map_topicid[$field] ) ) { 1657 if ( ! empty( $this->sync_table ) ) { 1658 1658 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_topic_id" AND meta_value = "%s" LIMIT 1', $field ) ); 1659 1659 } else { … … 1679 1679 */ 1680 1680 private function callback_reply_to( $field ) { 1681 if ( ! isset( $this->map_reply_to[$field] ) ) {1682 if ( ! empty( $this->sync_table ) ) {1681 if ( ! isset( $this->map_reply_to[$field] ) ) { 1682 if ( ! empty( $this->sync_table ) ) { 1683 1683 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_reply_id" AND meta_value = "%s" LIMIT 1', $field ) ); 1684 1684 } else { … … 1702 1702 */ 1703 1703 private function callback_userid( $field ) { 1704 if ( ! isset( $this->map_userid[$field] ) ) {1705 if ( ! empty( $this->sync_table ) ) {1704 if ( ! isset( $this->map_userid[$field] ) ) { 1705 if ( ! empty( $this->sync_table ) ) { 1706 1706 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_user_id" AND meta_value = "%s" LIMIT 1', $field ) ); 1707 1707 } else { … … 1712 1712 $this->map_userid[$field] = $row->value_id; 1713 1713 } else { 1714 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {1714 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) { 1715 1715 $this->map_userid[$field] = 0; 1716 1716 } else { -
trunk/src/includes/admin/converters/e107v1.php
r5770 r5829 567 567 $field = preg_replace( '/(\d+?)+\.[\S\s]+/', '$1', $field ); 568 568 569 if ( ! isset( $this->map_userid[$field] ) ) {570 if ( ! empty( $this->sync_table ) ) {569 if ( ! isset( $this->map_userid[$field] ) ) { 570 if ( ! empty( $this->sync_table ) ) { 571 571 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_user_id" AND meta_value = "%s" LIMIT 1', $field ) ); 572 572 } else { … … 577 577 $this->map_userid[$field] = $row->value_id; 578 578 } else { 579 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) {579 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) { 580 580 $this->map_userid[$field] = 0; 581 581 } else { -
trunk/src/includes/admin/forums.php
r5770 r5829 92 92 */ 93 93 private function bail() { 94 if ( ! isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) ) {94 if ( ! isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) ) { 95 95 return true; 96 96 } … … 301 301 302 302 // Nonce check 303 if ( empty( $_POST['bbp_forum_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) ) {303 if ( empty( $_POST['bbp_forum_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) ) { 304 304 return $forum_id; 305 305 } … … 316 316 317 317 // Parent ID 318 $parent_id = ( ! empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0;318 $parent_id = ( ! empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0; 319 319 320 320 // Update the forum meta bidness … … 437 437 438 438 // Only proceed if GET is a forum toggle action 439 if ( bbp_is_get_request() && ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_forum_close' ) ) && !empty( $_GET['forum_id'] ) ) {439 if ( bbp_is_get_request() && ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_forum_close' ) ) && ! empty( $_GET['forum_id'] ) ) { 440 440 $action = $_GET['action']; // What action is taking place? 441 441 $forum_id = (int) $_GET['forum_id']; // What's the forum id? … … 505 505 506 506 // Only proceed if GET is a forum toggle action 507 if ( bbp_is_get_request() && ! empty( $_GET['bbp_forum_toggle_notice'] ) && in_array( $_GET['bbp_forum_toggle_notice'], array( 'opened', 'closed' ) ) && !empty( $_GET['forum_id'] ) ) {507 if ( bbp_is_get_request() && ! empty( $_GET['bbp_forum_toggle_notice'] ) && in_array( $_GET['bbp_forum_toggle_notice'], array( 'opened', 'closed' ) ) && ! empty( $_GET['forum_id'] ) ) { 508 508 $notice = $_GET['bbp_forum_toggle_notice']; // Which notice? 509 509 $forum_id = (int) $_GET['forum_id']; // What's the forum id? 510 $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure?510 $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure? 511 511 512 512 // Bail if no forum_id or notice … … 621 621 case 'bbp_forum_freshness' : 622 622 $last_active = bbp_get_forum_last_active_time( $forum_id, false ); 623 if ( ! empty( $last_active ) ) {623 if ( ! empty( $last_active ) ) { 624 624 echo esc_html( $last_active ); 625 625 } else { -
trunk/src/includes/admin/functions.php
r5770 r5829 133 133 134 134 // Bail if not on an admin page and not getting a sample permalink 135 if ( ! empty( $sample ) && is_admin() && bbp_is_custom_post_type() ) {135 if ( ! empty( $sample ) && is_admin() && bbp_is_custom_post_type() ) { 136 136 return urldecode( $post_link ); 137 137 } -
trunk/src/includes/admin/replies.php
r5810 r5829 99 99 */ 100 100 private function bail() { 101 if ( ! isset( get_current_screen()->post_type ) || ( $this->post_type !== get_current_screen()->post_type ) ) {101 if ( ! isset( get_current_screen()->post_type ) || ( $this->post_type !== get_current_screen()->post_type ) ) { 102 102 return true; 103 103 } … … 305 305 306 306 // Nonce check 307 if ( empty( $_POST['bbp_reply_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_reply_metabox'], 'bbp_reply_metabox_save' ) ) {307 if ( empty( $_POST['bbp_reply_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_reply_metabox'], 'bbp_reply_metabox_save' ) ) { 308 308 return $reply_id; 309 309 } … … 315 315 316 316 // Get the reply meta post values 317 $topic_id = ! empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0;318 $forum_id = ! empty( $_POST['bbp_forum_id'] ) ? (int) $_POST['bbp_forum_id'] : bbp_get_topic_forum_id( $topic_id );319 $reply_to = ! empty( $_POST['bbp_reply_to'] ) ? (int) $_POST['bbp_reply_to'] : 0;317 $topic_id = ! empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0; 318 $forum_id = ! empty( $_POST['bbp_forum_id'] ) ? (int) $_POST['bbp_forum_id'] : bbp_get_topic_forum_id( $topic_id ); 319 $reply_to = ! empty( $_POST['bbp_reply_to'] ) ? (int) $_POST['bbp_reply_to'] : 0; 320 320 321 321 // Get reply author data … … 550 550 $notice = $_GET['bbp_reply_toggle_notice']; // Which notice? 551 551 $reply_id = (int) $_GET['reply_id']; // What's the reply id? 552 $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure?552 $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure? 553 553 554 554 // Empty? No reply? … … 675 675 676 676 // Output forum name 677 if ( ! empty( $topic_id ) ) {677 if ( ! empty( $topic_id ) ) { 678 678 679 679 // Topic Title … … 701 701 702 702 // Output forum name 703 if ( ! empty( $reply_forum_id ) ) {703 if ( ! empty( $reply_forum_id ) ) { 704 704 705 705 // Forum Title … … 847 847 848 848 // Add Empty Spam button 849 if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {849 if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) { 850 850 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 851 851 $title = esc_attr__( 'Empty Spam', 'bbpress' ); … … 854 854 855 855 // Get which forum is selected 856 $selected = ! empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : '';856 $selected = ! empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : ''; 857 857 858 858 // Show the forums dropdown … … 881 881 882 882 // Add post_parent query_var if one is present 883 if ( ! empty( $_GET['bbp_forum_id'] ) ) {883 if ( ! empty( $_GET['bbp_forum_id'] ) ) { 884 884 $query_vars['meta_key'] = '_bbp_forum_id'; 885 885 $query_vars['meta_type'] = 'NUMERIC'; -
trunk/src/includes/admin/settings.php
r5793 r5829 724 724 } 725 725 726 if ( ! empty( $theme_options ) ) : ?>726 if ( ! empty( $theme_options ) ) : ?> 727 727 728 728 <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select> … … 1730 1730 1731 1731 // Loop through root slugs and check for conflict 1732 if ( ! empty( $bp->pages ) ) {1732 if ( ! empty( $bp->pages ) ) { 1733 1733 foreach ( $bp->pages as $page => $page_data ) { 1734 1734 $page_base = $page . '_base'; -
trunk/src/includes/admin/tools.php
r5827 r5829 510 510 511 511 // Bump the count 512 if ( ! empty( $updated ) && ! is_wp_error( $updated ) ) {512 if ( ! empty( $updated ) && ! is_wp_error( $updated ) ) { 513 513 ++$g_count; 514 514 } … … 516 516 // Update group to forum relationship data 517 517 $group_id = (int) $bbp_db->get_var( "SELECT `group_id` FROM `{$groups_meta_table}` WHERE `meta_key` = 'forum_id' AND `meta_value` = '{$group_forums->ID}';" ); 518 if ( ! empty( $group_id ) ) {518 if ( ! empty( $group_id ) ) { 519 519 520 520 // Update the group to forum meta connection in forums … … 621 621 622 622 $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) ); 623 if ( ! empty( $forums ) ) {623 if ( ! empty( $forums ) ) { 624 624 foreach ( $forums as $forum ) { 625 625 bbp_update_forum_topic_count( $forum->ID ); … … 668 668 // Recalculate the metas key _bbp_reply_count and _bbp_total_reply_count for each forum 669 669 $forums = get_posts( array( 'post_type' => bbp_get_forum_post_type(), 'numberposts' => -1 ) ); 670 if ( ! empty( $forums ) ) {670 if ( ! empty( $forums ) ) { 671 671 foreach ( $forums as $forum ) { 672 672 bbp_update_forum_reply_count( $forum->ID ); … … 1163 1163 // Loop through forums 1164 1164 foreach ( $forums as $forum_id ) { 1165 if ( ! bbp_is_forum_category( $forum_id ) ) {1165 if ( ! bbp_is_forum_category( $forum_id ) ) { 1166 1166 bbp_update_forum( array( 'forum_id' => $forum_id ) ); 1167 1167 } … … 1607 1607 /** Post Meta *************************************************************/ 1608 1608 1609 if ( ! empty( $sql_posts ) ) {1609 if ( ! empty( $sql_posts ) ) { 1610 1610 $sql_meta = array(); 1611 1611 foreach ( $sql_posts as $key => $value ) { … … 1629 1629 1630 1630 // First, if we're deleting previously imported users, delete them now 1631 if ( ! empty( $_POST['bbpress-delete-imported-users'] ) ) {1631 if ( ! empty( $_POST['bbpress-delete-imported-users'] ) ) { 1632 1632 $sql_users = $bbp_db->get_results( "SELECT `user_id` FROM `{$bbp_db->usermeta}` WHERE `meta_key` = '_bbp_user_id'", OBJECT_K ); 1633 if ( ! empty( $sql_users ) ) {1633 if ( ! empty( $sql_users ) ) { 1634 1634 $sql_meta = array(); 1635 1635 foreach ( $sql_users as $key => $value ) { -
trunk/src/includes/admin/topics.php
r5810 r5829 99 99 */ 100 100 private function bail() { 101 if ( ! isset( get_current_screen()->post_type ) || ( $this->post_type !== get_current_screen()->post_type ) ) {101 if ( ! isset( get_current_screen()->post_type ) || ( $this->post_type !== get_current_screen()->post_type ) ) { 102 102 return true; 103 103 } … … 301 301 302 302 // Nonce check 303 if ( empty( $_POST['bbp_topic_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_topic_metabox'], 'bbp_topic_metabox_save' ) ) {303 if ( empty( $_POST['bbp_topic_metabox'] ) || ! wp_verify_nonce( $_POST['bbp_topic_metabox'], 'bbp_topic_metabox_save' ) ) { 304 304 return $topic_id; 305 305 } … … 311 311 312 312 // Get the forum ID 313 $forum_id = ! empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0;313 $forum_id = ! empty( $_POST['parent_id'] ) ? (int) $_POST['parent_id'] : 0; 314 314 315 315 // Get topic author data … … 322 322 323 323 // Stickies 324 if ( ! empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) {324 if ( ! empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) { 325 325 326 326 // What's the haps? … … 498 498 499 499 // Only proceed if GET is a topic toggle action 500 if ( bbp_is_get_request() && ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_topic_close', 'bbp_toggle_topic_stick', 'bbp_toggle_topic_spam', 'bbp_toggle_topic_approve' ) ) && !empty( $_GET['topic_id'] ) ) {500 if ( bbp_is_get_request() && ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'bbp_toggle_topic_close', 'bbp_toggle_topic_stick', 'bbp_toggle_topic_spam', 'bbp_toggle_topic_approve' ) ) && ! empty( $_GET['topic_id'] ) ) { 501 501 $action = $_GET['action']; // What action is taking place? 502 502 $topic_id = (int) $_GET['topic_id']; // What's the topic id? … … 546 546 547 547 $is_sticky = bbp_is_topic_sticky( $topic_id ); 548 $is_super = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] )548 $is_super = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) 549 549 ? true 550 550 : false; … … 614 614 $notice = $_GET['bbp_topic_toggle_notice']; // Which notice? 615 615 $topic_id = (int) $_GET['topic_id']; // What's the topic id? 616 $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure?616 $is_failure = ! empty( $_GET['failed'] ) ? true : false; // Was that a failure? 617 617 618 618 // Bais if no topic_id or notice … … 768 768 769 769 // Output forum name 770 if ( ! empty( $forum_id ) ) {770 if ( ! empty( $forum_id ) ) { 771 771 772 772 // Forum Title … … 812 812 case 'bbp_topic_freshness' : 813 813 $last_active = bbp_get_topic_last_active_time( $topic_id, false ); 814 if ( ! empty( $last_active ) ) {814 if ( ! empty( $last_active ) ) { 815 815 echo esc_html( $last_active ); 816 816 } else { … … 948 948 949 949 // Add Empty Spam button 950 if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {950 if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) { 951 951 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 952 952 $title = esc_attr__( 'Empty Spam', 'bbpress' ); … … 955 955 956 956 // Get which forum is selected 957 $selected = ! empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : '';957 $selected = ! empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : ''; 958 958 959 959 // Show the forums dropdown … … 982 982 983 983 // Add post_parent query_var if one is present 984 if ( ! empty( $_GET['bbp_forum_id'] ) ) {984 if ( ! empty( $_GET['bbp_forum_id'] ) ) { 985 985 $query_vars['meta_key'] = '_bbp_forum_id'; 986 986 $query_vars['meta_type'] = 'NUMERIC'; -
trunk/src/includes/common/ajax.php
r5770 r5829 107 107 108 108 // Merge extra response parameters in 109 if ( ! empty( $extras ) && is_array( $extras ) ) {109 if ( ! empty( $extras ) && is_array( $extras ) ) { 110 110 $response = array_merge( $response, $extras ); 111 111 } -
trunk/src/includes/common/classes.php
r5770 r5829 396 396 397 397 // Check for a callback and use it if specified 398 if ( ! empty( $args['callback'] ) ) {398 if ( ! empty( $args['callback'] ) ) { 399 399 call_user_func( $args['callback'], $object, $args, $depth ); 400 400 return; … … 402 402 403 403 // Style for div or list element 404 if ( ! empty( $args['style'] ) && ( 'div' === $args['style'] ) ) {404 if ( ! empty( $args['style'] ) && ( 'div' === $args['style'] ) ) { 405 405 echo "<div>\n"; 406 406 } else { … … 417 417 418 418 // Check for a callback and use it if specified 419 if ( ! empty( $args['end-callback'] ) ) {419 if ( ! empty( $args['end-callback'] ) ) { 420 420 call_user_func( $args['end-callback'], $object, $args, $depth ); 421 421 return; … … 423 423 424 424 // Style for div or list element 425 if ( ! empty( $args['style'] ) && ( 'div' === $args['style'] ) ) {425 if ( ! empty( $args['style'] ) && ( 'div' === $args['style'] ) ) { 426 426 echo "</div>\n"; 427 427 } else { -
trunk/src/includes/common/functions.php
r5827 r5829 126 126 ); 127 127 128 if ( ! empty( $older_date ) && !is_numeric( $older_date ) ) {128 if ( ! empty( $older_date ) && !is_numeric( $older_date ) ) { 129 129 $time_chunks = explode( ':', str_replace( ' ', ':', $older_date ) ); 130 130 $date_chunks = explode( '-', str_replace( ' ', '-', $older_date ) ); … … 135 135 // between a date and the current time. $newer_date will have a value if 136 136 // we want to work out time elapsed between two known dates. 137 $newer_date = ( ! $newer_date ) ? strtotime( current_time( 'mysql', $gmt ) ) : $newer_date;137 $newer_date = ( ! $newer_date ) ? strtotime( current_time( 'mysql', $gmt ) ) : $newer_date; 138 138 139 139 // Difference in seconds … … 162 162 163 163 // If $i iterates all the way to $j, then the event happened 0 seconds ago 164 if ( ! isset( $chunks[$i] ) ) {164 if ( ! isset( $chunks[$i] ) ) { 165 165 $output = $right_now_text; 166 166 … … 242 242 */ 243 243 function bbp_get_redirect_to() { 244 $retval = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';244 $retval = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 245 245 246 246 return apply_filters( 'bbp_get_redirect_to', $retval ); … … 262 262 263 263 // Are we appending the view=all vars? 264 if ( bbp_get_view_all() || ! empty( $force ) ) {264 if ( bbp_get_view_all() || ! empty( $force ) ) { 265 265 $link = add_query_arg( array( 'view' => 'all' ), $original_link ); 266 266 } else { … … 296 296 */ 297 297 function bbp_get_view_all( $cap = 'moderate' ) { 298 $retval = ( ( ! empty( $_GET['view'] ) && ( 'all' === $_GET['view'] ) && current_user_can( $cap ) ) );298 $retval = ( ( ! empty( $_GET['view'] ) && ( 'all' === $_GET['view'] ) && current_user_can( $cap ) ) ); 299 299 return apply_filters( 'bbp_get_view_all', (bool) $retval ); 300 300 } … … 316 316 317 317 // Check query paged 318 } elseif ( ! empty( $wp_query->query['paged'] ) ) {318 } elseif ( ! empty( $wp_query->query['paged'] ) ) { 319 319 $paged = $wp_query->query['paged']; 320 320 } 321 321 322 322 // Paged found 323 if ( ! empty( $paged ) ) {323 if ( ! empty( $paged ) ) { 324 324 return (int) $paged; 325 325 } … … 354 354 355 355 // Post is not a topic or reply, return 356 if ( ! in_array( $data['post_type'], array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) ) ) {356 if ( ! in_array( $data['post_type'], array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) ) ) { 357 357 return $data; 358 358 } 359 359 360 360 // Is the post by an anonymous user? 361 if ( ( bbp_get_topic_post_type() === $data['post_type'] && ! bbp_is_topic_anonymous( $postarr['ID'] ) ) ||362 ( bbp_get_reply_post_type() === $data['post_type'] && ! bbp_is_reply_anonymous( $postarr['ID'] ) ) ) {361 if ( ( bbp_get_topic_post_type() === $data['post_type'] && ! bbp_is_topic_anonymous( $postarr['ID'] ) ) || 362 ( bbp_get_reply_post_type() === $data['post_type'] && ! bbp_is_reply_anonymous( $postarr['ID'] ) ) ) { 363 363 return $data; 364 364 } … … 480 480 481 481 // Users 482 if ( ! empty( $r['count_users'] ) ) {482 if ( ! empty( $r['count_users'] ) ) { 483 483 $user_count = bbp_get_total_users(); 484 484 } 485 485 486 486 // Forums 487 if ( ! empty( $r['count_forums'] ) ) {487 if ( ! empty( $r['count_forums'] ) ) { 488 488 $forum_count = wp_count_posts( bbp_get_forum_post_type() )->publish; 489 489 } … … 496 496 497 497 // Topics 498 if ( ! empty( $r['count_topics'] ) ) {498 if ( ! empty( $r['count_topics'] ) ) { 499 499 $all_topics = wp_count_posts( bbp_get_topic_post_type() ); 500 500 … … 505 505 506 506 // Private 507 $topics['private'] = ( ! empty( $r['count_private_topics'] ) && current_user_can( 'read_private_topics' ) ) ? (int) $all_topics->{$private} : 0;507 $topics['private'] = ( ! empty( $r['count_private_topics'] ) && current_user_can( 'read_private_topics' ) ) ? (int) $all_topics->{$private} : 0; 508 508 509 509 // Spam 510 $topics['spammed'] = ( ! empty( $r['count_spammed_topics'] ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$spam} : 0;510 $topics['spammed'] = ( ! empty( $r['count_spammed_topics'] ) && current_user_can( 'edit_others_topics' ) ) ? (int) $all_topics->{$spam} : 0; 511 511 512 512 // Trash 513 $topics['trashed'] = ( ! empty( $r['count_trashed_topics'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_topics->{$trash} : 0;513 $topics['trashed'] = ( ! empty( $r['count_trashed_topics'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_topics->{$trash} : 0; 514 514 515 515 // Total hidden (private + spam + trash) … … 517 517 518 518 // Generate the hidden topic count's title attribute 519 $topic_titles[] = ! empty( $topics['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $topics['private'] ) ) : '';520 $topic_titles[] = ! empty( $topics['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $topics['spammed'] ) ) : '';521 $topic_titles[] = ! empty( $topics['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $topics['trashed'] ) ) : '';519 $topic_titles[] = ! empty( $topics['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $topics['private'] ) ) : ''; 520 $topic_titles[] = ! empty( $topics['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $topics['spammed'] ) ) : ''; 521 $topic_titles[] = ! empty( $topics['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $topics['trashed'] ) ) : ''; 522 522 523 523 // Compile the hidden topic title … … 527 527 528 528 // Replies 529 if ( ! empty( $r['count_replies'] ) ) {529 if ( ! empty( $r['count_replies'] ) ) { 530 530 531 531 $all_replies = wp_count_posts( bbp_get_reply_post_type() ); … … 537 537 538 538 // Private 539 $replies['private'] = ( ! empty( $r['count_private_replies'] ) && current_user_can( 'read_private_replies' ) ) ? (int) $all_replies->{$private} : 0;539 $replies['private'] = ( ! empty( $r['count_private_replies'] ) && current_user_can( 'read_private_replies' ) ) ? (int) $all_replies->{$private} : 0; 540 540 541 541 // Spam 542 $replies['spammed'] = ( ! empty( $r['count_spammed_replies'] ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$spam} : 0;542 $replies['spammed'] = ( ! empty( $r['count_spammed_replies'] ) && current_user_can( 'edit_others_replies' ) ) ? (int) $all_replies->{$spam} : 0; 543 543 544 544 // Trash 545 $replies['trashed'] = ( ! empty( $r['count_trashed_replies'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_replies->{$trash} : 0;545 $replies['trashed'] = ( ! empty( $r['count_trashed_replies'] ) && current_user_can( 'view_trash' ) ) ? (int) $all_replies->{$trash} : 0; 546 546 547 547 // Total hidden (private + spam + trash) … … 549 549 550 550 // Generate the hidden topic count's title attribute 551 $reply_titles[] = ! empty( $replies['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $replies['private'] ) ) : '';552 $reply_titles[] = ! empty( $replies['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $replies['spammed'] ) ) : '';553 $reply_titles[] = ! empty( $replies['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $replies['trashed'] ) ) : '';551 $reply_titles[] = ! empty( $replies['private'] ) ? sprintf( __( 'Private: %s', 'bbpress' ), number_format_i18n( $replies['private'] ) ) : ''; 552 $reply_titles[] = ! empty( $replies['spammed'] ) ? sprintf( __( 'Spammed: %s', 'bbpress' ), number_format_i18n( $replies['spammed'] ) ) : ''; 553 $reply_titles[] = ! empty( $replies['trashed'] ) ? sprintf( __( 'Trashed: %s', 'bbpress' ), number_format_i18n( $replies['trashed'] ) ) : ''; 554 554 555 555 // Compile the hidden replies title … … 560 560 561 561 // Topic Tags 562 if ( ! empty( $r['count_tags'] ) && bbp_allow_topic_tags() ) {562 if ( ! empty( $r['count_tags'] ) && bbp_allow_topic_tags() ) { 563 563 564 564 // Get the count … … 566 566 567 567 // Empty tags 568 if ( ! empty( $r['count_empty_tags'] ) && current_user_can( 'edit_topic_tags' ) ) {568 if ( ! empty( $r['count_empty_tags'] ) && current_user_can( 'edit_topic_tags' ) ) { 569 569 $empty_topic_tag_count = wp_count_terms( bbp_get_topic_tag_tax_id() ) - $topic_tag_count; 570 570 } … … 621 621 // Parse arguments against default values 622 622 $r = bbp_parse_args( $args, array ( 623 'bbp_anonymous_name' => ! empty( $_POST['bbp_anonymous_name'] ) ? $_POST['bbp_anonymous_name'] : false,624 'bbp_anonymous_email' => ! empty( $_POST['bbp_anonymous_email'] ) ? $_POST['bbp_anonymous_email'] : false,625 'bbp_anonymous_website' => ! empty( $_POST['bbp_anonymous_website'] ) ? $_POST['bbp_anonymous_website'] : false,623 'bbp_anonymous_name' => ! empty( $_POST['bbp_anonymous_name'] ) ? $_POST['bbp_anonymous_name'] : false, 624 'bbp_anonymous_email' => ! empty( $_POST['bbp_anonymous_email'] ) ? $_POST['bbp_anonymous_email'] : false, 625 'bbp_anonymous_website' => ! empty( $_POST['bbp_anonymous_website'] ) ? $_POST['bbp_anonymous_website'] : false, 626 626 ), 'filter_anonymous_post_data' ); 627 627 … … 686 686 687 687 // Check for anonymous post 688 if ( empty( $r['post_author'] ) && ( ! empty( $r['anonymous_data'] ) && !empty( $r['anonymous_data']['bbp_anonymous_email'] ) ) ) {688 if ( empty( $r['post_author'] ) && ( ! empty( $r['anonymous_data'] ) && ! empty( $r['anonymous_data']['bbp_anonymous_email'] ) ) ) { 689 689 $clauses = get_meta_sql( array( array( 690 690 'key' => '_bbp_anonymous_email', … … 706 706 // Prepare duplicate check query 707 707 $query = $bbp_db->prepare( "SELECT ID FROM {$bbp_db->posts} {$join} WHERE post_type = %s AND post_status != %s AND post_author = %d AND post_content = %s {$where}", $r['post_type'], $r['post_status'], $r['post_author'], $r['post_content'] ); 708 $query .= ! empty( $r['post_parent'] ) ? $bbp_db->prepare( " AND post_parent = %d", $r['post_parent'] ) : '';708 $query .= ! empty( $r['post_parent'] ) ? $bbp_db->prepare( " AND post_parent = %d", $r['post_parent'] ) : ''; 709 709 $query .= " LIMIT 1"; 710 710 $dupe = apply_filters( 'bbp_check_for_duplicate_query', $query, $r ); … … 749 749 750 750 // User is anonymous, so check a transient based on the IP 751 if ( ! empty( $anonymous_data ) && is_array( $anonymous_data ) ) {751 if ( ! empty( $anonymous_data ) && is_array( $anonymous_data ) ) { 752 752 $last_posted = get_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted' ); 753 753 754 if ( ! empty( $last_posted ) && time() < $last_posted + $throttle_time ) {754 if ( ! empty( $last_posted ) && time() < $last_posted + $throttle_time ) { 755 755 return false; 756 756 } 757 757 758 758 // User is logged in, so check their last posted time 759 } elseif ( ! empty( $author_id ) ) {759 } elseif ( ! empty( $author_id ) ) { 760 760 $author_id = (int) $author_id; 761 761 $last_posted = bbp_get_user_last_posted( $author_id ); … … 816 816 817 817 // If data exists, map it 818 if ( ! empty( $user ) ) {818 if ( ! empty( $user ) ) { 819 819 $_post['author'] = $user->display_name; 820 820 $_post['email'] = $user->user_email; … … 916 916 917 917 // Bail if keymaster is author 918 if ( ! empty( $author_id ) && bbp_is_user_keymaster( $author_id ) ) {918 if ( ! empty( $author_id ) && bbp_is_user_keymaster( $author_id ) ) { 919 919 return true; 920 920 } … … 936 936 937 937 // Map anonymous user data 938 if ( ! empty( $anonymous_data ) ) {938 if ( ! empty( $anonymous_data ) ) { 939 939 $_post['author'] = $anonymous_data['bbp_anonymous_name']; 940 940 $_post['email'] = $anonymous_data['bbp_anonymous_email']; … … 942 942 943 943 // Map current user data 944 } elseif ( ! empty( $author_id ) ) {944 } elseif ( ! empty( $author_id ) ) { 945 945 946 946 // Get author data … … 948 948 949 949 // If data exists, map it 950 if ( ! empty( $user ) ) {950 if ( ! empty( $user ) ) { 951 951 $_post['author'] = $user->display_name; 952 952 $_post['email'] = $user->user_email; … … 1074 1074 1075 1075 // Bail if subscriptions are turned off 1076 if ( ! bbp_is_subscriptions_active() ) {1076 if ( ! bbp_is_subscriptions_active() ) { 1077 1077 return false; 1078 1078 } … … 1087 1087 1088 1088 // Bail if topic is not published 1089 if ( ! bbp_is_topic_published( $topic_id ) ) {1089 if ( ! bbp_is_topic_published( $topic_id ) ) { 1090 1090 return false; 1091 1091 } … … 1094 1094 1095 1095 // Bail if reply is not published 1096 if ( ! bbp_is_reply_published( $reply_id ) ) {1096 if ( ! bbp_is_reply_published( $reply_id ) ) { 1097 1097 return false; 1098 1098 } … … 1167 1167 1168 1168 // Don't send notifications to the person who made the post 1169 if ( ! empty( $reply_author ) && (int) $user_id === (int) $reply_author ) {1169 if ( ! empty( $reply_author ) && (int) $user_id === (int) $reply_author ) { 1170 1170 continue; 1171 1171 } … … 1232 1232 1233 1233 // Bail if subscriptions are turned off 1234 if ( ! bbp_is_subscriptions_active() ) {1234 if ( ! bbp_is_subscriptions_active() ) { 1235 1235 return false; 1236 1236 } … … 1324 1324 1325 1325 // Don't send notifications to the person who made the post 1326 if ( ! empty( $topic_author ) && (int) $user_id === (int) $topic_author ) {1326 if ( ! empty( $topic_author ) && (int) $user_id === (int) $topic_author ) { 1327 1327 continue; 1328 1328 } … … 1385 1385 1386 1386 // Rejig the $redirect_to 1387 if ( ! isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to !== home_url( $_SERVER['REDIRECT_URL'] ) ) ) {1387 if ( ! isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to !== home_url( $_SERVER['REDIRECT_URL'] ) ) ) { 1388 1388 $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; 1389 1389 } … … 1429 1429 1430 1430 // Passively filter the args before the parse 1431 if ( ! empty( $filter_key ) ) {1431 if ( ! empty( $filter_key ) ) { 1432 1432 $r = apply_filters( 'bbp_before_' . $filter_key . '_parse_args', $r ); 1433 1433 } 1434 1434 1435 1435 // Parse 1436 if ( is_array( $defaults ) && ! empty( $defaults ) ) {1436 if ( is_array( $defaults ) && ! empty( $defaults ) ) { 1437 1437 $r = array_merge( $defaults, $r ); 1438 1438 } 1439 1439 1440 1440 // Aggressively filter the args after the parse 1441 if ( ! empty( $filter_key ) ) {1441 if ( ! empty( $filter_key ) ) { 1442 1442 $r = apply_filters( 'bbp_after_' . $filter_key . '_parse_args', $r ); 1443 1443 } … … 1884 1884 1885 1885 // Single forum 1886 if ( ! empty( $select_query_vars ) ) {1886 if ( ! empty( $select_query_vars ) ) { 1887 1887 1888 1888 // Load up our own query … … 1902 1902 1903 1903 // Only forum replies 1904 if ( ! empty( $_GET['type'] ) && ( bbp_get_reply_post_type() === $_GET['type'] ) ) {1904 if ( ! empty( $_GET['type'] ) && ( bbp_get_reply_post_type() === $_GET['type'] ) ) { 1905 1905 1906 1906 // The query … … 1920 1920 1921 1921 // Only forum topics 1922 } elseif ( ! empty( $_GET['type'] ) && ( bbp_get_topic_post_type() === $_GET['type'] ) ) {1922 } elseif ( ! empty( $_GET['type'] ) && ( bbp_get_topic_post_type() === $_GET['type'] ) ) { 1923 1923 1924 1924 // The query … … 1966 1966 1967 1967 // Single topic 1968 if ( ! empty( $select_query_vars ) ) {1968 if ( ! empty( $select_query_vars ) ) { 1969 1969 1970 1970 // Load up our own query … … 2021 2021 2022 2022 // We have a view to display a feed 2023 if ( ! empty( $view ) ) {2023 if ( ! empty( $view ) ) { 2024 2024 2025 2025 // Get the view query … … 2057 2057 2058 2058 // Path is not empty 2059 if ( ! empty( $path ) ) {2059 if ( ! empty( $path ) ) { 2060 2060 2061 2061 // Pretty permalinks are on so path might exist -
trunk/src/includes/common/shortcodes.php
r5466 r5829 224 224 225 225 // Sanity check required info 226 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) {226 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) { 227 227 return $content; 228 228 } … … 232 232 233 233 // Bail if ID passed is not a forum 234 if ( ! bbp_is_forum( $forum_id ) ) {234 if ( ! bbp_is_forum( $forum_id ) ) { 235 235 return $content; 236 236 } … … 320 320 321 321 // Sanity check required info 322 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) {322 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) { 323 323 return $content; 324 324 } … … 332 332 333 333 // Bail if ID passed is not a topic 334 if ( ! bbp_is_topic( $topic_id ) ) {334 if ( ! bbp_is_topic( $topic_id ) ) { 335 335 return $content; 336 336 } 337 337 338 338 // Reset the queries if not in theme compat 339 if ( ! bbp_is_theme_compat_active() ) {339 if ( ! bbp_is_theme_compat_active() ) { 340 340 341 341 $bbp = bbpress(); … … 386 386 387 387 // Sanity check supplied info 388 if ( ! empty( $content ) || ( !empty( $attr['forum_id'] ) && ( !is_numeric( $attr['forum_id'] ) || !bbp_is_forum( $attr['forum_id'] ) ) ) ) {388 if ( ! empty( $content ) || ( ! empty( $attr['forum_id'] ) && ( !is_numeric( $attr['forum_id'] ) || ! bbp_is_forum( $attr['forum_id'] ) ) ) ) { 389 389 return $content; 390 390 } … … 394 394 395 395 // If forum id is set, use the 'bbp_single_forum' query name 396 if ( ! empty( $attr['forum_id'] ) ) {396 if ( ! empty( $attr['forum_id'] ) ) { 397 397 398 398 // Set the global current_forum_id for future requests … … 441 441 442 442 // Sanity check required info 443 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) {443 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) { 444 444 return $content; 445 445 } … … 453 453 454 454 // Bail if ID passed is not a reply 455 if ( ! bbp_is_reply( $reply_id ) ) {455 if ( ! bbp_is_reply( $reply_id ) ) { 456 456 return $content; 457 457 } 458 458 459 459 // Reset the queries if not in theme compat 460 if ( ! bbp_is_theme_compat_active() ) {460 if ( ! bbp_is_theme_compat_active() ) { 461 461 462 462 $bbp = bbpress(); … … 553 553 554 554 // Sanity check required info 555 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) {555 if ( ! empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) { 556 556 return $content; 557 557 } … … 688 688 689 689 // Sanity check required info 690 if ( ! empty( $content ) ) {690 if ( ! empty( $content ) ) { 691 691 return $content; 692 692 } -
trunk/src/includes/common/template.php
r5827 r5829 130 130 131 131 // Supplied ID is a forum 132 if ( ! empty( $post_id ) && ( bbp_get_forum_post_type() === get_post_type( $post_id ) ) ) {132 if ( ! empty( $post_id ) && ( bbp_get_forum_post_type() === get_post_type( $post_id ) ) ) { 133 133 $retval = true; 134 134 } … … 154 154 155 155 // In forum archive 156 if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) || ! empty( $wp_query->bbp_show_topics_on_root ) ) {156 if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) || ! empty( $wp_query->bbp_show_topics_on_root ) ) { 157 157 $retval = true; 158 158 } … … 206 206 207 207 // Check query 208 if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) ) {208 if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) ) { 209 209 $retval = true; 210 210 211 211 // Editing in admin 212 } elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_forum_post_type() ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) {212 } elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_forum_post_type() ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) { 213 213 $retval = true; 214 214 } … … 233 233 234 234 // Supplied ID is a topic 235 if ( ! empty( $post_id ) && ( bbp_get_topic_post_type() === get_post_type( $post_id ) ) ) {235 if ( ! empty( $post_id ) && ( bbp_get_topic_post_type() === get_post_type( $post_id ) ) ) { 236 236 $retval = true; 237 237 } … … 308 308 309 309 // Check query 310 if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) ) {310 if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) ) { 311 311 $retval = true; 312 312 313 313 // Editing in admin 314 } elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_topic_post_type() ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) {314 } elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_topic_post_type() ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) { 315 315 $retval = true; 316 316 } … … 333 333 334 334 // Check topic edit and GET params 335 if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'merge' === $_GET['action'] ) ) {335 if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'merge' === $_GET['action'] ) ) { 336 336 return true; 337 337 } … … 354 354 355 355 // Check topic edit and GET params 356 if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'split' === $_GET['action'] ) ) {356 if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'split' === $_GET['action'] ) ) { 357 357 $retval = true; 358 358 } … … 384 384 385 385 // Check tax and query vars 386 if ( is_tax( bbp_get_topic_tag_tax_id() ) || ! empty( bbpress()->topic_query->is_tax ) || get_query_var( 'bbp_topic_tag' ) ) {386 if ( is_tax( bbp_get_topic_tag_tax_id() ) || ! empty( bbpress()->topic_query->is_tax ) || get_query_var( 'bbp_topic_tag' ) ) { 387 387 $retval = true; 388 388 } … … 411 411 412 412 // Check query 413 if ( ! empty( $wp_query->bbp_is_topic_tag_edit ) && ( true === $wp_query->bbp_is_topic_tag_edit ) ) {413 if ( ! empty( $wp_query->bbp_is_topic_tag_edit ) && ( true === $wp_query->bbp_is_topic_tag_edit ) ) { 414 414 $retval = true; 415 415 416 416 // Editing in admin 417 } elseif ( is_admin() && ( 'edit-tags.php' === $pagenow ) && ( bbp_get_topic_tag_tax_id() === $taxnow ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) {417 } elseif ( is_admin() && ( 'edit-tags.php' === $pagenow ) && ( bbp_get_topic_tag_tax_id() === $taxnow ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) { 418 418 $retval = true; 419 419 } … … 468 468 469 469 // Supplied ID is a reply 470 if ( ! empty( $post_id ) && ( bbp_get_reply_post_type() === get_post_type( $post_id ) ) ) {470 if ( ! empty( $post_id ) && ( bbp_get_reply_post_type() === get_post_type( $post_id ) ) ) { 471 471 $retval = true; 472 472 } … … 490 490 491 491 // Check query 492 if ( ! empty( $wp_query->bbp_is_reply_edit ) && ( true === $wp_query->bbp_is_reply_edit ) ) {492 if ( ! empty( $wp_query->bbp_is_reply_edit ) && ( true === $wp_query->bbp_is_reply_edit ) ) { 493 493 $retval = true; 494 494 495 495 // Editing in admin 496 } elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_reply_post_type() ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) {496 } elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_reply_post_type() ) && ( ! empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) ) { 497 497 $retval = true; 498 498 } … … 513 513 514 514 // Check reply edit and GET params 515 if ( bbp_is_reply_edit() && ! empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) {515 if ( bbp_is_reply_edit() && ! empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) { 516 516 $retval = true; 517 517 } … … 564 564 565 565 // Check query 566 if ( ! empty( $wp_query->bbp_is_single_user_favs ) && ( true === $wp_query->bbp_is_single_user_favs ) ) {566 if ( ! empty( $wp_query->bbp_is_single_user_favs ) && ( true === $wp_query->bbp_is_single_user_favs ) ) { 567 567 $retval = true; 568 568 } … … 585 585 586 586 // Check query 587 if ( ! empty( $wp_query->bbp_is_single_user_subs ) && ( true === $wp_query->bbp_is_single_user_subs ) ) {587 if ( ! empty( $wp_query->bbp_is_single_user_subs ) && ( true === $wp_query->bbp_is_single_user_subs ) ) { 588 588 $retval = true; 589 589 } … … 607 607 608 608 // Check query 609 if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) {609 if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) { 610 610 $retval = true; 611 611 } … … 629 629 630 630 // Check query 631 if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) {631 if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) { 632 632 $retval = true; 633 633 } … … 653 653 654 654 // Check query 655 if ( ! empty( $wp_query->bbp_is_single_user_home ) && ( true === $wp_query->bbp_is_single_user_home ) ) {655 if ( ! empty( $wp_query->bbp_is_single_user_home ) && ( true === $wp_query->bbp_is_single_user_home ) ) { 656 656 $retval = true; 657 657 } … … 697 697 698 698 // Check query 699 if ( ! empty( $wp_query->bbp_is_single_user ) && ( true === $wp_query->bbp_is_single_user ) ) {699 if ( ! empty( $wp_query->bbp_is_single_user ) && ( true === $wp_query->bbp_is_single_user ) ) { 700 700 $retval = true; 701 701 } … … 719 719 720 720 // Check query 721 if ( ! empty( $wp_query->bbp_is_single_user_edit ) && ( true === $wp_query->bbp_is_single_user_edit ) ) {721 if ( ! empty( $wp_query->bbp_is_single_user_edit ) && ( true === $wp_query->bbp_is_single_user_edit ) ) { 722 722 $retval = true; 723 723 } … … 741 741 742 742 // Check query 743 if ( ! empty( $wp_query->bbp_is_single_user_profile ) && ( true === $wp_query->bbp_is_single_user_profile ) ) {743 if ( ! empty( $wp_query->bbp_is_single_user_profile ) && ( true === $wp_query->bbp_is_single_user_profile ) ) { 744 744 $retval = true; 745 745 } … … 763 763 764 764 // Check query 765 if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) {765 if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) { 766 766 $retval = true; 767 767 } … … 785 785 786 786 // Check query 787 if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) {787 if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) { 788 788 $retval = true; 789 789 } … … 808 808 809 809 // Check query 810 if ( ! empty( $wp_query->bbp_is_view ) && ( true === $wp_query->bbp_is_view ) ) {810 if ( ! empty( $wp_query->bbp_is_view ) && ( true === $wp_query->bbp_is_view ) ) { 811 811 $retval = true; 812 812 } … … 841 841 842 842 // Check query 843 if ( ! empty( $wp_query->bbp_is_search ) && ( true === $wp_query->bbp_is_search ) ) {843 if ( ! empty( $wp_query->bbp_is_search ) && ( true === $wp_query->bbp_is_search ) ) { 844 844 $retval = true; 845 845 } … … 879 879 880 880 // Check query 881 if ( ! empty( $wp_query->bbp_search_terms ) ) {881 if ( ! empty( $wp_query->bbp_search_terms ) ) { 882 882 $retval = true; 883 883 } … … 889 889 890 890 // Check $_REQUEST 891 if ( empty( $retval ) && ! empty( $_REQUEST[ bbp_get_search_rewrite_id() ] ) ) {891 if ( empty( $retval ) && ! empty( $_REQUEST[ bbp_get_search_rewrite_id() ] ) ) { 892 892 $retval = true; 893 893 } … … 911 911 912 912 // Check query 913 if ( ! empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) ) {913 if ( ! empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) ) { 914 914 $retval = true; 915 915 } … … 1058 1058 1059 1059 // Add bbPress class if we are within a bbPress page 1060 if ( ! empty( $bbp_classes ) ) {1060 if ( ! empty( $bbp_classes ) ) { 1061 1061 $bbp_classes[] = 'bbpress'; 1062 1062 } … … 1467 1467 1468 1468 // Force array 1469 if ( ! empty( $r['exclude'] ) && !is_array( $r['exclude'] ) ) {1469 if ( ! empty( $r['exclude'] ) && !is_array( $r['exclude'] ) ) { 1470 1470 $r['exclude'] = explode( ',', $r['exclude'] ); 1471 1471 } … … 1499 1499 1500 1500 // Setup the tab index attribute 1501 $tab = ! empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : '';1501 $tab = ! empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : ''; 1502 1502 1503 1503 // Open the select tag … … 1506 1506 1507 1507 // Display a leading 'no-value' option, with or without custom text 1508 if ( ! empty( $r['show_none'] ) || !empty( $r['none_found'] ) ) {1508 if ( ! empty( $r['show_none'] ) || ! empty( $r['none_found'] ) ) { 1509 1509 1510 1510 // Open the 'no-value' option tag … … 1547 1547 1548 1548 // Items found so walk the tree 1549 if ( ! empty( $r['posts'] ) ) {1549 if ( ! empty( $r['posts'] ) ) { 1550 1550 $retval .= walk_page_dropdown_tree( $r['posts'], 0, $r ); 1551 1551 } … … 1817 1817 1818 1818 // Output something before the editor 1819 if ( ! empty( $r['before'] ) ) {1819 if ( ! empty( $r['before'] ) ) { 1820 1820 echo $r['before']; 1821 1821 } … … 1859 1859 1860 1860 // Setup the tab index attribute 1861 $tab = ! empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : ''; ?>1861 $tab = ! empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : ''; ?> 1862 1862 1863 1863 <textarea id="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" class="<?php echo esc_attr( $r['editor_class'] ); ?>" name="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" cols="60" rows="<?php echo esc_attr( $r['textarea_rows'] ); ?>" <?php echo $tab; ?>><?php echo $post_content; ?></textarea> … … 1866 1866 1867 1867 // Output something after the editor 1868 if ( ! empty( $r['after'] ) ) {1868 if ( ! empty( $r['after'] ) ) { 1869 1869 echo $r['after']; 1870 1870 } … … 1983 1983 $bbp = bbpress(); 1984 1984 1985 if ( ! empty( $view ) ) {1985 if ( ! empty( $view ) ) { 1986 1986 $view = sanitize_title( $view ); 1987 1987 } elseif ( ! empty( $bbp->current_view_id ) ) { … … 2203 2203 2204 2204 // Set home text to page title 2205 if ( ! empty( $front_id ) ) {2205 if ( ! empty( $front_id ) ) { 2206 2206 $pre_front_text = get_the_title( $front_id ); 2207 2207 … … 2217 2217 if ( empty( $args['root_text'] ) ) { 2218 2218 $page = bbp_get_page_by_path( bbp_get_root_slug() ); 2219 if ( ! empty( $page ) ) {2219 if ( ! empty( $page ) ) { 2220 2220 $root_id = $page->ID; 2221 2221 } … … 2226 2226 2227 2227 // Root slug is also the front page 2228 if ( ! empty( $front_id ) && ( $front_id === $root_id ) ) {2228 if ( ! empty( $front_id ) && ( $front_id === $root_id ) ) { 2229 2229 $pre_include_root = false; 2230 2230 } … … 2236 2236 2237 2237 // Don't show root if viewing page in place of forum archive 2238 if ( ! empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id === get_the_ID() ) ) ) {2238 if ( ! empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id === get_the_ID() ) ) ) { 2239 2239 $pre_include_root = false; 2240 2240 } … … 2271 2271 2272 2272 // Topic Tag (or theme compat topic tag) 2273 } elseif ( bbp_is_topic_tag() || ( get_query_var( 'bbp_topic_tag' ) && ! bbp_is_topic_tag_edit() ) ) {2273 } elseif ( bbp_is_topic_tag() || ( get_query_var( 'bbp_topic_tag' ) && ! bbp_is_topic_tag_edit() ) ) { 2274 2274 2275 2275 // Always include the tag name … … 2335 2335 2336 2336 // Do we want to include a link to home? 2337 if ( ! empty( $r['include_home'] ) || empty( $r['home_text'] ) ) {2337 if ( ! empty( $r['include_home'] ) || empty( $r['home_text'] ) ) { 2338 2338 $crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>'; 2339 2339 } 2340 2340 2341 2341 // Do we want to include a link to the forum root? 2342 if ( ! empty( $r['include_root'] ) || empty( $r['root_text'] ) ) {2342 if ( ! empty( $r['include_root'] ) || empty( $r['root_text'] ) ) { 2343 2343 2344 2344 // Page exists at root slug path, so use its permalink 2345 2345 $page = bbp_get_page_by_path( bbp_get_root_slug() ); 2346 if ( ! empty( $page ) ) {2346 if ( ! empty( $page ) ) { 2347 2347 $root_url = get_permalink( $page->ID ); 2348 2348 … … 2357 2357 2358 2358 // Ancestors exist 2359 if ( ! empty( $ancestors ) ) {2359 if ( ! empty( $ancestors ) ) { 2360 2360 2361 2361 // Loop through parents … … 2407 2407 2408 2408 // Add current page to breadcrumb 2409 if ( ! empty( $r['include_current'] ) || empty( $r['current_text'] ) ) {2409 if ( ! empty( $r['include_current'] ) || empty( $r['current_text'] ) ) { 2410 2410 $crumbs[] = $r['current_before'] . $r['current_text'] . $r['current_after']; 2411 2411 } … … 2421 2421 2422 2422 // Pad the separator 2423 if ( ! empty( $r['pad_sep'] ) ) {2423 if ( ! empty( $r['pad_sep'] ) ) { 2424 2424 if ( function_exists( 'mb_strlen' ) ) { 2425 2425 $sep = str_pad( $sep, mb_strlen( $sep ) + ( (int) $r['pad_sep'] * 2 ), ' ', STR_PAD_BOTH ); … … 2436 2436 2437 2437 // Build the trail 2438 $trail = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] , $crumbs ) . $r['crumb_after'] . $r['after'] ) : '';2438 $trail = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] , $crumbs ) . $r['crumb_after'] . $r['after'] ) : ''; 2439 2439 2440 2440 return apply_filters( 'bbp_get_breadcrumb', $trail, $crumbs, $r ); … … 2501 2501 2502 2502 // Bail if no notices or errors 2503 if ( ! bbp_has_errors() ) {2503 if ( ! bbp_has_errors() ) { 2504 2504 return; 2505 2505 } … … 2528 2528 2529 2529 // Display errors first... 2530 if ( ! empty( $errors ) ) : ?>2530 if ( ! empty( $errors ) ) : ?> 2531 2531 2532 2532 <div class="bbp-template-notice error" role="alert" tabindex="-1"> … … 2539 2539 2540 2540 // ...and messages last 2541 if ( ! empty( $messages ) ) : ?>2541 if ( ! empty( $messages ) ) : ?> 2542 2542 2543 2543 <div class="bbp-template-notice"> … … 2753 2753 $prefix = ''; 2754 2754 2755 if ( ! empty( $new_title ) ) {2755 if ( ! empty( $new_title ) ) { 2756 2756 $prefix = " $sep "; 2757 2757 } -
trunk/src/includes/common/widgets.php
r5793 r5829 79 79 echo $args['before_widget']; 80 80 81 if ( ! empty( $settings['title'] ) ) {81 if ( ! empty( $settings['title'] ) ) { 82 82 echo $args['before_title'] . $settings['title'] . $args['after_title']; 83 83 } … … 114 114 </div> 115 115 116 <?php if ( ! empty( $settings['register'] ) || !empty( $settings['lostpass'] ) ) : ?>116 <?php if ( ! empty( $settings['register'] ) || ! empty( $settings['lostpass'] ) ) : ?> 117 117 118 118 <div class="bbp-login-links"> 119 119 120 <?php if ( ! empty( $settings['register'] ) ) : ?>120 <?php if ( ! empty( $settings['register'] ) ) : ?> 121 121 122 122 <a href="<?php echo esc_url( $settings['register'] ); ?>" title="<?php esc_attr_e( 'Register', 'bbpress' ); ?>" class="bbp-register-link"><?php _e( 'Register', 'bbpress' ); ?></a> … … 124 124 <?php endif; ?> 125 125 126 <?php if ( ! empty( $settings['lostpass'] ) ) : ?>126 <?php if ( ! empty( $settings['lostpass'] ) ) : ?> 127 127 128 128 <a href="<?php echo esc_url( $settings['lostpass'] ); ?>" title="<?php esc_attr_e( 'Lost Password', 'bbpress' ); ?>" class="bbp-lostpass-link"><?php _e( 'Lost Password', 'bbpress' ); ?></a> … … 288 288 echo $args['before_widget']; 289 289 290 if ( ! empty( $settings['title'] ) ) {290 if ( ! empty( $settings['title'] ) ) { 291 291 echo $args['before_title'] . $settings['title'] . $args['after_title']; 292 292 } ?> … … 425 425 echo $args['before_widget']; 426 426 427 if ( ! empty( $settings['title'] ) ) {427 if ( ! empty( $settings['title'] ) ) { 428 428 echo $args['before_title'] . $settings['title'] . $args['after_title']; 429 429 } … … 577 577 echo $args['before_widget']; 578 578 579 if ( ! empty( $settings['title'] ) ) {579 if ( ! empty( $settings['title'] ) ) { 580 580 echo $args['before_title'] . $settings['title'] . $args['after_title']; 581 581 } ?> … … 611 611 612 612 // Force to any 613 if ( ! empty( $instance['parent_forum'] ) && !is_numeric( $instance['parent_forum'] ) ) {613 if ( ! empty( $instance['parent_forum'] ) && !is_numeric( $instance['parent_forum'] ) ) { 614 614 $instance['parent_forum'] = 'any'; 615 615 } … … 794 794 echo $args['before_widget']; 795 795 796 if ( ! empty( $settings['title'] ) ) {796 if ( ! empty( $settings['title'] ) ) { 797 797 echo $args['before_title'] . $settings['title'] . $args['after_title']; 798 798 } ?> … … 856 856 857 857 // Force to any 858 if ( ! empty( $instance['parent_forum'] ) && !is_numeric( $instance['parent_forum'] ) ) {858 if ( ! empty( $instance['parent_forum'] ) && !is_numeric( $instance['parent_forum'] ) ) { 859 859 $instance['parent_forum'] = 'any'; 860 860 } … … 990 990 echo $args['before_widget']; 991 991 992 if ( ! empty( $settings['title'] ) ) {992 if ( ! empty( $settings['title'] ) ) { 993 993 echo $args['before_title'] . $settings['title'] . $args['after_title']; 994 994 } … … 1140 1140 echo $args['before_widget']; 1141 1141 1142 if ( ! empty( $settings['title'] ) ) {1142 if ( ! empty( $settings['title'] ) ) { 1143 1143 echo $args['before_title'] . $settings['title'] . $args['after_title']; 1144 1144 } ?> … … 1164 1164 1165 1165 // Reply author, link, and timestamp 1166 if ( ! empty( $settings['show_date'] ) && ! empty( $author_link ) ) :1166 if ( ! empty( $settings['show_date'] ) && ! empty( $author_link ) ) : 1167 1167 1168 1168 // translators: 1: reply author, 2: reply link, 3: reply timestamp … … 1176 1176 1177 1177 // Reply author and title 1178 elseif ( ! empty( $author_link ) ) :1178 elseif ( ! empty( $author_link ) ) : 1179 1179 1180 1180 // translators: 1: reply author, 2: reply link -
trunk/src/includes/core/extend.php
r5770 r5829 29 29 30 30 // Bail if Akismet is turned off 31 if ( ! bbp_is_akismet_active() ) {31 if ( ! bbp_is_akismet_active() ) { 32 32 return; 33 33 } -
trunk/src/includes/core/functions.php
r5823 r5829 196 196 197 197 // Set show_stickies to false if it wasn't supplied 198 if ( ! isset( $query_args['show_stickies'] ) ) {198 if ( ! isset( $query_args['show_stickies'] ) ) { 199 199 $query_args['show_stickies'] = false; 200 200 } … … 222 222 $view = sanitize_title( $view ); 223 223 224 if ( ! isset( $bbp->views[ $view ] ) ) {224 if ( ! isset( $bbp->views[ $view ] ) ) { 225 225 return false; 226 226 } … … 253 253 $query_args = bbp_get_view_query_args( $view ); 254 254 255 if ( ! empty( $new_args ) ) {255 if ( ! empty( $new_args ) ) { 256 256 $new_args = bbp_parse_args( $new_args, '', 'view_query' ); 257 257 $query_args = array_merge( $query_args, $new_args ); … … 272 272 function bbp_get_view_query_args( $view ) { 273 273 $view = bbp_get_view_id( $view ); 274 $retval = ! empty( $view ) ? bbpress()->views[$view]['query'] : false;274 $retval = ! empty( $view ) ? bbpress()->views[$view]['query'] : false; 275 275 276 276 return apply_filters( 'bbp_get_view_query_args', $retval, $view ); -
trunk/src/includes/core/template-functions.php
r5813 r5829 103 103 104 104 // Maybe load the template if one was located 105 if ( ( defined( 'WP_USE_THEMES' ) && WP_USE_THEMES ) && ( true === $load ) && ! empty( $located ) ) {105 if ( ( defined( 'WP_USE_THEMES' ) && WP_USE_THEMES ) && ( true === $load ) && ! empty( $located ) ) { 106 106 load_template( $located, $require_once ); 107 107 } … … 158 158 159 159 // Enqueue if located 160 if ( ! empty( $located ) ) {160 if ( ! empty( $located ) ) { 161 161 162 162 $content_dir = constant( 'WP_CONTENT_DIR' ); … … 226 226 227 227 // Enqueue if located 228 if ( ! empty( $located ) ) {228 if ( ! empty( $located ) ) { 229 229 230 230 $content_dir = constant( 'WP_CONTENT_DIR' ); … … 504 504 505 505 // It is a user page - We'll also check if it is user edit 506 if ( ! empty( $bbp_user ) ) {506 if ( ! empty( $bbp_user ) ) { 507 507 508 508 /** Find User *********************************************************/ … … 534 534 535 535 // View or edit? 536 if ( ! empty( $is_edit ) ) {536 if ( ! empty( $is_edit ) ) { 537 537 538 538 // We are editing a profile … … 602 602 603 603 // View Page 604 } elseif ( ! empty( $bbp_view ) ) {604 } elseif ( ! empty( $bbp_view ) ) { 605 605 606 606 // Check if the view exists by checking if there are query args are set … … 624 624 // Check if there are search query args set 625 625 $search_terms = bbp_get_search_terms(); 626 if ( ! empty( $search_terms ) ) {626 if ( ! empty( $search_terms ) ) { 627 627 $posts_query->bbp_search_terms = $search_terms; 628 628 } … … 635 635 636 636 // Forum/Topic/Reply Edit Page 637 } elseif ( ! empty( $is_edit ) ) {637 } elseif ( ! empty( $is_edit ) ) { 638 638 639 639 // Get the post type from the main query loop … … 641 641 642 642 // Check which post_type we are editing, if any 643 if ( ! empty( $post_type ) ) {643 if ( ! empty( $post_type ) ) { 644 644 switch( $post_type ) { 645 645 -
trunk/src/includes/core/template-loader.php
r5770 r5829 111 111 // A bbPress template file was located, so override the WordPress template 112 112 // and use it to switch off bbPress's theme compatibility. 113 if ( ! empty( $new_template ) ) {113 if ( ! empty( $new_template ) ) { 114 114 $template = bbp_set_template_included( $new_template ); 115 115 } … … 160 160 } 161 161 162 if ( ! defined( 'WP_INSTALLING' ) || ( ! empty( $pagenow ) && ( 'wp-activate.php' !== $pagenow ) ) ) {162 if ( ! defined( 'WP_INSTALLING' ) || ( ! empty( $pagenow ) && ( 'wp-activate.php' !== $pagenow ) ) ) { 163 163 bbp_locate_template( 'bbpress-functions.php', true ); 164 164 } -
trunk/src/includes/core/theme-compat.php
r5827 r5829 536 536 // Reset post 537 537 bbp_theme_compat_reset_post( array( 538 'ID' => ! empty( $page->ID ) ? $page->ID : 0,538 'ID' => ! empty( $page->ID ) ? $page->ID : 0, 539 539 'post_title' => $new_title, 540 540 'post_author' => 0, … … 606 606 // Reset post 607 607 bbp_theme_compat_reset_post( array( 608 'ID' => ! empty( $page->ID ) ? $page->ID : 0,608 'ID' => ! empty( $page->ID ) ? $page->ID : 0, 609 609 'post_title' => bbp_get_topic_archive_title(), 610 610 'post_author' => 0, … … 877 877 878 878 // Filters exist in this priority 879 if ( ! empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) {879 if ( ! empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) { 880 880 881 881 // Store filters in a backup … … 929 929 930 930 // Filters exist in this priority 931 if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[$tag][$priority] ) ) {931 if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[$tag][$priority] ) ) { 932 932 933 933 // Store filters in a backup -
trunk/src/includes/core/update.php
r5775 r5829 68 68 69 69 // Bail if not activating 70 if ( empty( $action ) || ! in_array( $action, array( 'activate', 'activate-selected' ) ) ) {70 if ( empty( $action ) || ! in_array( $action, array( 'activate', 'activate-selected' ) ) ) { 71 71 return false; 72 72 } … … 80 80 81 81 // Set basename if empty 82 if ( empty( $basename ) && ! empty( $bbp->basename ) ) {82 if ( empty( $basename ) && ! empty( $bbp->basename ) ) { 83 83 $basename = $bbp->basename; 84 84 } … … 117 117 118 118 // Bail if not deactivating 119 if ( empty( $action ) || ! in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) {119 if ( empty( $action ) || ! in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) { 120 120 return false; 121 121 } … … 129 129 130 130 // Set basename if empty 131 if ( empty( $basename ) && ! empty( $bbp->basename ) ) {131 if ( empty( $basename ) && ! empty( $bbp->basename ) ) { 132 132 $basename = $bbp->basename; 133 133 } -
trunk/src/includes/extend/akismet.php
r5828 r5829 397 397 398 398 // Key should not be ignored 399 if ( ! in_array( $key, $ignore ) && is_string( $value ) ) {399 if ( ! in_array( $key, $ignore ) && is_string( $value ) ) { 400 400 $post_data[$key] = $value; 401 401 … … 422 422 423 423 // Check the high-speed cam 424 if ( ! empty( $response[1] ) ) {424 if ( ! empty( $response[1] ) ) { 425 425 $post_data['bbp_akismet_result'] = $response[1]; 426 426 } else { … … 462 462 463 463 // Set up Akismet last post data 464 if ( ! empty( $this->last_post ) ) {464 if ( ! empty( $this->last_post ) ) { 465 465 $as_submitted = $this->last_post['bbp_post_as_submitted']; 466 466 } … … 468 468 // wp_insert_post() might be called in other contexts. Ensure this is 469 469 // the same topic/reply as was checked by BBP_Akismet::check_post() 470 if ( is_object( $_post ) && ! empty( $this->last_post ) && is_array( $as_submitted ) ) {470 if ( is_object( $_post ) && ! empty( $this->last_post ) && is_array( $as_submitted ) ) { 471 471 472 472 // Get user data … … 612 612 613 613 // Save the terms for later in case the reply gets hammed 614 if ( ! empty( $terms ) ) {614 if ( ! empty( $terms ) ) { 615 615 update_post_meta( $reply_id, '_bbp_akismet_spam_terms', $terms ); 616 616 } … … 649 649 650 650 // Use specific IP (if provided) 651 if ( ! empty( $ip ) && long2ip( ip2long( $ip ) ) ) {651 if ( ! empty( $ip ) && long2ip( ip2long( $ip ) ) ) { 652 652 $http_host = $ip; 653 653 } … … 758 758 <div class="akismet-history" style="margin: 13px 0;"> 759 759 760 <?php if ( ! empty( $history ) ) : ?>760 <?php if ( ! empty( $history ) ) : ?> 761 761 762 762 <table> -
trunk/src/includes/extend/buddypress/activity.php
r5770 r5829 386 386 387 387 // Bail early if topic is by anonymous user 388 if ( ! empty( $anonymous_data ) ) {388 if ( ! empty( $anonymous_data ) ) { 389 389 return; 390 390 } 391 391 392 392 // Bail if site is private 393 if ( ! bbp_is_site_public() ) {393 if ( ! bbp_is_site_public() ) { 394 394 return; 395 395 } … … 406 406 407 407 // Bail if topic is not published 408 if ( ! bbp_is_topic_published( $topic_id ) ) {408 if ( ! bbp_is_topic_published( $topic_id ) ) { 409 409 return; 410 410 } … … 444 444 445 445 // Add the activity entry ID as a meta value to the topic 446 if ( ! empty( $activity_id ) ) {446 if ( ! empty( $activity_id ) ) { 447 447 update_post_meta( $topic_id, '_bbp_activity_id', $activity_id ); 448 448 } … … 459 459 // Get activity ID, bail if it doesn't exist 460 460 $activity_id = $this->get_activity_id( $topic_id ); 461 if ( ! empty( $activity_id ) ) {461 if ( ! empty( $activity_id ) ) { 462 462 return bp_activity_delete( array( 'id' => $activity_id ) ); 463 463 } … … 535 535 536 536 // Do not log activity of anonymous users 537 if ( ! empty( $anonymous_data ) ) {537 if ( ! empty( $anonymous_data ) ) { 538 538 return; 539 539 } 540 540 541 541 // Bail if site is private 542 if ( ! bbp_is_site_public() ) {542 if ( ! bbp_is_site_public() ) { 543 543 return; 544 544 } … … 556 556 557 557 // Bail if reply is not published 558 if ( ! bbp_is_reply_published( $reply_id ) ) {558 if ( ! bbp_is_reply_published( $reply_id ) ) { 559 559 return; 560 560 } … … 597 597 598 598 // Add the activity entry ID as a meta value to the reply 599 if ( ! empty( $activity_id ) ) {599 if ( ! empty( $activity_id ) ) { 600 600 update_post_meta( $reply_id, '_bbp_activity_id', $activity_id ); 601 601 } … … 613 613 // Get activity ID, bail if it doesn't exist 614 614 $activity_id = $this->get_activity_id( $reply_id ); 615 if ( ! empty( $activity_id ) ) {615 if ( ! empty( $activity_id ) ) { 616 616 return bp_activity_delete( array( 'id' => $activity_id ) ); 617 617 } -
trunk/src/includes/extend/buddypress/functions.php
r5770 r5829 25 25 26 26 // Use existing ID 27 if ( ! empty( bbpress()->extend->buddypress->id ) ) {27 if ( ! empty( bbpress()->extend->buddypress->id ) ) { 28 28 $retval = bbpress()->extend->buddypress->id; 29 29 … … 57 57 58 58 // Easy empty checking 59 if ( ! empty( $user_id ) && is_numeric( $user_id ) ) {59 if ( ! empty( $user_id ) && is_numeric( $user_id ) ) { 60 60 $bbp_user_id = $user_id; 61 61 } 62 62 63 63 // Currently viewing or editing a user 64 elseif ( ( true === $displayed_user_fallback ) && ! empty( $did ) ) {64 elseif ( ( true === $displayed_user_fallback ) && ! empty( $did ) ) { 65 65 $bbp_user_id = $did; 66 66 } 67 67 68 68 // Maybe fallback on the current_user ID 69 elseif ( ( true === $current_user_fallback ) && ! empty( $lid ) ) {69 elseif ( ( true === $current_user_fallback ) && ! empty( $lid ) ) { 70 70 $bbp_user_id = $lid; 71 71 } … … 84 84 */ 85 85 function bbp_filter_is_single_user( $is = false ) { 86 if ( ! empty( $is ) ) {86 if ( ! empty( $is ) ) { 87 87 return $is; 88 88 } … … 101 101 */ 102 102 function bbp_filter_is_user_home( $is = false ) { 103 if ( ! empty( $is ) ) {103 if ( ! empty( $is ) ) { 104 104 return $is; 105 105 } … … 303 303 304 304 // Get the forums 305 if ( ! empty( $group_id ) ) {305 if ( ! empty( $group_id ) ) { 306 306 $forum_ids = groups_get_groupmeta( $group_id, 'forum_id' ); 307 307 } … … 335 335 336 336 // Get the forums 337 if ( ! empty( $forum_id ) ) {337 if ( ! empty( $forum_id ) ) { 338 338 $group_ids = get_post_meta( $forum_id, '_bbp_group_ids', true ); 339 339 } … … 406 406 407 407 // Maybe update the groups forums 408 if ( ! in_array( $group_id, $group_ids ) ) {408 if ( ! in_array( $group_id, $group_ids ) ) { 409 409 $group_ids[] = $group_id; 410 410 return bbp_update_forum_group_ids( $forum_id, $group_ids ); … … 432 432 433 433 // Maybe update the groups forums 434 if ( ! in_array( $forum_id, $forum_ids ) ) {434 if ( ! in_array( $forum_id, $forum_ids ) ) { 435 435 $forum_ids[] = $forum_id; 436 436 return bbp_update_group_forum_ids( $group_id, $forum_ids ); … … 550 550 551 551 // Check if the forum has groups 552 $retval = (bool) ! empty( $group_ids );552 $retval = (bool) ! empty( $group_ids ); 553 553 554 554 return (bool) apply_filters( 'bbp_is_forum_group_forum', $retval, $forum_id, $group_ids ); -
trunk/src/includes/extend/buddypress/groups.php
r5822 r5829 268 268 269 269 // Get the first forum ID 270 if ( ! empty( $forum_ids ) ) {270 if ( ! empty( $forum_ids ) ) { 271 271 $forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids; 272 272 } … … 345 345 } 346 346 347 $edit_forum = ! empty( $_POST['bbp-edit-group-forum'] ) ? true : false;347 $edit_forum = ! empty( $_POST['bbp-edit-group-forum'] ) ? true : false; 348 348 $forum_id = 0; 349 $group_id = ! empty( $group_id ) ? $group_id : bp_get_current_group_id();349 $group_id = ! empty( $group_id ) ? $group_id : bp_get_current_group_id(); 350 350 351 351 // Keymasters have the ability to reconfigure forums … … 359 359 360 360 // Normalize group forum relationships now 361 if ( ! empty( $forum_ids ) ) {361 if ( ! empty( $forum_ids ) ) { 362 362 363 363 // Loop through forums, and make sure they exist … … 414 414 415 415 // If in admin, also include the group ID 416 if ( is_admin() && ! empty( $group_id ) ) {416 if ( is_admin() && ! empty( $group_id ) ) { 417 417 $new_forum_args['group_id'] = $group_id; 418 418 } … … 510 510 } 511 511 512 $create_forum = ! empty( $_POST['bbp-create-group-forum'] ) ? true : false;512 $create_forum = ! empty( $_POST['bbp-create-group-forum'] ) ? true : false; 513 513 $forum_id = 0; 514 514 $forum_ids = bbp_get_group_forum_ids( $group_id ); 515 515 516 if ( ! empty( $forum_ids ) ) {516 if ( ! empty( $forum_ids ) ) { 517 517 $forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids; 518 518 } … … 523 523 524 524 // Bail if initial content was already created 525 if ( ! empty( $forum_id ) ) {525 if ( ! empty( $forum_id ) ) { 526 526 return; 527 527 } … … 562 562 563 563 // Forum was created but is now being undone 564 if ( ! empty( $forum_id ) ) {564 if ( ! empty( $forum_id ) ) { 565 565 566 566 // Delete the forum … … 618 618 // Validate forum_id 619 619 $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); 620 $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id();620 $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id(); 621 621 622 622 bbp_add_forum_id_to_group( $group_id, $forum_id ); … … 645 645 // Validate forum_id 646 646 $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); 647 $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id();647 $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id(); 648 648 649 649 bbp_remove_forum_id_from_group( $group_id, $forum_id ); … … 843 843 844 844 // Merge 845 if ( ! empty( $_GET['action'] ) && 'merge' === $_GET['action'] ) :845 if ( ! empty( $_GET['action'] ) && 'merge' === $_GET['action'] ) : 846 846 bbp_set_query_name( 'bbp_topic_merge' ); 847 847 bbp_get_template_part( 'form', 'topic-merge' ); 848 848 849 849 // Split 850 elseif ( ! empty( $_GET['action'] ) && 'split' === $_GET['action'] ) :850 elseif ( ! empty( $_GET['action'] ) && 'split' === $_GET['action'] ) : 851 851 bbp_set_query_name( 'bbp_topic_split' ); 852 852 bbp_get_template_part( 'form', 'topic-split' ); … … 899 899 900 900 // Move 901 if ( ! empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) :901 if ( ! empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) : 902 902 bbp_set_query_name( 'bbp_reply_move' ); 903 903 bbp_get_template_part( 'form', 'reply-move' ); -
trunk/src/includes/extend/buddypress/notifications.php
r5658 r5829 56 56 $filter = 'bbp_multiple_new_subscription_notification'; 57 57 } else { 58 if ( ! empty( $secondary_item_id ) ) {58 if ( ! empty( $secondary_item_id ) ) { 59 59 $text = sprintf( __( 'You have %d new reply to %2$s from %3$s', 'bbpress' ), (int) $total_items, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) ); 60 60 } else { … … 99 99 100 100 // Bail if somehow this is hooked to an edit action 101 if ( ! empty( $is_edit ) ) {101 if ( ! empty( $is_edit ) ) { 102 102 return; 103 103 } … … 108 108 109 109 // Hierarchical replies 110 if ( ! empty( $reply_to ) ) {110 if ( ! empty( $reply_to ) ) { 111 111 $reply_to_item_id = bbp_get_topic_author_id( $reply_to ); 112 112 } … … 129 129 130 130 // Notify the immediate reply author if not the current reply author 131 if ( ! empty( $reply_to ) && ( $author_id !== $reply_to_item_id ) ) {131 if ( ! empty( $reply_to ) && ( $author_id !== $reply_to_item_id ) ) { 132 132 $args['secondary_item_id'] = $reply_to_item_id ; 133 133 -
trunk/src/includes/forums/capabilities.php
r5770 r5829 72 72 // Get the post 73 73 $_post = get_post( $args[0] ); 74 if ( ! empty( $_post ) ) {74 if ( ! empty( $_post ) ) { 75 75 76 76 // Get caps for post type object … … 127 127 // Get the post 128 128 $_post = get_post( $args[0] ); 129 if ( ! empty( $_post ) ) {129 if ( ! empty( $_post ) ) { 130 130 131 131 // Get caps for post type object … … 156 156 // Get the post 157 157 $_post = get_post( $args[0] ); 158 if ( ! empty( $_post ) ) {158 if ( ! empty( $_post ) ) { 159 159 160 160 // Get caps for post type object -
trunk/src/includes/forums/functions.php
r5827 r5829 142 142 143 143 // Remove kses filters from title and content for capable users and if the nonce is verified 144 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_forum'] ) && wp_create_nonce( 'bbp-unfiltered-html-forum_new' ) === $_POST['_bbp_unfiltered_html_forum'] ) {144 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_forum'] ) && wp_create_nonce( 'bbp-unfiltered-html-forum_new' ) === $_POST['_bbp_unfiltered_html_forum'] ) { 145 145 remove_filter( 'bbp_new_forum_pre_title', 'wp_filter_kses' ); 146 146 remove_filter( 'bbp_new_forum_pre_content', 'bbp_encode_bad', 10 ); … … 150 150 /** Forum Title ***********************************************************/ 151 151 152 if ( ! empty( $_POST['bbp_forum_title'] ) ) {152 if ( ! empty( $_POST['bbp_forum_title'] ) ) { 153 153 $forum_title = sanitize_text_field( $_POST['bbp_forum_title'] ); 154 154 } … … 164 164 /** Forum Content *********************************************************/ 165 165 166 if ( ! empty( $_POST['bbp_forum_content'] ) ) {166 if ( ! empty( $_POST['bbp_forum_content'] ) ) { 167 167 $forum_content = $_POST['bbp_forum_content']; 168 168 } … … 179 179 180 180 // Forum parent was passed (the norm) 181 if ( ! empty( $_POST['bbp_forum_parent_id'] ) ) {181 if ( ! empty( $_POST['bbp_forum_parent_id'] ) ) { 182 182 $forum_parent_id = bbp_get_forum_id( $_POST['bbp_forum_parent_id'] ); 183 183 } … … 191 191 192 192 // Forum exists 193 } elseif ( ! empty( $forum_parent_id ) ) {193 } elseif ( ! empty( $forum_parent_id ) ) { 194 194 195 195 // Forum is a category … … 216 216 /** Forum Flooding ********************************************************/ 217 217 218 if ( ! bbp_check_for_flood( $anonymous_data, $forum_author ) ) {218 if ( ! bbp_check_for_flood( $anonymous_data, $forum_author ) ) { 219 219 bbp_add_error( 'bbp_forum_flood', __( '<strong>ERROR</strong>: Slow down; you move too fast.', 'bbpress' ) ); 220 220 } … … 222 222 /** Forum Duplicate *******************************************************/ 223 223 224 if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_forum_post_type(), 'post_author' => $forum_author, 'post_content' => $forum_content, 'anonymous_data' => $anonymous_data ) ) ) {224 if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_forum_post_type(), 'post_author' => $forum_author, 'post_content' => $forum_content, 'anonymous_data' => $anonymous_data ) ) ) { 225 225 bbp_add_error( 'bbp_forum_duplicate', __( '<strong>ERROR</strong>: This forum already exists.', 'bbpress' ) ); 226 226 } … … 228 228 /** Forum Blacklist *******************************************************/ 229 229 230 if ( ! bbp_check_for_blacklist( $anonymous_data, $forum_author, $forum_title, $forum_content ) ) {230 if ( ! bbp_check_for_blacklist( $anonymous_data, $forum_author, $forum_title, $forum_content ) ) { 231 231 bbp_add_error( 'bbp_forum_blacklist', __( '<strong>ERROR</strong>: Your forum cannot be created at this time.', 'bbpress' ) ); 232 232 } … … 235 235 236 236 $post_status = bbp_get_public_status_id(); 237 if ( ! bbp_check_for_moderation( $anonymous_data, $forum_author, $forum_title, $forum_content ) ) {237 if ( ! bbp_check_for_moderation( $anonymous_data, $forum_author, $forum_title, $forum_content ) ) { 238 238 $post_status = bbp_get_pending_status_id(); 239 239 } … … 267 267 /** No Errors *************************************************************/ 268 268 269 if ( ! empty( $forum_id ) && !is_wp_error( $forum_id ) ) {269 if ( ! empty( $forum_id ) && !is_wp_error( $forum_id ) ) { 270 270 271 271 /** Trash Check *******************************************************/ … … 318 318 319 319 // Add view all? 320 if ( bbp_get_view_all() || ! empty( $view_all ) ) {320 if ( bbp_get_view_all() || ! empty( $view_all ) ) { 321 321 322 322 // User can moderate, so redirect to forum with view all set … … 419 419 420 420 // Remove kses filters from title and content for capable users and if the nonce is verified 421 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_forum'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-forum_' . $forum_id ) === $_POST['_bbp_unfiltered_html_forum'] ) ) {421 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_forum'] ) && ( wp_create_nonce( 'bbp-unfiltered-html-forum_' . $forum_id ) === $_POST['_bbp_unfiltered_html_forum'] ) ) { 422 422 remove_filter( 'bbp_edit_forum_pre_title', 'wp_filter_kses' ); 423 423 remove_filter( 'bbp_edit_forum_pre_content', 'bbp_encode_bad', 10 ); … … 428 428 429 429 // Forum parent id was passed 430 if ( ! empty( $_POST['bbp_forum_parent_id'] ) ) {430 if ( ! empty( $_POST['bbp_forum_parent_id'] ) ) { 431 431 $forum_parent_id = bbp_get_forum_id( $_POST['bbp_forum_parent_id'] ); 432 432 } … … 436 436 437 437 // Forum exists 438 if ( ! empty( $forum_parent_id ) && ( $forum_parent_id !== $current_parent_forum_id ) ) {438 if ( ! empty( $forum_parent_id ) && ( $forum_parent_id !== $current_parent_forum_id ) ) { 439 439 440 440 // Forum is closed and user cannot access … … 456 456 /** Forum Title ***********************************************************/ 457 457 458 if ( ! empty( $_POST['bbp_forum_title'] ) ) {458 if ( ! empty( $_POST['bbp_forum_title'] ) ) { 459 459 $forum_title = sanitize_text_field( $_POST['bbp_forum_title'] ); 460 460 } … … 470 470 /** Forum Content *********************************************************/ 471 471 472 if ( ! empty( $_POST['bbp_forum_content'] ) ) {472 if ( ! empty( $_POST['bbp_forum_content'] ) ) { 473 473 $forum_content = $_POST['bbp_forum_content']; 474 474 } … … 484 484 /** Forum Blacklist *******************************************************/ 485 485 486 if ( ! bbp_check_for_blacklist( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content ) ) {486 if ( ! bbp_check_for_blacklist( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content ) ) { 487 487 bbp_add_error( 'bbp_forum_blacklist', __( '<strong>ERROR</strong>: Your forum cannot be edited at this time.', 'bbpress' ) ); 488 488 } … … 491 491 492 492 $post_status = bbp_get_public_status_id(); 493 if ( ! bbp_check_for_moderation( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content ) ) {493 if ( ! bbp_check_for_moderation( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content ) ) { 494 494 $post_status = bbp_get_pending_status_id(); 495 495 } … … 524 524 * @todo omitted for 2.1 525 525 // Revision Reason 526 if ( ! empty( $_POST['bbp_forum_edit_reason'] ) )526 if ( ! empty( $_POST['bbp_forum_edit_reason'] ) ) 527 527 $forum_edit_reason = sanitize_text_field( $_POST['bbp_forum_edit_reason'] ); 528 528 529 529 // Update revision log 530 if ( ! empty( $_POST['bbp_log_forum_edit'] ) && ( "1" === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {530 if ( ! empty( $_POST['bbp_log_forum_edit'] ) && ( "1" === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) { 531 531 bbp_update_forum_revision_log( array( 532 532 'forum_id' => $forum_id, … … 540 540 /** No Errors *************************************************************/ 541 541 542 if ( ! empty( $forum_id ) && !is_wp_error( $forum_id ) ) {542 if ( ! empty( $forum_id ) && !is_wp_error( $forum_id ) ) { 543 543 544 544 // Update counts, etc... … … 577 577 578 578 // Add view all? 579 if ( ! empty( $view_all ) ) {579 if ( ! empty( $view_all ) ) { 580 580 $forum_url = bbp_add_view_all( $forum_url ); 581 581 } … … 653 653 /** Forum Visibility **************************************************/ 654 654 655 if ( ! empty( $_POST['bbp_forum_visibility'] ) && in_array( $_POST['bbp_forum_visibility'], array( bbp_get_public_status_id(), bbp_get_private_status_id(), bbp_get_hidden_status_id() ) ) ) {655 if ( ! empty( $_POST['bbp_forum_visibility'] ) && in_array( $_POST['bbp_forum_visibility'], array( bbp_get_public_status_id(), bbp_get_private_status_id(), bbp_get_hidden_status_id() ) ) ) { 656 656 657 657 // Get forums current visibility … … 1025 1025 1026 1026 // Users exist 1027 if ( ! empty( $users ) ) {1027 if ( ! empty( $users ) ) { 1028 1028 1029 1029 // Loop through users … … 1077 1077 1078 1078 // If has ancestors, loop through them... 1079 if ( ! empty( $ancestors ) ) {1079 if ( ! empty( $ancestors ) ) { 1080 1080 foreach ( (array) $ancestors as $parent_forum_id ) { 1081 1081 … … 1168 1168 1169 1169 // If has ancestors, loop through them... 1170 if ( ! empty( $ancestors ) ) {1170 if ( ! empty( $ancestors ) ) { 1171 1171 foreach ( (array) $ancestors as $parent_forum_id ) { 1172 1172 … … 1217 1217 // Loop through children and add together forum reply counts 1218 1218 $children = bbp_forum_query_subforum_ids( $forum_id ); 1219 if ( ! empty( $children ) ) {1219 if ( ! empty( $children ) ) { 1220 1220 foreach ( $children as $child ) { 1221 1221 $children_last_topic = bbp_update_forum_last_topic_id( $child ); // Recursive … … 1235 1235 // Get the most recent topic in this forum_id 1236 1236 $recent_topic = get_posts( $post_vars ); 1237 if ( ! empty( $recent_topic ) ) {1237 if ( ! empty( $recent_topic ) ) { 1238 1238 $topic_id = $recent_topic[0]->ID; 1239 1239 } … … 1245 1245 1246 1246 // If child forums have higher id, use that instead 1247 if ( ! empty( $children ) && ( $children_last_topic > $topic_id ) ) {1247 if ( ! empty( $children ) && ( $children_last_topic > $topic_id ) ) { 1248 1248 $topic_id = $children_last_topic; 1249 1249 } … … 1287 1287 // Loop through children and get the most recent reply id 1288 1288 $children = bbp_forum_query_subforum_ids( $forum_id ); 1289 if ( ! empty( $children ) ) {1289 if ( ! empty( $children ) ) { 1290 1290 foreach ( $children as $child ) { 1291 1291 $children_last_reply = bbp_update_forum_last_reply_id( $child ); // Recursive … … 1295 1295 // If this forum has topics... 1296 1296 $topic_ids = bbp_forum_query_topic_ids( $forum_id ); 1297 if ( ! empty( $topic_ids ) ) {1297 if ( ! empty( $topic_ids ) ) { 1298 1298 1299 1299 // ...get the most recent reply from those topics... … … 1310 1310 1311 1311 // If child forums have higher ID, check for newer reply id 1312 if ( ! empty( $children ) && ( $children_last_reply > $reply_id ) ) {1312 if ( ! empty( $children ) && ( $children_last_reply > $reply_id ) ) { 1313 1313 $reply_id = $children_last_reply; 1314 1314 } … … 1353 1353 // Loop through children and add together forum reply counts 1354 1354 $children = bbp_forum_query_subforum_ids( $forum_id ); 1355 if ( ! empty( $children ) ) {1355 if ( ! empty( $children ) ) { 1356 1356 foreach ( $children as $child ) { 1357 1357 $children_last_active = bbp_update_forum_last_active_id( $child, $active_id ); … … 1361 1361 // Don't count replies if the forum is a category 1362 1362 $topic_ids = bbp_forum_query_topic_ids( $forum_id ); 1363 if ( ! empty( $topic_ids ) ) {1363 if ( ! empty( $topic_ids ) ) { 1364 1364 $active_id = bbp_forum_query_last_reply_id( $forum_id, $topic_ids ); 1365 1365 $active_id = $active_id > max( $topic_ids ) ? $active_id : max( $topic_ids ); … … 1376 1376 1377 1377 // If child forums have higher id, use that instead 1378 if ( ! empty( $children ) && ( $children_last_active > $active_id ) ) {1378 if ( ! empty( $children ) && ( $children_last_active > $active_id ) ) { 1379 1379 $active_id = $children_last_active; 1380 1380 } … … 1412 1412 1413 1413 // Update only if there is a time 1414 if ( ! empty( $new_time ) ) {1414 if ( ! empty( $new_time ) ) { 1415 1415 update_post_meta( $forum_id, '_bbp_last_active_time', $new_time ); 1416 1416 } … … 1467 1467 // Loop through subforums and add together forum topic counts 1468 1468 $children = bbp_forum_query_subforum_ids( $forum_id ); 1469 if ( ! empty( $children ) ) {1469 if ( ! empty( $children ) ) { 1470 1470 foreach ( $children as $child ) { 1471 1471 $children_topic_count += bbp_update_forum_topic_count( $child ); // Recursive … … 1567 1567 // Loop through children and add together forum reply counts 1568 1568 $children = bbp_forum_query_subforum_ids( $forum_id ); 1569 if ( ! empty( $children ) ) {1569 if ( ! empty( $children ) ) { 1570 1570 foreach ( (array) $children as $child ) { 1571 1571 $children_reply_count += bbp_update_forum_reply_count( $child ); … … 1653 1653 1654 1654 // Update the parent forum if one was passed 1655 if ( ! empty( $r['post_parent'] ) && is_numeric( $r['post_parent'] ) ) {1655 if ( ! empty( $r['post_parent'] ) && is_numeric( $r['post_parent'] ) ) { 1656 1656 bbp_update_forum( array( 1657 1657 'forum_id' => $r['post_parent'], … … 1792 1792 1793 1793 // There are forums that need to be excluded 1794 if ( ! empty( $forum_ids ) ) {1794 if ( ! empty( $forum_ids ) ) { 1795 1795 1796 1796 switch ( $type ) { … … 1884 1884 if ( ! current_user_can( 'read_private_forums' ) ) { 1885 1885 $key = array_search( bbp_get_private_status_id(), $post_stati ); 1886 if ( ! empty( $key ) ) {1886 if ( ! empty( $key ) ) { 1887 1887 unset( $post_stati[$key] ); 1888 1888 } … … 1898 1898 if ( ! current_user_can( 'read_hidden_forums' ) ) { 1899 1899 $key = array_search( bbp_get_hidden_status_id(), $post_stati ); 1900 if ( ! empty( $key ) ) {1900 if ( ! empty( $key ) ) { 1901 1901 unset( $post_stati[$key] ); 1902 1902 } … … 2012 2012 } 2013 2013 2014 if ( ! empty( $topic_ids ) ) {2014 if ( ! empty( $topic_ids ) ) { 2015 2015 $bbp_db = bbp_db(); 2016 2016 $topic_ids = implode( ',', wp_parse_id_list( $topic_ids ) ); … … 2080 2080 2081 2081 // If forum is explicitly hidden and user not capable, set 404 2082 if ( ! empty( $forum_id ) && bbp_is_forum_hidden( $forum_id ) && !current_user_can( 'read_hidden_forums' ) ) {2082 if ( ! empty( $forum_id ) && bbp_is_forum_hidden( $forum_id ) && !current_user_can( 'read_hidden_forums' ) ) { 2083 2083 bbp_set_404(); 2084 2084 } … … 2135 2135 2136 2136 // If forum is explicitly hidden and user not capable, set 404 2137 if ( ! empty( $forum_id ) && bbp_is_forum_private( $forum_id ) && !current_user_can( 'read_private_forums' ) ) {2137 if ( ! empty( $forum_id ) && bbp_is_forum_private( $forum_id ) && !current_user_can( 'read_private_forums' ) ) { 2138 2138 bbp_set_404(); 2139 2139 } … … 2202 2202 // Loop through and delete child topics. Topic replies will get deleted by 2203 2203 // the bbp_delete_topic() action. 2204 if ( ! empty( $topics->posts ) ) {2204 if ( ! empty( $topics->posts ) ) { 2205 2205 foreach ( $topics->posts as $topic ) { 2206 2206 wp_delete_post( $topic->ID, true ); … … 2259 2259 // Loop through and trash child topics. Topic replies will get trashed by 2260 2260 // the bbp_trash_topic() action. 2261 if ( ! empty( $topics->posts ) ) {2261 if ( ! empty( $topics->posts ) ) { 2262 2262 2263 2263 // Prevent debug notices … … 2308 2308 2309 2309 // There are topics to untrash 2310 if ( ! empty( $pre_trashed_topics ) ) {2310 if ( ! empty( $pre_trashed_topics ) ) { 2311 2311 2312 2312 // Maybe reverse the trashed topics array … … 2339 2339 $forum_id = bbp_get_forum_id( $forum_id ); 2340 2340 2341 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) {2341 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) { 2342 2342 return false; 2343 2343 } … … 2361 2361 $forum_id = bbp_get_forum_id( $forum_id ); 2362 2362 2363 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) {2363 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) { 2364 2364 return false; 2365 2365 } … … 2379 2379 $forum_id = bbp_get_forum_id( $forum_id ); 2380 2380 2381 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) {2381 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) { 2382 2382 return false; 2383 2383 } … … 2399 2399 $forum_id = bbp_get_forum_id( $forum_id ); 2400 2400 2401 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) {2401 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) { 2402 2402 return false; 2403 2403 } … … 2417 2417 $forum_id = bbp_get_forum_id( $forum_id ); 2418 2418 2419 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) {2419 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) { 2420 2420 return false; 2421 2421 } … … 2435 2435 $forum_id = bbp_get_forum_id( $forum_id ); 2436 2436 2437 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) {2437 if ( empty( $forum_id ) || ! bbp_is_forum( $forum_id ) ) { 2438 2438 return false; 2439 2439 } -
trunk/src/includes/replies/capabilities.php
r5770 r5829 61 61 // Get the post 62 62 $_post = get_post( $args[0] ); 63 if ( ! empty( $_post ) ) {63 if ( ! empty( $_post ) ) { 64 64 65 65 // Get caps for post type object … … 116 116 // Get the post 117 117 $_post = get_post( $args[0] ); 118 if ( ! empty( $_post ) ) {118 if ( ! empty( $_post ) ) { 119 119 120 120 // Get caps for post type object … … 144 144 // Get the post 145 145 $_post = get_post( $args[0] ); 146 if ( ! empty( $_post ) ) {146 if ( ! empty( $_post ) ) { 147 147 148 148 // Get caps for post type object -
trunk/src/includes/replies/functions.php
r5827 r5829 129 129 130 130 // Anonymous data checks out, so set cookies, etc... 131 if ( ! empty( $anonymous_data ) && is_array( $anonymous_data ) ) {131 if ( ! empty( $anonymous_data ) && is_array( $anonymous_data ) ) { 132 132 bbp_set_current_anonymous_user_data( $anonymous_data ); 133 133 } … … 179 179 180 180 // Try to use the forum id of the topic 181 if ( ! isset( $_POST['bbp_forum_id'] ) && !empty( $topic_id ) ) {181 if ( ! isset( $_POST['bbp_forum_id'] ) && ! empty( $topic_id ) ) { 182 182 $forum_id = bbp_get_topic_forum_id( $topic_id ); 183 183 … … 219 219 220 220 // Forum exists 221 if ( ! empty( $forum_id ) ) {221 if ( ! empty( $forum_id ) ) { 222 222 223 223 // Forum is a category … … 251 251 252 252 // Remove kses filters from title and content for capable users and if the nonce is verified 253 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $topic_id ) === $_POST['_bbp_unfiltered_html_reply'] ) {253 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $topic_id ) === $_POST['_bbp_unfiltered_html_reply'] ) { 254 254 remove_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' ); 255 255 remove_filter( 'bbp_new_reply_pre_content', 'bbp_encode_bad', 10 ); … … 259 259 /** Reply Title ***********************************************************/ 260 260 261 if ( ! empty( $_POST['bbp_reply_title'] ) ) {261 if ( ! empty( $_POST['bbp_reply_title'] ) ) { 262 262 $reply_title = sanitize_text_field( $_POST['bbp_reply_title'] ); 263 263 } … … 268 268 /** Reply Content *********************************************************/ 269 269 270 if ( ! empty( $_POST['bbp_reply_content'] ) ) {270 if ( ! empty( $_POST['bbp_reply_content'] ) ) { 271 271 $reply_content = $_POST['bbp_reply_content']; 272 272 } … … 282 282 /** Reply Flooding ********************************************************/ 283 283 284 if ( ! bbp_check_for_flood( $anonymous_data, $reply_author ) ) {284 if ( ! bbp_check_for_flood( $anonymous_data, $reply_author ) ) { 285 285 bbp_add_error( 'bbp_reply_flood', __( '<strong>ERROR</strong>: Slow down; you move too fast.', 'bbpress' ) ); 286 286 } … … 288 288 /** Reply Duplicate *******************************************************/ 289 289 290 if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_reply_post_type(), 'post_author' => $reply_author, 'post_content' => $reply_content, 'post_parent' => $topic_id, 'anonymous_data' => $anonymous_data ) ) ) {290 if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_reply_post_type(), 'post_author' => $reply_author, 'post_content' => $reply_content, 'post_parent' => $topic_id, 'anonymous_data' => $anonymous_data ) ) ) { 291 291 bbp_add_error( 'bbp_reply_duplicate', __( '<strong>ERROR</strong>: Duplicate reply detected; it looks as though you’ve already said that!', 'bbpress' ) ); 292 292 } … … 294 294 /** Reply Blacklist *******************************************************/ 295 295 296 if ( ! bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {296 if ( ! bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 297 297 bbp_add_error( 'bbp_reply_blacklist', __( '<strong>ERROR</strong>: Your reply cannot be created at this time.', 'bbpress' ) ); 298 298 } … … 301 301 302 302 // Maybe put into moderation 303 if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {303 if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 304 304 $reply_status = bbp_get_pending_status_id(); 305 305 … … 368 368 369 369 // Check for missing reply_id or error 370 if ( ! empty( $reply_id ) && !is_wp_error( $reply_id ) ) {370 if ( ! empty( $reply_id ) && !is_wp_error( $reply_id ) ) { 371 371 372 372 /** Topic Tags ********************************************************/ … … 547 547 548 548 // Remove kses filters from title and content for capable users and if the nonce is verified 549 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $reply_id ) === $_POST['_bbp_unfiltered_html_reply'] ) {549 if ( current_user_can( 'unfiltered_html' ) && ! empty( $_POST['_bbp_unfiltered_html_reply'] ) && wp_create_nonce( 'bbp-unfiltered-html-reply_' . $reply_id ) === $_POST['_bbp_unfiltered_html_reply'] ) { 550 550 remove_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' ); 551 551 remove_filter( 'bbp_edit_reply_pre_content', 'bbp_encode_bad', 10 ); … … 562 562 563 563 // Forum exists 564 if ( ! empty( $forum_id ) && ( $forum_id !== bbp_get_reply_forum_id( $reply_id ) ) ) {564 if ( ! empty( $forum_id ) && ( $forum_id !== bbp_get_reply_forum_id( $reply_id ) ) ) { 565 565 566 566 // Forum is a category … … 593 593 /** Reply Title ***********************************************************/ 594 594 595 if ( ! empty( $_POST['bbp_reply_title'] ) ) {595 if ( ! empty( $_POST['bbp_reply_title'] ) ) { 596 596 $reply_title = sanitize_text_field( $_POST['bbp_reply_title'] ); 597 597 } … … 602 602 /** Reply Content *********************************************************/ 603 603 604 if ( ! empty( $_POST['bbp_reply_content'] ) ) {604 if ( ! empty( $_POST['bbp_reply_content'] ) ) { 605 605 $reply_content = $_POST['bbp_reply_content']; 606 606 } … … 616 616 /** Reply Blacklist *******************************************************/ 617 617 618 if ( ! bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {618 if ( ! bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 619 619 bbp_add_error( 'bbp_reply_blacklist', __( '<strong>ERROR</strong>: Your reply cannot be edited at this time.', 'bbpress' ) ); 620 620 } … … 623 623 624 624 // Maybe put into moderation 625 if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {625 if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 626 626 627 627 // Set post status to pending if public … … 711 711 712 712 // Revision Reason 713 if ( ! empty( $_POST['bbp_reply_edit_reason'] ) ) {713 if ( ! empty( $_POST['bbp_reply_edit_reason'] ) ) { 714 714 $reply_edit_reason = sanitize_text_field( $_POST['bbp_reply_edit_reason'] ); 715 715 } 716 716 717 717 // Update revision log 718 if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) {718 if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) { 719 719 $revision_id = wp_save_post_revision( $reply_id ); 720 if ( ! empty( $revision_id ) ) {720 if ( ! empty( $revision_id ) ) { 721 721 bbp_update_reply_revision_log( array( 722 722 'reply_id' => $reply_id, … … 730 730 /** No Errors *************************************************************/ 731 731 732 if ( ! empty( $reply_id ) && !is_wp_error( $reply_id ) ) {732 if ( ! empty( $reply_id ) && !is_wp_error( $reply_id ) ) { 733 733 734 734 // Update counts, etc... … … 816 816 817 817 // Check forum_id 818 if ( ! empty( $topic_id ) && empty( $forum_id ) ) {818 if ( ! empty( $topic_id ) && empty( $forum_id ) ) { 819 819 $forum_id = bbp_get_topic_forum_id( $topic_id ); 820 820 } … … 823 823 // It expects anonymous_data to be sanitized. 824 824 // Check bbp_filter_anonymous_post_data() for sanitization. 825 if ( ! empty( $anonymous_data ) && is_array( $anonymous_data ) ) {825 if ( ! empty( $anonymous_data ) && is_array( $anonymous_data ) ) { 826 826 827 827 // Parse arguments against default values … … 849 849 850 850 // Handle Subscription Checkbox 851 if ( bbp_is_subscriptions_active() && ! empty( $author_id ) && !empty( $topic_id ) ) {851 if ( bbp_is_subscriptions_active() && ! empty( $author_id ) && ! empty( $topic_id ) ) { 852 852 $subscribed = bbp_is_user_subscribed( $author_id, $topic_id ); 853 $subscheck = ( ! empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' === $_POST['bbp_topic_subscription'] ) ) ? true : false;853 $subscheck = ( ! empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' === $_POST['bbp_topic_subscription'] ) ) ? true : false; 854 854 855 855 // Subscribed and unsubscribing … … 922 922 923 923 // Reply was passed 924 if ( ! empty( $reply_id ) ) {924 if ( ! empty( $reply_id ) ) { 925 925 926 926 // Get the topic ID if none was passed … … 947 947 948 948 // Walk up ancestors 949 if ( ! empty( $ancestors ) ) {949 if ( ! empty( $ancestors ) ) { 950 950 foreach ( $ancestors as $ancestor ) { 951 951 … … 1036 1036 1037 1037 // Loop through ancestors 1038 if ( ! empty( $ancestors ) ) {1038 if ( ! empty( $ancestors ) ) { 1039 1039 foreach ( $ancestors as $ancestor ) { 1040 1040 … … 1085 1085 1086 1086 // Loop through ancestors 1087 if ( ! empty( $ancestors ) ) {1087 if ( ! empty( $ancestors ) ) { 1088 1088 foreach ( $ancestors as $ancestor ) { 1089 1089 … … 1311 1311 1312 1312 // How to move 1313 if ( ! empty( $_POST['bbp_reply_move_option'] ) ) {1313 if ( ! empty( $_POST['bbp_reply_move_option'] ) ) { 1314 1314 $move_option = (string) trim( $_POST['bbp_reply_move_option'] ); 1315 1315 } 1316 1316 1317 1317 // Invalid move option 1318 if ( empty( $move_option ) || ! in_array( $move_option, array( 'existing', 'topic' ) ) ) {1318 if ( empty( $move_option ) || ! in_array( $move_option, array( 'existing', 'topic' ) ) ) { 1319 1319 bbp_add_error( 'bbp_move_reply_option', __( '<strong>ERROR</strong>: You need to choose a valid move option.', 'bbpress' ) ); 1320 1320 … … 1375 1375 1376 1376 // Use the new title that was passed 1377 if ( ! empty( $_POST['bbp_reply_move_destination_title'] ) ) {1377 if ( ! empty( $_POST['bbp_reply_move_destination_title'] ) ) { 1378 1378 $destination_topic_title = sanitize_text_field( $_POST['bbp_reply_move_destination_title'] ); 1379 1379 … … 1570 1570 1571 1571 // Bail if actions aren't meant for this function 1572 if ( ! in_array( $action, $possible_actions ) ) {1572 if ( ! in_array( $action, $possible_actions ) ) { 1573 1573 return; 1574 1574 } … … 1602 1602 $success = $is_approve ? bbp_approve_reply( $reply_id ) : bbp_unapprove_reply( $reply_id ); 1603 1603 $failure = $is_approve ? __( '<strong>ERROR</strong>: There was a problem approving the reply!', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem unapproving the reply!', 'bbpress' ); 1604 $view_all = ! $is_approve;1604 $view_all = ! $is_approve; 1605 1605 1606 1606 break; … … 1613 1613 $success = $is_spam ? bbp_unspam_reply( $reply_id ) : bbp_spam_reply( $reply_id ); 1614 1614 $failure = $is_spam ? __( '<strong>ERROR</strong>: There was a problem unmarking the reply as spam!', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the reply as spam!', 'bbpress' ); 1615 $view_all = ! $is_spam;1615 $view_all = ! $is_spam; 1616 1616 1617 1617 break; … … 1671 1671 1672 1672 // Add view all if needed 1673 if ( ! empty( $view_all ) ) {1673 if ( ! empty( $view_all ) ) { 1674 1674 $reply_url = bbp_add_view_all( $reply_url, true ); 1675 1675 } … … 1911 1911 $reply_id = bbp_get_reply_id( $reply_id ); 1912 1912 1913 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) {1913 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) { 1914 1914 return false; 1915 1915 } … … 1928 1928 $reply_id = bbp_get_reply_id( $reply_id ); 1929 1929 1930 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) {1930 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) { 1931 1931 return false; 1932 1932 } … … 1945 1945 $reply_id = bbp_get_reply_id( $reply_id ); 1946 1946 1947 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) {1947 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) { 1948 1948 return false; 1949 1949 } … … 1964 1964 $reply_id = bbp_get_reply_id( $reply_id ); 1965 1965 1966 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) {1966 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) { 1967 1967 return false; 1968 1968 } … … 1981 1981 $reply_id = bbp_get_reply_id( $reply_id ); 1982 1982 1983 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) {1983 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) { 1984 1984 return false; 1985 1985 } … … 1998 1998 $reply_id = bbp_get_reply_id( $reply_id ); 1999 1999 2000 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) {2000 if ( empty( $reply_id ) || ! bbp_is_reply( $reply_id ) ) { 2001 2001 return false; 2002 2002 } … … 2176 2176 2177 2177 // User cannot access forum this topic is in 2178 if ( bbp_is_single_topic() && ! bbp_user_can_view_forum( array( 'forum_id' => bbp_get_topic_forum_id() ) ) ) {2178 if ( bbp_is_single_topic() && ! bbp_user_can_view_forum( array( 'forum_id' => bbp_get_topic_forum_id() ) ) ) { 2179 2179 return; 2180 2180 } … … 2183 2183 if ( bbp_is_single_topic() && bbp_user_can_view_forum( array( 'forum_id' => bbp_get_topic_forum_id() ) ) ) { 2184 2184 $title = apply_filters( 'wp_title_rss', get_wp_title_rss( ' » ' ) ); 2185 } elseif ( ! bbp_show_lead_topic() ) {2185 } elseif ( ! bbp_show_lead_topic() ) { 2186 2186 $title = ' » ' . __( 'All Posts', 'bbpress' ); 2187 2187 } else { … … 2368 2368 // Get required data 2369 2369 $reply_id = bbp_get_reply_id( $reply_id ); 2370 $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id );2370 $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id ); 2371 2371 $reply_position = 0; 2372 2372 … … 2376 2376 // Make sure the topic has replies before running another query 2377 2377 $reply_count = bbp_get_topic_reply_count( $topic_id, false ); 2378 if ( ! empty( $reply_count ) ) {2378 if ( ! empty( $reply_count ) ) { 2379 2379 2380 2380 // Get reply id's 2381 2381 $topic_replies = bbp_get_all_child_ids( $topic_id, bbp_get_reply_post_type() ); 2382 if ( ! empty( $topic_replies ) ) {2382 if ( ! empty( $topic_replies ) ) { 2383 2383 2384 2384 // Reverse replies array and search for current reply position -
trunk/src/includes/replies/template.php
r5827 r5829 351 351 352 352 // Easy empty checking 353 if ( ! empty( $reply_id ) && is_numeric( $reply_id ) ) {353 if ( ! empty( $reply_id ) && is_numeric( $reply_id ) ) { 354 354 $bbp_reply_id = $reply_id; 355 355 356 356 // Currently inside a replies loop 357 } elseif ( ! empty( $bbp->reply_query->in_the_loop ) && isset( $bbp->reply_query->post->ID ) ) {357 } elseif ( ! empty( $bbp->reply_query->in_the_loop ) && isset( $bbp->reply_query->post->ID ) ) { 358 358 $bbp_reply_id = $bbp->reply_query->post->ID; 359 359 360 360 // Currently inside a search loop 361 } elseif ( ! empty( $bbp->search_query->in_the_loop ) && isset( $bbp->search_query->post->ID ) && bbp_is_reply( $bbp->search_query->post->ID ) ) {361 } elseif ( ! empty( $bbp->search_query->in_the_loop ) && isset( $bbp->search_query->post->ID ) && bbp_is_reply( $bbp->search_query->post->ID ) ) { 362 362 $bbp_reply_id = $bbp->search_query->post->ID; 363 363 364 364 // Currently viewing a forum 365 } elseif ( ( bbp_is_single_reply() || bbp_is_reply_edit() ) && ! empty( $bbp->current_reply_id ) ) {365 } elseif ( ( bbp_is_single_reply() || bbp_is_reply_edit() ) && ! empty( $bbp->current_reply_id ) ) { 366 366 $bbp_reply_id = $bbp->current_reply_id; 367 367 … … 663 663 } 664 664 665 if ( ! empty( $length ) && ( $excerpt_length > $length ) ) {665 if ( ! empty( $length ) && ( $excerpt_length > $length ) ) { 666 666 $excerpt = substr( $excerpt, 0, $length - 1 ); 667 667 $excerpt .= '…'; … … 701 701 702 702 // 4 days, 4 hours ago 703 if ( ! empty( $humanize ) ) {704 $gmt_s = ! empty( $gmt ) ? 'G' : 'U';703 if ( ! empty( $humanize ) ) { 704 $gmt_s = ! empty( $gmt ) ? 'G' : 'U'; 705 705 $date = get_post_time( $gmt_s, $gmt, $reply_id ); 706 706 $time = false; // For filter below … … 811 811 812 812 $r .= "\t" . '<li id="bbp-reply-revision-log-' . esc_attr( $reply_id ) . '-item-' . esc_attr( $revision->ID ) . '" class="bbp-reply-revision-log-item">' . "\n"; 813 if ( ! empty( $reason ) ) {813 if ( ! empty( $reason ) ) { 814 814 $r .= "\t\t" . sprintf( esc_html__( 'This reply was modified %1$s by %2$s. Reason: %3$s', 'bbpress' ), esc_html( $since ), $author, esc_html( $reason ) ) . "\n"; 815 815 } else { … … 1181 1181 function bbp_get_reply_author_avatar( $reply_id = 0, $size = 40 ) { 1182 1182 $reply_id = bbp_get_reply_id( $reply_id ); 1183 if ( ! empty( $reply_id ) ) {1183 if ( ! empty( $reply_id ) ) { 1184 1184 // Check for anonymous user 1185 if ( ! bbp_is_reply_anonymous( $reply_id ) ) {1185 if ( ! bbp_is_reply_anonymous( $reply_id ) ) { 1186 1186 $author_avatar = get_avatar( bbp_get_reply_author_id( $reply_id ), $size ); 1187 1187 } else { … … 1245 1245 1246 1246 // Reply ID is good 1247 if ( ! empty( $reply_id ) ) {1247 if ( ! empty( $reply_id ) ) { 1248 1248 1249 1249 // Get some useful reply information … … 1261 1261 1262 1262 // Setup title and author_links array 1263 $link_title = ! empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : '';1263 $link_title = ! empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : ''; 1264 1264 $author_links = array(); 1265 1265 … … 1385 1385 $user_id = bbp_get_reply_author_id( $reply_id ); 1386 1386 $user = get_userdata( $user_id ); 1387 $author_email = ! empty( $user->user_email ) ? $user->user_email : '';1387 $author_email = ! empty( $user->user_email ) ? $user->user_email : ''; 1388 1388 1389 1389 // Anonymous … … 1755 1755 1756 1756 // Set visibility 1757 $style = ! empty( $reply_to ) ? '' : ' style="display:none;"';1757 $style = ! empty( $reply_to ) ? '' : ' style="display:none;"'; 1758 1758 $link = remove_query_arg( array( 'bbp_reply_to', '_wpnonce' ) ) . '#post-' . $reply_to; 1759 1759 $retval = '<a rel="nofollow" id="bbp-cancel-reply-to-link" href="' . esc_url( $link ) . '"' . $style . '>' . esc_html( $text ) . '</a>'; … … 1800 1800 // Reply doesn't have a position so get the raw value 1801 1801 if ( empty( $reply_position ) ) { 1802 $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id );1802 $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id ); 1803 1803 1804 1804 // Post is not the topic … … 1808 1808 // Update the reply position in the posts table so we'll never have 1809 1809 // to hit the DB again. 1810 if ( ! empty( $reply_position ) ) {1810 if ( ! empty( $reply_position ) ) { 1811 1811 bbp_update_reply_position( $reply_id, $reply_position ); 1812 1812 } … … 2520 2520 $bbp = bbpress(); 2521 2521 2522 if ( ! isset( $bbp->reply_query->pagination_links ) || empty( $bbp->reply_query->pagination_links ) ) {2522 if ( ! isset( $bbp->reply_query->pagination_links ) || empty( $bbp->reply_query->pagination_links ) ) { 2523 2523 return false; 2524 2524 } -
trunk/src/includes/topics/functions.php
r5827 r5829 1195 1195 1196 1196 // Source topic not found 1197 } elseif ( ! $source_topic = bbp_get_topic( $source_topic_id ) ) {1197 } elseif ( ! $source_topic = bbp_get_topic( $source_topic_id ) ) { 1198 1198 bbp_add_error( 'bbp_merge_topic_source_not_found', __( '<strong>ERROR</strong>: The topic you want to merge was not found.', 'bbpress' ) ); 1199 1199 return; … … 1216 1216 1217 1217 // Destination topic not found 1218 if ( ! $destination_topic = bbp_get_topic( $destination_topic_id ) ) {1218 if ( ! $destination_topic = bbp_get_topic( $destination_topic_id ) ) { 1219 1219 bbp_add_error( 'bbp_merge_topic_destination_not_found', __( '<strong>ERROR</strong>: The topic you want to merge to was not found.', 'bbpress' ) ); 1220 1220 } … … 1872 1872 1873 1873 // No tag name was provided 1874 if ( empty( $_POST['tag-name'] ) || ! $name = $_POST['tag-name'] ) {1874 if ( empty( $_POST['tag-name'] ) || ! $name = $_POST['tag-name'] ) { 1875 1875 bbp_add_error( 'bbp_manage_topic_tag_update_name', __( '<strong>ERROR</strong>: You need to enter a tag name.', 'bbpress' ) ); 1876 1876 return; … … 1912 1912 1913 1913 // No tag name was provided 1914 if ( empty( $_POST['tag-existing-name'] ) || ! $name = $_POST['tag-existing-name'] ) {1914 if ( empty( $_POST['tag-existing-name'] ) || ! $name = $_POST['tag-existing-name'] ) { 1915 1915 bbp_add_error( 'bbp_manage_topic_tag_merge_name', __( '<strong>ERROR</strong>: You need to enter a tag name.', 'bbpress' ) ); 1916 1916 return; … … 1918 1918 1919 1919 // If term does not exist, create it 1920 if ( ! $tag = term_exists( $name, bbp_get_topic_tag_tax_id() ) ) {1920 if ( ! $tag = term_exists( $name, bbp_get_topic_tag_tax_id() ) ) { 1921 1921 $tag = wp_insert_term( $name, bbp_get_topic_tag_tax_id() ); 1922 1922 } … … 2178 2178 $success = true === $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id ); 2179 2179 $failure = true === $is_spam ? __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'bbpress' ); 2180 $view_all = ! $is_spam;2180 $view_all = ! $is_spam; 2181 2181 2182 2182 break; -
trunk/src/templates/default/bbpress-functions.php
r5770 r5829 356 356 // Get user and topic data 357 357 $user_id = bbp_get_current_user_id(); 358 $id = ! empty( $_POST['id'] ) ? intval( $_POST['id'] ) : 0;358 $id = ! empty( $_POST['id'] ) ? intval( $_POST['id'] ) : 0; 359 359 360 360 // Bail if user cannot add favorites for this user -
trunk/src/templates/default/bbpress/content-single-forum.php
r5770 r5829 32 32 <?php endif; ?> 33 33 34 <?php if ( ! bbp_is_forum_category() && bbp_has_topics() ) : ?>34 <?php if ( ! bbp_is_forum_category() && bbp_has_topics() ) : ?> 35 35 36 36 <?php bbp_get_template_part( 'pagination', 'topics' ); ?> … … 42 42 <?php bbp_get_template_part( 'form', 'topic' ); ?> 43 43 44 <?php elseif ( ! bbp_is_forum_category() ) : ?>44 <?php elseif ( ! bbp_is_forum_category() ) : ?> 45 45 46 46 <?php bbp_get_template_part( 'feedback', 'no-topics' ); ?> -
trunk/src/templates/default/bbpress/content-statistics.php
r5770 r5829 40 40 </dd> 41 41 42 <?php if ( ! empty( $stats['empty_topic_tag_count'] ) ) : ?>42 <?php if ( ! empty( $stats['empty_topic_tag_count'] ) ) : ?> 43 43 44 44 <dt><?php esc_html_e( 'Empty Topic Tags', 'bbpress' ); ?></dt> … … 49 49 <?php endif; ?> 50 50 51 <?php if ( ! empty( $stats['topic_count_hidden'] ) ) : ?>51 <?php if ( ! empty( $stats['topic_count_hidden'] ) ) : ?> 52 52 53 53 <dt><?php esc_html_e( 'Hidden Topics', 'bbpress' ); ?></dt> … … 60 60 <?php endif; ?> 61 61 62 <?php if ( ! empty( $stats['reply_count_hidden'] ) ) : ?>62 <?php if ( ! empty( $stats['reply_count_hidden'] ) ) : ?> 63 63 64 64 <dt><?php esc_html_e( 'Hidden Replies', 'bbpress' ); ?></dt> -
trunk/src/templates/default/bbpress/form-forum.php
r5770 r5829 43 43 <?php do_action( 'bbp_theme_before_forum_form_notices' ); ?> 44 44 45 <?php if ( ! bbp_is_forum_edit() && bbp_is_forum_closed() ) : ?>45 <?php if ( ! bbp_is_forum_edit() && bbp_is_forum_closed() ) : ?> 46 46 47 47 <div class="bbp-template-notice"> -
trunk/src/templates/default/bbpress/form-reply.php
r5770 r5829 29 29 <?php do_action( 'bbp_theme_before_reply_form_notices' ); ?> 30 30 31 <?php if ( ! bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?>31 <?php if ( ! bbp_is_topic_open() && ! bbp_is_reply_edit() ) : ?> 32 32 33 33 <div class="bbp-template-notice"> … … 83 83 <?php endif; ?> 84 84 85 <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?>85 <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( ! bbp_is_reply_edit() || ( bbp_is_reply_edit() && ! bbp_is_reply_anonymous() ) ) ) : ?> 86 86 87 87 <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?> -
trunk/src/templates/default/bbpress/form-topic.php
r5770 r5829 49 49 <?php do_action( 'bbp_theme_before_topic_form_notices' ); ?> 50 50 51 <?php if ( ! bbp_is_topic_edit() && bbp_is_forum_closed() ) : ?>51 <?php if ( ! bbp_is_topic_edit() && bbp_is_forum_closed() ) : ?> 52 52 53 53 <div class="bbp-template-notice"> … … 112 112 <?php endif; ?> 113 113 114 <?php if ( ! bbp_is_single_forum() ) : ?>114 <?php if ( ! bbp_is_single_forum() ) : ?> 115 115 116 116 <?php do_action( 'bbp_theme_before_topic_form_forum' ); ?> … … 158 158 <?php endif; ?> 159 159 160 <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( !bbp_is_topic_edit() || ( bbp_is_topic_edit() && !bbp_is_topic_anonymous() ) ) ) : ?>160 <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( ! bbp_is_topic_edit() || ( bbp_is_topic_edit() && ! bbp_is_topic_anonymous() ) ) ) : ?> 161 161 162 162 <?php do_action( 'bbp_theme_before_topic_form_subscriptions' ); ?> … … 250 250 <?php endif; ?> 251 251 252 <?php if ( ! bbp_is_single_forum() ) : ?>252 <?php if ( ! bbp_is_single_forum() ) : ?> 253 253 254 254 </div> -
trunk/src/templates/default/bbpress/loop-single-topic.php
r5770 r5829 61 61 <?php do_action( 'bbp_theme_after_topic_started_by' ); ?> 62 62 63 <?php if ( ! bbp_is_single_forum() || ( bbp_get_topic_forum_id() !== bbp_get_forum_id() ) ) : ?>63 <?php if ( ! bbp_is_single_forum() || ( bbp_get_topic_forum_id() !== bbp_get_forum_id() ) ) : ?> 64 64 65 65 <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
Note: See TracChangeset
for help on using the changeset viewer.