Changes from branches/3.2/wp-includes/post-template.php at r18415 to trunk/wp-includes/post-template.php at r19240
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r18415 r19240 161 161 * 162 162 * @param string $more_link_text Optional. Content for when there is more text. 163 * @param string $stripteaser Optional. Teaser content before the more text.164 */ 165 function the_content($more_link_text = null, $stripteaser = 0) {163 * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false. 164 */ 165 function the_content($more_link_text = null, $stripteaser = false) { 166 166 $content = get_the_content($more_link_text, $stripteaser); 167 167 $content = apply_filters('the_content', $content); … … 176 176 * 177 177 * @param string $more_link_text Optional. Content for when there is more text. 178 * @param string $stripteaser Optional. Teaser content before the more text.178 * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false. 179 179 * @return string 180 180 */ 181 function get_the_content($more_link_text = null, $stripteaser = 0) {181 function get_the_content($more_link_text = null, $stripteaser = false) { 182 182 global $post, $more, $page, $pages, $multipage, $preview; 183 183 … … 208 208 } 209 209 if ( (false !== strpos($post->post_content, '<!--noteaser-->') && ((!$multipage) || ($page==1))) ) 210 $stripteaser = 1;210 $stripteaser = true; 211 211 $teaser = $content[0]; 212 if ( ($more) && ($stripteaser) && ($hasTeaser))212 if ( $more && $stripteaser && $hasTeaser ) 213 213 $teaser = ''; 214 214 $output .= $teaser; … … 330 330 331 331 // Post Format 332 $post_format = get_post_format( $post->ID );333 334 332 if ( post_type_supports( $post->post_type, 'post-formats' ) ) { 333 $post_format = get_post_format( $post->ID ); 334 335 335 if ( $post_format && !is_wp_error($post_format) ) 336 336 $classes[] = 'format-' . sanitize_html_class( $post_format ); … … 433 433 434 434 // Post Format 435 $post_format = get_post_format( $post->ID ); 436 437 if ( $post_format && !is_wp_error($post_format) ) 438 $classes[] = 'single-format-' . sanitize_html_class( $post_format ); 439 else 440 $classes[] = 'single-format-standard'; 435 if ( post_type_supports( $post->post_type, 'post-formats' ) ) { 436 $post_format = get_post_format( $post->ID ); 437 438 if ( $post_format && !is_wp_error($post_format) ) 439 $classes[] = 'single-format-' . sanitize_html_class( $post_format ); 440 else 441 $classes[] = 'single-format-standard'; 442 } 441 443 442 444 if ( is_attachment() ) { … … 506 508 $classes[] = 'admin-bar'; 507 509 510 if ( get_background_image() || get_background_color() ) 511 $classes[] = 'custom-background'; 512 508 513 $page = $wp_query->get( 'page' ); 509 514 … … 563 568 return true; 564 569 565 if ( $_COOKIE['wp-postpass_' . COOKIEHASH]!= $post->post_password )570 if ( stripslashes( $_COOKIE['wp-postpass_' . COOKIEHASH] ) != $post->post_password ) 566 571 return true; 567 572 … … 738 743 foreach ( (array) $keys as $key ) { 739 744 $keyt = trim($key); 740 if ( '_' == $keyt[0])745 if ( is_protected_meta( $keyt, 'post' ) ) 741 746 continue; 742 747 $values = array_map('trim', get_post_custom_values($key)); … … 774 779 $pages = get_pages($r); 775 780 $output = ''; 776 $name = esc_attr($name);777 781 // Back-compat with old system where both id and name were based on $name argument 778 782 if ( empty($id) ) … … 780 784 781 785 if ( ! empty($pages) ) { 782 $output = "<select name= \"$name\" id=\"$id\">\n";786 $output = "<select name='" . esc_attr( $name ) . "' id='" . esc_attr( $id ) . "'>\n"; 783 787 if ( $show_option_no_change ) 784 788 $output .= "\t<option value=\"-1\">$show_option_no_change</option>"; … … 1039 1043 } 1040 1044 1041 $css_class = implode( ' ', apply_filters('page_css_class', $css_class, $page));1042 1043 $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '" title="' . esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page->post_title, $page->ID ) ) ) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';1045 $css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); 1046 1047 $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>'; 1044 1048 1045 1049 if ( !empty($show_date) ) { … … 1106 1110 $output .= ' selected="selected"'; 1107 1111 $output .= '>'; 1108 $title = apply_filters( 'list_pages', $page->post_title );1112 $title = apply_filters( 'list_pages', $page->post_title, $page ); 1109 1113 $output .= $pad . esc_html( $title ); 1110 1114 $output .= "</option>\n"; … … 1149 1153 * @return string HTML content. 1150 1154 */ 1151 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false) {1152 $id = intval( $id);1155 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false ) { 1156 $id = intval( $id ); 1153 1157 $_post = & get_post( $id ); 1154 1158 1155 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )1156 return __( 'Missing Attachment');1159 if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) ) 1160 return __( 'Missing Attachment' ); 1157 1161 1158 1162 if ( $permalink ) 1159 $url = get_attachment_link( $_post->ID);1160 1161 $post_title = esc_attr( $_post->post_title);1162 1163 if ( $text ) {1164 $link_text = esc_attr( $text);1165 } elseif ( ( is_int($size) && $size != 0 ) or ( is_string($size) && $size != 'none' ) or $size != false ) {1166 $link_text = wp_get_attachment_image( $id, $size, $icon);1167 } else {1163 $url = get_attachment_link( $_post->ID ); 1164 1165 $post_title = esc_attr( $_post->post_title ); 1166 1167 if ( $text ) 1168 $link_text = esc_attr( $text ); 1169 elseif ( $size && 'none' != $size ) 1170 $link_text = wp_get_attachment_image( $id, $size, $icon ); 1171 else 1168 1172 $link_text = ''; 1169 } 1170 1171 if( trim($link_text) == '' ) 1173 1174 if ( trim( $link_text ) == '' ) 1172 1175 $link_text = $_post->post_title; 1173 1176
Note: See TracChangeset
for help on using the changeset viewer.