This file contains hidden or 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 | |
/* ------------------------------------ */ | |
/* Convert absolute URLs in content to site relative ones | |
/* Inspired by http://thisismyurl.com/6166/replace-wordpress-static-urls-dynamic-urls/ | |
/* ------------------------------------ */ | |
add_filter('content_save_pre', function( $content ) { | |
$site_url = get_bloginfo('url'); | |
return str_replace(' href=\"'.$site_url, ' href=\"', str_replace(' src=\"'.$site_url, ' src=\"', $content)); | |
}, 10, 1); |
This file contains hidden or 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 | |
/* ------------------------------------ */ | |
/* Add Custom Post Type to WP-ADMIN Right Now Widget | |
/* ------------------------------------ */ | |
add_action( 'dashboard_glance_items', function() { ?> | |
<style> | |
#dashboard_right_now a.post_type_name-count:before { content: "\f473"; } | |
</style> | |
<?php | |
$args = array( |
This file contains hidden or 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 | |
/* Custom Tax Metabox : remove the current custom taxonomy metabox | |
/* -------------------------------------------------- */ | |
add_action( 'admin_menu', function(){ | |
remove_meta_box('customtaxdiv', 'posttype', 'normal'); | |
}); | |
/* Custom Tax Metabox : add a new & improved custom taxonomy metabox (select-one) | |
/* -------------------------------------------------- */ | |
add_action( 'add_meta_boxes', function() { |
This file contains hidden or 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 | |
/* Featured Image Metabox : change the text in the current metaboxes | |
/* -------------------------------------------------- */ | |
add_filter( 'admin_post_thumbnail_html', function( $content ) { | |
if(get_post_type() == 'post') { | |
$content = str_replace('Uitgelichte afbeelding', 'Nieuws foto', $content); | |
// $content .= '<p>Een extra uitlegtekst.</p>'; | |
} elseif(get_post_type() == 'page') { | |
$content = str_replace('Uitgelichte afbeelding', 'Header foto', $content); |
This file contains hidden or 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 | |
/* rename WP standard 'Berichten' to 'Nieuws' | |
/* ------------------------------------ */ | |
add_action( 'admin_menu', function() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'Nieuws'; | |
$submenu['edit.php'][5][0] = 'Nieuws'; | |
$submenu['edit.php'][10][0] = 'Nieuw nieuws'; | |
$submenu['edit.php'][16][0] = 'Nieuws Tags'; |
This file contains hidden or 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 | |
/* Hide certain admin sections for "simple users" | |
/* -------------------------------------------------- */ | |
add_action('wp_dashboard_setup', function() { | |
if( current_user_can('editor') ) { | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); //Quick Press widget | |
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); //Recent Drafts | |
remove_meta_box('dashboard_primary', 'dashboard', 'side'); //WordPress.com Blog | |
remove_meta_box('dashboard_secondary', 'dashboard', 'side'); //Other WordPress News | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); //Incoming Links |
This file contains hidden or 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 | |
add_filter( 'enter_title_here', function( $title ) { | |
if( get_post_type() == 'page' ) { | |
$title = __('Vul een paginatitel in', 'domain'); | |
} elseif( get_post_type() == 'post' ) { | |
$title = __('Vul een korte en bondige titel in', 'domain'); | |
} | |
return $title; | |
}); |
This file contains hidden or 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 custom_admin_color_scheme() { | |
wp_admin_css_color( | |
'scheme_name', | |
__('Scheme Name', 'domain'), | |
admin_url("/css/colors/scheme_name/colors.css"), | |
array('#07273E', '#14568A', '#07273E', '#07273E'), | |
array('base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff') | |
); | |
This file contains hidden or 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 | |
filter_gettext( function($key, $translation, $domain) { | |
if( $key == $translation ) { } | |
if( $domain =='' ) { $domain = 'domain'; } | |
return __($key, $domain); | |
}); |
This file contains hidden or 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 | |
wp_die('You pasted the code without reading it...'); |
OlderNewer