This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove_dashboard_widgets - Remove the dashboard widgets for all users | |
//=================================================================================================== | |
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']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* create a function to get the values from this page load */ | |
function wpct_track_content() { | |
/* call the global post variable to gain access to post data */ | |
global $post; | |
/* setup an array to store all our values */ | |
$wpct_post_values = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Plugin Name: User Switching in Admin Bar | |
Plugin URI: http://markwilkinson.me | |
Description: Build upon the User Switching plugin (http://wordpress.org/extend/plugins/user-switching/) by John Blackbourn and adds a dropdown list of users in the WordPress admin bar with a link to switch to that user. | |
Author: Mark Wilkinson | |
Author URI: http://markwilkinson.me | |
Version: 1.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Twitter, Facebook and Google+ field to contact methods, remove AIM, YIM and Jabber | |
add_filter( 'user_contactmethods', 'ts_add_contact_fields' ); | |
function ts_add_contact_fields( $contactmethods ) { | |
$contactmethods['linkedin'] = 'LinkedIn'; | |
$contactmethods['twitter'] = 'Twitter'; | |
$contactmethods['facebook'] = 'Facebook'; | |
$contactmethods['googleplus'] = 'Google+'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Image Uploading Script | |
* ======================================================================================== | |
Process images and moves them into a uploads folder, each image will have the date of upload | |
appended to its url to prevent replacing. | |
- Trevor 06/29/13 | |
*/ | |
// only allow the following formats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($_SESSION as $key => $value) | |
{ | |
unset($_SESSION[$key]); | |
} | |
// If it's desired to kill the session, also delete the session cookie. | |
// Note: This will destroy the session, and not just the session data! | |
if (ini_get("session.use_cookies")) | |
{ | |
$params = session_get_cookie_params(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !/maintenance/$ | |
RewriteCond %{REMOTE_ADDR} !^111.111.111.111 | |
RewriteRule $ /maintenance/index.html [R=302,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_function(){ | |
$start_time = microtime()*1000; | |
// sleep(1); | |
$end_time = microtime()*1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mytheme_admin_bar_render() { | |
global $wp_admin_bar; | |
// we can remove a menu item, like the Comments link, just by knowing the right $id | |
$wp_admin_bar->remove_menu('comments'); | |
// or we can remove a submenu, like New Link. | |
$wp_admin_bar->remove_menu('new-link', 'new-content'); | |
// we can add a submenu item too | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'new-content', |
OlderNewer