Changeset 8667
- Timestamp:
- 07/22/2014 08:44:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/bp-notifications-template.php
r8666 r8667 725 725 function bp_get_the_notification_mark_read_link() { 726 726 727 // Get the URL with nonce, action, and id728 $url = wp_nonce_url( add_query_arg( array( 'action' => 'read', 'notification_id' => bp_get_the_notification_id() ), bp_get_notifications_unread_permalink() ), 'bp_notification_mark_read_' . bp_get_the_notification_id() );729 730 727 // Start the output buffer 731 728 ob_start(); ?> 732 729 733 <a href="<?php echo esc_url( $url); ?>" class="mark-read primary"><?php _e( 'Read', 'buddypress' ); ?></a>730 <a href="<?php bp_the_notification_mark_read_url(); ?>" class="mark-read primary"><?php _e( 'Read', 'buddypress' ); ?></a> 734 731 735 732 <?php $retval = ob_get_clean(); 736 733 737 734 return apply_filters( 'bp_get_the_notification_mark_read_link', $retval ); 735 } 736 737 /** 738 * Output the URL used for marking a single notification as read 739 * 740 * Since this function directly outputs a URL, it is escaped. 741 * 742 * @since BuddyPress (2.1.0) 743 * 744 * @uses bp_get_the_notification_mark_read_url() 745 */ 746 function bp_the_notification_mark_read_url() { 747 echo esc_url( bp_get_the_notification_mark_read_url() ); 748 } 749 /** 750 * Return the URL used for marking a single notification as read 751 * 752 * @since BuddyPress (2.1.0) 753 */ 754 function bp_get_the_notification_mark_read_url() { 755 756 // Get the notification ID 757 $id = bp_get_the_notification_id(); 758 759 // Get the args to add to the URL 760 $args = array( 761 'action' => 'read', 762 'notification_id' => $id 763 ); 764 765 // Add the args to the URL 766 $url = add_query_arg( $args, bp_get_notifications_unread_permalink() ); 767 768 // Add the nonce 769 $url = wp_nonce_url( $url, 'bp_notification_mark_read_' . $id ); 770 771 // Filter and return 772 return apply_filters( 'bp_get_the_notification_mark_read_url', $url ); 738 773 } 739 774 … … 755 790 function bp_get_the_notification_mark_unread_link() { 756 791 757 // Get the URL with nonce, action, and id758 $url = wp_nonce_url( add_query_arg( array( 'action' => 'unread', 'notification_id' => bp_get_the_notification_id() ), bp_get_notifications_read_permalink() ), 'bp_notification_mark_unread_' . bp_get_the_notification_id() );759 760 792 // Start the output buffer 761 793 ob_start(); ?> 762 794 763 <a href="<?php echo esc_url( $url); ?>" class="mark-unread primary"><?php _e( 'Unread', 'buddypress' ); ?></a>795 <a href="<?php bp_the_notification_mark_unread_url(); ?>" class="mark-unread primary"><?php _e( 'Unread', 'buddypress' ); ?></a> 764 796 765 797 <?php $retval = ob_get_clean(); 766 798 767 799 return apply_filters( 'bp_get_the_notification_mark_unread_link', $retval ); 800 } 801 802 /** 803 * Output the URL used for marking a single notification as unread 804 * 805 * Since this function directly outputs a URL, it is escaped. 806 * 807 * @since BuddyPress (2.1.0) 808 * 809 * @uses bp_get_the_notification_mark_unread_url() 810 */ 811 function bp_the_notification_mark_unread_url() { 812 echo esc_url( bp_get_the_notification_mark_unread_url() ); 813 } 814 /** 815 * Return the URL used for marking a single notification as unread 816 * 817 * @since BuddyPress (2.1.0) 818 */ 819 function bp_get_the_notification_mark_unread_url() { 820 821 // Get the notification ID 822 $id = bp_get_the_notification_id(); 823 824 // Get the args to add to the URL 825 $args = array( 826 'action' => 'unread', 827 'notification_id' => $id 828 ); 829 830 // Add the args to the URL 831 $url = add_query_arg( $args, bp_get_notifications_read_permalink() ); 832 833 // Add the nonce 834 $url = wp_nonce_url( $url, 'bp_notification_mark_unread_' . $id ); 835 836 // Filter and return 837 return apply_filters( 'bp_get_the_notification_mark_unread_url', $url ); 768 838 } 769 839 … … 850 920 } 851 921 852 // Args to add to the link 922 // Get the ID 923 $id = bp_get_the_notification_id(); 924 925 // Get the args to add to the URL 853 926 $args = array( 854 927 'action' => 'delete', 855 'notification_id' => bp_get_the_notification_id()928 'notification_id' => $id 856 929 ); 857 930 … … 860 933 861 934 // Add the nonce 862 $url = wp_nonce_url( $url, 'bp_notification_delete_' . bp_get_the_notification_id());935 $url = wp_nonce_url( $url, 'bp_notification_delete_' . $id ); 863 936 864 937 // Filter and return
Note: See TracChangeset
for help on using the changeset viewer.