How To Remove Existing Information From WordPress
The following snippet will let you remove existing information from WordPress.
1 2 3 4 5 6 7 8 9 10 |
function add_myExtra_ContactMethod( $contactmethods ) { // Add Twitter $contactmethods['twitter'] = 'Twitter'; // Add Facebook $contactmethods['facebook'] = 'Facebook'; //Remove Jabber / Google Talk unset($contactmethods['jabber']); return $contactmethods; } add_filter('user_contactmethods','add_myExtra_ContactMethod',10,1); |
Snippet Source/Credit: readers-cafe.net
How To Remove News Feed In WordPress Dashboard
The following snippet will let you remove news feed from your WordPress dashboard.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
add_action('wp_dashboard_setup', 'my_dashboard_widgets'); function my_dashboard_widgets() { global $wp_meta_boxes; // remove unnecessary widgets // var_dump( $wp_meta_boxes['dashboard'] ); // use to get all the widget IDs unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'], $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'], $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // add a custom dashboard widget wp_add_dashboard_widget( 'dashboard_custom_feed', 'News from 10up', 'dashboard_custom_feed_output' ); //add new RSS feed output } function dashboard_custom_feed_output() { echo '<div class="rss-widget">'; wp_widget_rss_output(array( 'url' => 'http://www.get10up.com/feed', 'title' => 'What\'s up at 10up', 'items' => 2, 'show_summary' => 1, 'show_author' => 0, 'show_date' => 1, )); echo "</div>"; } |
Snippet Source/Credit: Smashing Magazine
How To Remove WordPress Admin Menus
The following snippet below will let you remove WordPress admin menus.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function remove_menu_items() { global $menu; $restricted = array( __('Links'), __('Comments'), __('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'); |
Snippet Source/Credit: Snipplr
How To Replace The WordPress Generator
The following snippet will let you replace the WordPress generator.
1 2 3 4 5 6 |
// Remove the WordPress Generator function remove_generators() { return ''; } add_filter( 'the_generator', 'remove_generators' ); // Replace the WordPress Generator function change_generators() { return '<meta name="generator" content="WordPress" />'; } add_filter( 'the_generator', 'change_generators' ); |
Snippet Source/Credit: DevZone.fr
How To Reset A Query In WordPress
The following snippet will let you reset a query in WordPress.
1 2 3 4 |
// esempio in una ipotetica index.php // a fine pagina, dopo aver eseguito una o più // query_posts() personali <?php wp_reset_query(); get_sidebar(); get_footer(); ?> |
Snippet Source/Credit: Undolog.com