Skip to content

Instantly share code, notes, and snippets.

View jamiebrwr's full-sized avatar

Jamie Brewer jamiebrwr

View GitHub Profile
@jamiebrwr
jamiebrwr / Order Admin Menu
Last active August 29, 2015 14:12
Change the Menu Order
/**
* Changing the Menu Order
*/
function srh_framework_menu_order( $menu_order ) {
return array(
'index.php',
'upload.php',
'edit.php?post_type=page',
'gf_edit_forms',
@jamiebrwr
jamiebrwr / Load Frontend Notices
Created December 31, 2014 23:33
Load Frontend Notices for clients to visualize site layout
/**
* Load Frontend Notices
*/
function post_type_notice($type, $color){
//echo 'post_type' == $type ? '<p style="color:'.$color.';text-align:center;padding-left:2em;"><strong>POST TYPE:</strong> ' . get_post_type() . '</p>' : '';
//echo 'header' == $type ? '<p style="border-top: 3px solid '.$color.';">&nbsp;</p>' : '';
//echo 'section' == $type ? 'style="background: '.$color.';"' : '';
@jamiebrwr
jamiebrwr / Register Admin Color Schemes
Created December 31, 2014 23:28
Customize WordPress Admin Color Scheme
function additional_admin_color_schemes() {
//Get the theme directory
$theme_dir = get_template_directory_uri();
//Ocean
wp_admin_css_color( 'ocean', __( 'Ocean' ),
$theme_dir . '/admin-colors/ocean/colors.min.css',
array( '#aa9d88', '#9ebaa0', '#738e96', '#f2fcff' )
);
}
@jamiebrwr
jamiebrwr / Delete Orphaned Post Meta
Created September 28, 2013 16:39
Here is a simple SQL query to delete orphaned post meta on your database.
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL