Skip to content

Instantly share code, notes, and snippets.

@graphikuz
graphikuz / gist:04b1a387caaf10c79a47
Created August 11, 2014 10:32
Wordpress: Disable Standart Widgets
<?php
/**
* Disable Standart Widgets
*/
function unregister_default_wp_widgets() {
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Search');
unregister_widget('WP_Widget_Recent_Comments');
}
add_action('widgets_init', 'unregister_default_wp_widgets', 1);
@graphikuz
graphikuz / gist:b3377d0fba326d08a2f8
Created August 11, 2014 10:31
Wordpress: Add/Remove Links in Admin Favorites Menu
<?php
/**
* Add/Remove Links in Admin Favorites Menu
*/
function custom_favorite_menu($actions) {
# Removing #
unset($actions['edit-comments.php']);
unset($actions['media-new.php']);
# Adding #
$actions['admin.php?your-plugin'] = array('Your Plugin', 'manage_options');
@graphikuz
graphikuz / gist:fd26206954254082ad36
Created August 11, 2014 10:30
Wordpress: Remove Posts Columns
<?php
/**
* Remove Posts Columns
*/
function remove_post_columns($defaults) {
unset($defaults['comments']);
return $defaults;
}
add_filter('manage_posts_columns', 'remove_post_columns');
?>
@graphikuz
graphikuz / gist:dfe5ed10eb891d348917
Created August 11, 2014 10:29
Wordpress: Remove Pages Columns
<?php
/**
* Remove Pages Columns
*/
function remove_pages_columns($defaults) {
unset($defaults['comments']);
return $defaults;
}
add_filter('manage_pages_columns', 'remove_pages_columns');
?>
@graphikuz
graphikuz / gist:d8657da6c1efd19ac66e
Created August 11, 2014 10:28
Wordpress: Custom Login Logo
<?php
/**
* Custom Login Logo
*/
function custom_login_logo() {
echo '&lt;style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; }
&lt;/style>';
}
add_action('login_head', 'custom_login_logo');
@graphikuz
graphikuz / gist:19605286d8e6e67a5857
Created August 11, 2014 10:20
Wordpress: Change/Remove footer text in admin
<?php
/**
* Change/Remove footer text in admin
*/
function remove_footer_admin () {
echo 'My footer text. Thank you &lt;a href="http://wordpress.org">Wordpress&lt;/a> for giving me this filter.';
//echo "";
}
add_filter('admin_footer_text', 'remove_footer_admin');
?>
@graphikuz
graphikuz / gist:27af8d26ce43c9f3aab3
Created August 11, 2014 10:17
Wordpress: Security: Remove wlw manifest link from head
<?php
/**
* Security: Remove wlw manifest link from head
*/
remove_action('wp_head', 'wlwmanifest_link');
?>
@graphikuz
graphikuz / gist:a84d2e9b689aad54d1ba
Created August 11, 2014 10:17
Wordpresss: Security: Remove WP rsd link from head
<?php
/**
* Security: Remove WP rsd link from head
*/
remove_action('wp_head', 'rsd_link');
?>
@graphikuz
graphikuz / gist:56668a3b0f32d7684903
Created August 11, 2014 10:16
Wordpress: Security: Remove WP META generator from HEAD
<?php
/**
* Security: Remove WP meta generator from head
*/
remove_action('wp_head', 'wp_generator');
?>
@graphikuz
graphikuz / gist:b9a89e12a46c5d06c82c
Created August 11, 2014 10:15
Wordpress: Disable WP core update
<?php
/**
* Disable WP core update
*/
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
?>