Changeset 2812 for branches/plugin/bbp-includes/bbp-general-template.php
- Timestamp:
- 01/17/2011 06:57:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-general-template.php
r2811 r2812 8 8 */ 9 9 10 /** START - WordPress Add-on Actions******************************************/10 /** Add-on Actions ************************************************************/ 11 11 12 12 /** … … 32 32 } 33 33 34 /** END - WordPress Add-on Actions ********************************************/ 35 36 /** START is_ Functions *******************************************************/ 34 /** is_ ***********************************************************************/ 37 35 38 36 /** … … 319 317 } 320 318 321 /** END is_ Functions *********************************************************/ 322 323 /** START Form Functions ******************************************************/ 319 /** Forms *********************************************************************/ 324 320 325 321 /** … … 619 615 620 616 <?php wp_referer_field(); ?> 617 621 618 <?php wp_nonce_field( 'update-user_' . bbp_get_displayed_user_id() ); 622 619 } … … 659 656 } 660 657 661 /** END Form Functions ********************************************************/ 662 663 /** Start Views ***************************************************************/ 658 /** Views *********************************************************************/ 664 659 665 660 /** … … 772 767 } 773 768 774 /** End Views *****************************************************************/ 775 776 /** Start General Functions ***************************************************/ 777 778 /** 779 * Display possible error messages inside a template file 780 * 781 * @since bbPress (r2688) 782 * 783 * @uses WP_Error bbPress::errors::get_error_codes() To get the error codes 784 * @uses WP_Error bbPress::errors::get_error_messages() To get the error 785 * messages 786 * @uses is_wp_error() To check if it's a {@link WP_Error} 787 */ 788 function bbp_error_messages() { 789 global $bbp; 790 791 if ( isset( $bbp->errors ) && is_wp_error( $bbp->errors ) && $bbp->errors->get_error_codes() ) : ?> 792 793 <div class="bbp-template-notice error"> 794 <p> 795 <?php echo implode( "</p>\n<p>", $bbp->errors->get_error_messages() ); ?> 796 </p> 797 </div> 798 799 <?php endif; 800 } 769 /** Query *********************************************************************/ 770 771 /** 772 * Get the '_bbp_query_name' setting 773 * 774 * @since bbPress (r2695) 775 * 776 * @uses get_query_var() To get the query var '_bbp_query_name' 777 * @return string To return the query var value 778 */ 779 function bbp_get_query_name() { 780 return get_query_var( '_bbp_query_name' ); 781 } 782 783 /** 784 * Set the '_bbp_query_name' setting to $name 785 * 786 * @since bbPress (r2692) 787 * 788 * @param string $name What to set the query var to 789 * @uses set_query_var() To set the query var '_bbp_query_name' 790 */ 791 function bbp_set_query_name( $name = '' ) { 792 set_query_var( '_bbp_query_name', $name ); 793 } 794 795 /** 796 * Used to clear the '_bbp_query_name' setting 797 * 798 * @since bbPress (r2692) 799 * 800 * @uses bbp_set_query_name() To set the query var '_bbp_query_name' to '' 801 */ 802 function bbp_reset_query_name() { 803 bbp_set_query_name(); 804 } 805 806 /** Breadcrumbs ***************************************************************/ 801 807 802 808 /** … … 890 896 } 891 897 898 /** Topic Tags ***************************************************************/ 899 892 900 /** 893 901 * Output all of the allowed tags in HTML format with attributes. … … 919 927 } 920 928 921 /** Start Query Functions *****************************************************/ 922 923 /** 924 * Get the '_bbp_query_name' setting 925 * 926 * @since bbPress (r2695) 927 * 928 * @uses get_query_var() To get the query var '_bbp_query_name' 929 * @return string To return the query var value 930 */ 931 function bbp_get_query_name() { 932 return get_query_var( '_bbp_query_name' ); 933 } 934 935 /** 936 * Set the '_bbp_query_name' setting to $name 937 * 938 * @since bbPress (r2692) 939 * 940 * @param string $name What to set the query var to 941 * @uses set_query_var() To set the query var '_bbp_query_name' 942 */ 943 function bbp_set_query_name( $name = '' ) { 944 set_query_var( '_bbp_query_name', $name ); 945 } 946 947 /** 948 * Used to clear the '_bbp_query_name' setting 949 * 950 * @since bbPress (r2692) 951 * 952 * @uses bbp_set_query_name() To set the query var '_bbp_query_name' to '' 953 */ 954 function bbp_reset_query_name() { 955 bbp_set_query_name(); 929 /** Errors ********************************************************************/ 930 931 /** 932 * Display possible error messages inside a template file 933 * 934 * @since bbPress (r2688) 935 * 936 * @uses WP_Error bbPress::errors::get_error_codes() To get the error codes 937 * @uses WP_Error bbPress::errors::get_error_messages() To get the error 938 * messages 939 * @uses is_wp_error() To check if it's a {@link WP_Error} 940 */ 941 function bbp_error_messages() { 942 global $bbp; 943 944 if ( isset( $bbp->errors ) && is_wp_error( $bbp->errors ) && $bbp->errors->get_error_codes() ) : ?> 945 946 <div class="bbp-template-notice error"> 947 <p> 948 <?php echo implode( "</p>\n<p>", $bbp->errors->get_error_messages() ); ?> 949 </p> 950 </div> 951 952 <?php endif; 956 953 } 957 954
Note: See TracChangeset
for help on using the changeset viewer.