post_type; /* // sticky for Sticky Posts if ( is_sticky($post->ID) && is_home()) $classes[] = 'sticky'; */ // hentry for hAtom compliace $classes[] = 'hentry'; // Categories foreach ( (array) get_the_category($post->ID) as $cat ) { if ( empty($cat->slug ) ) continue; $classes[] = 'category-' . $cat->slug; } // Tags foreach ( (array) get_the_tags($post->ID) as $tag ) { if ( empty($tag->slug ) ) continue; $classes[] = 'tag-' . $tag->slug; } if ( !empty($class) ) { if ( !is_array( $class ) ) $class = preg_split('#\s+#', $class); $classes = array_merge($classes, $class); } return apply_filters('post_class', $classes, $class, $post_id); } endif; /** * Generates semantic classes for each comment element * * @since 2.7.0 * * @param string|array $class One or more classes to add to the class list * @param int $comment_id An optional comment ID * @param int $post_id An optional post ID * @param bool $echo Whether comment_class should echo or return */ if ( ! function_exists('comment_class') ): function comment_class( $class = '', $comment_id = null, $post_id = null, $echo = true ) { // Separates classes with a single space, collates classes for comment DIV $class = 'class="' . join( ' ', get_comment_class( $class, $comment_id, $post_id ) ) . '"'; if ( $echo) echo $class; else return $class; } endif; /** * Returns the classes for the comment div as an array * * @since 2.7.0 * * @param string|array $class One or more classes to add to the class list * @param int $comment_id An optional comment ID * @param int $post_id An optional post ID * @return array Array of classes */ if ( ! function_exists('get_comment_class') ): function get_comment_class( $class = '', $comment_id = null, $post_id = null ) { global $comment_alt, $comment_depth, $comment_thread_alt; $comment = get_comment($comment_id); $classes = array(); // Get the comment type (comment, trackback), $classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type; // If the comment author has an id (registered), then print the log in name if ( $comment->user_id > 0 && $user = get_userdata($comment->user_id) ) { // For all registered users, 'byuser' $classes[] = 'byuser comment-author-' . $user->user_nicename; // For comment authors who are the author of the post if ( $post = get_post($post_id) ) { if ( $comment->user_id === $post->post_author ) $classes[] = 'bypostauthor'; } } if ( empty($comment_alt) ) $comment_alt = 0; if ( empty($comment_depth) ) $comment_depth = 1; if ( empty($comment_thread_alt) ) $comment_thread_alt = 0; if ( $comment_alt % 2 ) { $classes[] = 'odd'; $classes[] = 'alt'; } else { $classes[] = 'even'; } $comment_alt++; // Alt for top-level comments if ( 1 == $comment_depth ) { if ( $comment_thread_alt % 2 ) { $classes[] = 'thread-odd'; $classes[] = 'thread-alt'; } else { $classes[] = 'thread-even'; } $comment_thread_alt++; } $classes[] = "depth-$comment_depth"; if ( !empty($class) ) { if ( !is_array( $class ) ) $class = preg_split('#\s+#', $class); $classes = array_merge($classes, $class); } return apply_filters('comment_class', $classes, $class, $comment_id, $post_id); } endif; /** * Whether post requires password and correct password has been provided. * * @since 2.7.0 * * @param int|object $post An optional post. Global $post used if not provided. * @return bool false if a password is not required or the correct password cookie is present, true otherwise. */ if ( ! function_exists('post_password_required') ): function post_password_required( $post = null ) { $post = get_post($post); if ( empty($post->post_password) ) return false; if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) ) return true; if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) return true; return false; } endif; /** * Returns the Log Out URL. * * Returns the URL that allows the user to log out of the site * * @since 2.7 * @uses wp_nonce_url() To protect against CSRF * @uses site_url() To generate the log in URL * * @param string $redirect Path to redirect to on logout. */ if ( ! function_exists('wp_logout_url') ): function wp_logout_url($redirect = '') { if ( strlen($redirect) ) $redirect = "&redirect_to=$redirect"; return wp_nonce_url( site_url("wp-login.php?action=logout$redirect", 'login'), 'log-out' ); } endif; /** * Display or retrieve list of pages with optional home link. * * The arguments are listed below and part of the arguments are for {@link * wp_list_pages()} function. Check that function for more info on those * arguments. * *