Remove Admin Dashboard Widget

function remove_dashboard_widgets(){
global$wp_meta_boxes;
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_plugins’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_recent_comments’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_incoming_links’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_secondary’]);
}

add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’);

//Removing Menu Items

function remove_menu_items() {
global $menu;
$restricted = array(__(‘Links’), __(‘Media’),
(‘Plugins’), (‘Tools’), __(‘Users’));
end ($menu);
while (prev($menu)){
$value = explode(‘ ‘,$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:”” , $restricted)){
unset($menu[key($menu)]);}
}
}

add_action(‘admin_menu’, ‘remove_menu_items’);

Advertisements

Total Search Result Count

<?php
/* Search Count */
$allsearch = &new WP_Query(“s=$s&showposts=-1″);
$key = wp_specialchars($s, 1);
$count = $allsearch->post_count; _e(”);
//_e(‘<span class=”search-terms”>’);
//echo $key; _e(‘</span>’);
//_e(‘ &mdash; ‘);
//echo $count . ‘ ‘;
//_e(‘articles’);
wp_reset_query();
?>

 

<h6>About </span> <span><?php echo $count; ?> results</span>  ( 0.<span id=”speed”></span> seconds )</h6>