Skip to content

Instantly share code, notes, and snippets.

@adamdoe
Last active Mar 13, 2021
Embed
What would you like to do?
WordPress - Admin Functions #wordpress
<?php
/******************************************************************
* Admin Footer
******************************************************************/
function change_admin_footer(){
echo '<span id="footer-note">Theme made by <a href="http://www.yourcompany.com/" target="_blank">Your Company</a>.</span>';
}
add_filter('admin_footer_text', 'change_admin_footer');
/******************************************************************
* Update the theme logo in backend.
******************************************************************/
function mic_custom_logo() {
echo '
<style type="text/css">
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
background-image: url(' . get_bloginfo('stylesheet_directory') . '/images/backend-logo.png) !important;
background-position: 0 0;
color:rgba(0, 0, 0, 0);
}
#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
background-position: 0 0;
}
</style>
';
}
//hook into the administrative header output
add_action('wp_before_admin_bar_render', 'mic_custom_logo');
/******************************************************************
* COLOR SCHEMES RECIPE
* Use this to create the scheme you want.
* https://wordpress.org/plugins/admin-color-schemer/
*
* Find the folder where the scheme is saved.
* In theme folder add folder /admin-colors/
* Add colors.css inside folder.
* Rock On.
******************************************************************/
/******************************************************************
* COLOR SCHEMES
******************************************************************/
function my_admin_color_schemes() {
$theme_dir = get_stylesheet_directory_uri();
wp_admin_css_color( 'theme-name', __( 'Theme NAME' ),
$theme_dir . '/admin-colors/theme-name/colors.css', array(
'red', 'red', 'red', 'red'
) );
}
add_action('admin_init', 'my_admin_color_schemes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment