Changeset 154422
- Timestamp:
- 09/13/2009 05:21:43 PM (16 years ago)
- File:
-
- 1 edited
-
twitter-sp2/trunk/twitter-sp2.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
twitter-sp2/trunk/twitter-sp2.php
r154402 r154422 86 86 87 87 88 function get_custom_excerpt($post_id, $limit = 100) {88 function sp2_get_custom_excerpt($post_id, $limit = 100) { 89 89 $post = get_post($post_id); //gets the post based on id 90 90 $text = $post->post_content; // gets the contents … … 191 191 break; 192 192 case 'post_excerpt': 193 $return_text = get_custom_excerpt($post_id) . " " . $short_url;193 $return_text = sp2_get_custom_excerpt($post_id) . " " . $short_url; 194 194 break; 195 195 case 'title_excerpt': 196 196 $text = $title . ': '; 197 197 $limit = 110 - strlen($text); 198 $text .= get_custom_excerpt($post_id, $limit);198 $text .= sp2_get_custom_excerpt($post_id, $limit); 199 199 $return_text = $text . " " . $short_url; 200 200 /* … … 203 203 2 chars ": " after the title 204 204 1 char " " after the text 205 3 chars "..." after the text - generated by get_custom_excerpt205 3 chars "..." after the text - generated by sp2_get_custom_excerpt 206 206 --- 207 207 114 chars left for the text … … 221 221 $limit = 145 - strlen($text); // why did I putted 145 here?? note to self: comment your code 222 222 223 $text = str_replace("%fragment%", get_custom_excerpt($post_id, $limit), $text);223 $text = str_replace("%fragment%", sp2_get_custom_excerpt($post_id, $limit), $text); 224 224 225 225 }
Note: See TracChangeset
for help on using the changeset viewer.