Changeset 868 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
- Timestamp:
- 09/23/2014 06:30:18 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r861 r868 73 73 endif; 74 74 75 if ( ! function_exists( 'wporg_developer_ example' ) ) :75 if ( ! function_exists( 'wporg_developer_user_note' ) ) : 76 76 /** 77 * Template for examples.77 * Template for user contributed notes. 78 78 * 79 * Used as a callback by wp_list_comments() for displaying the examples.79 * Used as a callback by wp_list_comments() for displaying the notes. 80 80 */ 81 function wporg_developer_ example( $comment, $args, $depth ) {81 function wporg_developer_user_note( $comment, $args, $depth ) { 82 82 $GLOBALS['comment'] = $comment; 83 83 … … 130 130 131 131 <?php if ( '0' == $comment->comment_approved ) : ?> 132 <p class="comment-awaiting-moderation"><?php _e( 'Your example is awaiting moderation.', 'wporg' ); ?></p>132 <p class="comment-awaiting-moderation"><?php _e( 'Your note is awaiting moderation.', 'wporg' ); ?></p> 133 133 <?php endif; ?> 134 134 </footer> … … 149 149 endif; 150 150 } 151 endif; // ends check for wporg_developer_ comment()151 endif; // ends check for wporg_developer_user_note() 152 152 153 153 if ( ! function_exists( 'wporg_developer_posted_on' ) ) : … … 226 226 227 227 <?php if ( $comment->comment_approved == '0' ) : ?> 228 <em class="comment-awaiting-moderation"><?php _e( 'Your example is awaiting moderation.', 'wporg' ); ?></em>228 <em class="comment-awaiting-moderation"><?php _e( 'Your note is awaiting moderation.', 'wporg' ); ?></em> 229 229 <br /> 230 230 <?php endif; ?> 231 231 232 <pre class=" example-content"><?php echo htmlentities( get_comment_text() ); ?></pre>232 <pre class="user-note-content"><?php echo htmlentities( get_comment_text() ); ?></pre> 233 233 234 234 <footer class="comment-meta"> … … 716 716 717 717 /** 718 * Does the post type support having examples?718 * Does the post type support having user notes? 719 719 * 720 720 * @param string Optional. The post type name. If blank, assumes current post type. … … 722 722 * @return boolean 723 723 */ 724 function post_type_supports_ examples( $post_type = null ) {724 function post_type_supports_user_notes( $post_type = null ) { 725 725 $post_type = $post_type ? $post_type : get_post_type(); 726 726 … … 812 812 813 813 /** 814 * Indicates if the current user can post a n example.814 * Indicates if the current user can post a user contibuted note. 815 815 * 816 816 * This only affects post types wp-parser-* as they are the only things 817 * that can have examples.817 * that can have user contributed notes. 818 818 * 819 819 * A custom check can be performed by hooking the filter 820 * 'wporg_devhub-can_user_post_ example' and returning a820 * 'wporg_devhub-can_user_post_note' and returning a 821 821 * value other than null. 822 822 * 823 * By default, the ability to post examples is restricted to members of the823 * By default, the ability to post notes is restricted to members of the 824 824 * blog. 825 825 * 826 826 * @param int $post_id The post ID. 827 827 * 828 * @return bool True if the user can post a n example.829 */ 830 function can_user_post_ example( $open, $post_id ) {831 832 // Only proceed if the post type is one that has examples.828 * @return bool True if the user can post a note. 829 */ 830 function can_user_post_note( $open, $post_id ) { 831 832 // Only proceed if the post type is one that has user contributed notes. 833 833 if ( 0 !== strpos( get_post_type( (int) $post_id ), 'wp-parser-' ) ) { 834 // Temporarily disable commenting that isn't for a n example since various834 // Temporarily disable commenting that isn't for a note since various 835 835 // changes need to take place to enable regular commenting. 836 836 return false; //$open; … … 838 838 839 839 // Permit default logic to be overridden via filter that returns value other than null. 840 if ( null !== ( $can = apply_filters( 'wporg_devhub-can_user_post_ example', null, $post_id ) ) ) {840 if ( null !== ( $can = apply_filters( 'wporg_devhub-can_user_post_note', null, $post_id ) ) ) { 841 841 return $can; 842 842 } 843 843 844 // Default to limiting ability to post examples to members of the blog.844 // Default to limiting ability to post notes to members of the blog. 845 845 return is_user_member_of_blog(); 846 846 }
Note: See TracChangeset
for help on using the changeset viewer.