Changeset 6791 for trunk/src/includes/replies/template.php
- Timestamp:
- 03/29/2018 06:03:12 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/template.php
r6777 r6791 828 828 829 829 /** 830 * Return array of public reply statuses. 831 * 832 * @since 2.6.0 bbPress (r6705) 833 * 834 * @return array 835 */ 836 function bbp_get_public_reply_statuses() { 837 $statuses = array( 838 bbp_get_public_status_id() 839 ); 840 841 // Filter & return 842 return (array) apply_filters( 'bbp_get_public_reply_statuses', $statuses ); 843 } 844 845 /** 846 * Return array of non-public reply statuses. 847 * 848 * @since 2.6.0 bbPress (r6791) 849 * 850 * @return array 851 */ 852 function bbp_get_non_public_reply_statuses() { 853 $statuses = array( 854 bbp_get_trash_status_id(), 855 bbp_get_spam_status_id(), 856 bbp_get_pending_status_id() 857 ); 858 859 // Filter & return 860 return (array) apply_filters( 'bbp_get_non_public_reply_statuses', $statuses ); 861 } 862 863 /** 864 * Is the reply publicly viewable? 865 * 866 * See bbp_get_public_reply_statuses() for public statuses. 867 * 868 * @since 2.6.0 bbPress (r6391) 869 * 870 * @param int $reply_id Optional. Reply id 871 * @return bool True if public, false if not. 872 */ 873 function bbp_is_reply_public( $reply_id = 0 ) { 874 $reply_id = bbp_get_reply_id( $reply_id ); 875 $status = bbp_get_reply_status( $reply_id ); 876 $public = bbp_get_public_reply_statuses(); 877 $is_public = in_array( $status, $public, true ); 878 879 // Filter & return 880 return (bool) apply_filters( 'bbp_is_reply_public', $is_public, $reply_id ); 881 } 882 883 /** 830 884 * Is the reply not spam or deleted? 831 885 *
Note: See TracChangeset
for help on using the changeset viewer.