- Timestamp:
- 03/08/2017 04:46:28 PM (10 years ago)
- Location:
- branches/2.8
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/bp-templates/bp-legacy/buddypress-functions.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8
-
branches/2.8/src/bp-templates/bp-legacy/buddypress-functions.php
r11439 r11450 874 874 case 'mentions': 875 875 $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/'; 876 bp_activity_clear_new_mentions( bp_loggedin_user_id() ); 876 877 if ( isset( $_POST['_wpnonce_activity_filter'] ) && wp_verify_nonce( wp_unslash( $_POST['_wpnonce_activity_filter'] ), 'activity_filter' ) ) { 878 bp_activity_clear_new_mentions( bp_loggedin_user_id() ); 879 } 880 877 881 break; 878 882 default: … … 1195 1199 return; 1196 1200 1201 if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['nonce'] ), 'mark_favorite' ) ) { 1202 return; 1203 } 1204 1197 1205 if ( bp_activity_add_user_favorite( $_POST['id'] ) ) 1198 1206 _e( 'Remove Favorite', 'buddypress' ); … … 1214 1222 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 1215 1223 return; 1224 1225 if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['nonce'] ), 'unmark_favorite' ) ) { 1226 return; 1227 } 1216 1228 1217 1229 if ( bp_activity_remove_user_favorite( $_POST['id'] ) ) … … 1524 1536 return; 1525 1537 1526 if ( ! isset( $_POST['notice_id'] ) ) { 1538 $nonce_check = isset( $_POST['nonce'] ) && wp_verify_nonce( wp_unslash( $_POST['nonce'] ), 'bp_messages_close_notice' ); 1539 1540 if ( ! $nonce_check || ! isset( $_POST['notice_id'] ) ) { 1527 1541 echo "-1<div id='message' class='error'><p>" . __( 'There was a problem closing the notice.', 'buddypress' ) . '</p></div>'; 1528 1542 … … 1601 1615 * Mark a private message as unread in your inbox via a POST request. 1602 1616 * 1617 * No longer used. 1618 * 1603 1619 * @since 1.2.0 1620 * @deprecated 2.2.0 1604 1621 * 1605 1622 * @return mixed String on error, void on success. 1606 1623 */ 1607 1624 function bp_legacy_theme_ajax_message_markunread() { 1608 // Bail if not a POST action. 1609 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 1610 return; 1611 1612 if ( ! isset($_POST['thread_ids']) ) { 1613 echo "-1<div id='message' class='error'><p>" . __( 'There was a problem marking messages as unread.', 'buddypress' ) . '</p></div>'; 1614 1615 } else { 1616 $thread_ids = explode( ',', $_POST['thread_ids'] ); 1617 1618 for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { 1619 BP_Messages_Thread::mark_as_unread( (int) $thread_ids[$i] ); 1620 } 1621 } 1622 1623 exit; 1625 die( '-1' ); 1624 1626 } 1625 1627 … … 1627 1629 * Mark a private message as read in your inbox via a POST request. 1628 1630 * 1631 * No longer used. 1632 * 1629 1633 * @since 1.2.0 1634 * @deprecated 2.2.0 1630 1635 * 1631 1636 * @return mixed String on error, void on success. 1632 1637 */ 1633 1638 function bp_legacy_theme_ajax_message_markread() { 1634 // Bail if not a POST action. 1635 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 1636 return; 1637 1638 if ( ! isset($_POST['thread_ids']) ) { 1639 echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as read.', 'buddypress' ) . '</p></div>'; 1640 1641 } else { 1642 $thread_ids = explode( ',', $_POST['thread_ids'] ); 1643 1644 for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { 1645 BP_Messages_Thread::mark_as_read( (int) $thread_ids[$i] ); 1646 } 1647 } 1648 1649 exit; 1639 die( '-1' ); 1650 1640 } 1651 1641 … … 1653 1643 * Delete a private message(s) in your inbox via a POST request. 1654 1644 * 1645 * No longer used. 1646 * 1655 1647 * @since 1.2.0 1648 * @deprecated 2.2.0 1656 1649 * 1657 1650 * @return string HTML 1658 1651 */ 1659 1652 function bp_legacy_theme_ajax_messages_delete() { 1660 // Bail if not a POST action. 1661 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 1662 return; 1663 1664 if ( ! isset($_POST['thread_ids']) ) { 1665 echo "-1<div id='message' class='error'><p>" . __( 'There was a problem deleting messages.', 'buddypress' ) . '</p></div>'; 1666 1667 } else { 1668 $thread_ids = wp_parse_id_list( $_POST['thread_ids'] ); 1669 messages_delete_thread( $thread_ids ); 1670 1671 _e( 'Messages deleted.', 'buddypress' ); 1672 } 1673 1674 exit; 1653 die( '-1' ); 1675 1654 } 1676 1655
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)