Ticket #1595: prerendering__functions.php.diff
File prerendering__functions.php.diff, 1.3 KB (added by , 18 years ago) |
---|
-
functions.php
916 916 917 917 // Setup global post data. 918 918 function setup_postdata($post) { 919 global $ id, $postdata, $authordata, $day, $page, $pages, $multipage, $more, $numpages, $wp_query;919 global $wpdb, $id, $postdata, $authordata, $day, $page, $pages, $multipage, $more, $numpages, $wp_query; 920 920 global $pagenow; 921 921 922 922 $id = $post->ID; … … 931 931 $page = 1; 932 932 if (is_single() || is_page()) 933 933 $more = 1; 934 $content = $post->post_content; 934 935 // check for missing post_content_filtered 936 if ( strlen($post->post_content_filtered) == 0 && strlen($post->post_content) != 0 ) { 937 // we need to run the filters 938 $post->post_content_filtered = apply_filters('the_content_filtered', $post->post_content); 939 $wpdb->query("UPDATE $wpdb->posts SET post_content_filtered = '$post->post_content_filtered' WHERE ID = '$post->ID'"); 940 } 941 942 $content = $post->post_content_filtered; 935 943 if (preg_match('/<!--nextpage-->/', $content)) { 936 944 if ($page > 1) 937 945 $more = 1; … … 942 950 $pages = explode('<!--nextpage-->', $content); 943 951 $numpages = count($pages); 944 952 } else { 945 $pages[0] = $post->post_content ;953 $pages[0] = $post->post_content_filtered; 946 954 $multipage = 0; 947 955 } 948 956 return true;