Skip to content

Instantly share code, notes, and snippets.

@JayWood
JayWood / fix_msword.php
Last active August 29, 2015 14:25
Fixes MS Word data
/**
* fixMSWord
*
* Replace ascii chars with utf8. Note there are ascii characters that don't
* correctly map and will be replaced by spaces.
*
* Updated 7-15-2015 by Jay Wood to encode lower end items into HTML entity counterparts.
*
* @author Robin Cafolla,Jay Wood
* @date 2013-03-22
# Apache .htaccess
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1
# Nginx
location ~ ^/wp-content/uploads/(.*) {
rewrite ^/wp-content/uploads/(.*)$ http://livewebsite.com/wp-content/uploads/$1 redirect;
}
add_action( 'wp_before_admin_bar_render', 'jb_admin_bar_items' );
/**
* Customize Admin Bar Items (add Plugins)
*/
function jb_admin_bar_items() {
global $wp_admin_bar;
if ( current_user_can( 'activate_plugins' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'plugins', 'title' => __('Plugins'), 'href' => admin_url('plugins.php') ) );
}