Skip to content

Instantly share code, notes, and snippets.

Jamie Brewer jamiebrwr

View GitHub Profile
@jamiebrwr
jamiebrwr / Order Admin Menu
Last active Aug 29, 2015
Change the Menu Order
View Order Admin Menu
/**
* 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 Dec 31, 2014
Load Frontend Notices for clients to visualize site layout
View Load Frontend Notices
/**
* 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 Dec 31, 2014
Customize WordPress Admin Color Scheme
View Register Admin Color Schemes
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 Sep 28, 2013
Here is a simple SQL query to delete orphaned post meta on your database.
View Delete Orphaned Post Meta
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL
You can’t perform that action at this time.