array( // on allow a tags
'href' => array() // and those anchors can only have href attribute
)
);
// Probably a good idea to make sure your data is set
if( isset( $_POST['url'] ) )
update_post_meta( $post_id, 'url', wp_kses( $_POST['url'], $allowed ) );
}
function recentPosts() {
$rPosts = new WP_Query();
$rPosts->query('showposts=1');
while ($rPosts->have_posts()) : $rPosts->the_post(); ?>
)|(\ )|(\ )/", " ", $content);
$content = strip_tags($content);
if(strlen($content) < $size)
return $content;
$content = substr($content, 0, $size);
$spaceloc = strrpos($content, " ");
if($spaceloc)
{
$content = substr($content, 0, $spaceloc);
$content.= "...";
}
return $content;
}
/* a custom callback function that displays a meaningful title
* depending on the page being rendered
*/
function reuben_filter_wp_title($title, $sep, $sep_location) {
// add white space around $sep
$sep = ' ' . $sep . ' ';
$site_description = get_bloginfo('description');
if ($site_description && (is_home() || is_front_page()))
$custom = $sep . $site_description;
elseif(is_category())
$custom = $sep . __('Category', 'reuben');
elseif(is_tag())
$custom = $sep . __('Tag', 'reuben');
elseif(is_author())
$custom = $sep . __('Author', 'reuben');
elseif(is_year() || is_month() || is_day())
$custom = $sep . __('Archives', 'reuben');
else
$custom = '';
// get the page number (main page or an archive)
if(get_query_var('paged'))
$page_number = $sep . __('Page ', 'reuben') . get_query_var('paged');
// get the page number (post with multipages)
elseif(get_query_var('page'))
$page_number = $sep . __('Page ', 'reuben') . get_query_var('page');
else
$page_number = '';
// Comment the 4 lines of code below and see how odd the title format becomes
if($sep_location == 'right' && !(is_home() || is_front_page())) {
$custom = $custom . $sep;
$title = substr($title, 0, -2);
}
// return full title
return get_bloginfo('name') . $custom . $title . $page_number;
} // end of function reuben_filter_wp_title
/* add function 'reuben_filter_wp_title()' to the
* wp_title filter, with priority 10 and 3 args
*/
add_filter('wp_title', 'reuben_filter_wp_title', 10, 3);
?>