123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?php
- /***********************************************************
- ###################### Child Theme #########################
- ************************************************************/
- add_action( 'wp_enqueue_scripts', 'twenty_five_enqueue_styles' );
- function twenty_five_enqueue_styles() {
- wp_enqueue_style(
- '2025-style',
- get_parent_theme_file_uri( 'style.css' )
- );
- }
- /***********************************************************
- ###################### Admin Clean #########################
- ************************************************************/
- add_filter('gettext', 'srh25_change_howdy', 10, 3);
- function srh25_change_howdy($translated, $text, $domain) {
- if (false !== strpos($translated, 'Howdy,'))
- return str_replace('Howdy,', '', $translated);
- return $translated;
- }
- add_filter( 'gettext', 'srh25_change_howdy_text_email', 10, 2 );
- function srh25_change_howdy_text_email( $translation, $original ) {
- if( 'Howdy, %1$s' == $original )
- $translation = '%1$s';
- return $translation;
- }
- add_filter( 'show_admin_bar', '__return_false' );
- add_action( 'admin_bar_menu', 'srh25_admin_bar', 999 );
- function srh25_admin_bar( $wp_admin_bar ) {
- //$wp_admin_bar->remove_menu('my-account');
- //$wp_admin_bar->remove_menu( 'edit' );
- //$wp_admin_bar->remove_menu('site-name');
- $wp_admin_bar->remove_node('wp-logo');
- $wp_admin_bar->remove_node('themes');
- $wp_admin_bar->remove_node('widgets');
- $wp_admin_bar->remove_node('menus');
- $wp_admin_bar->remove_node('new-media');
- $wp_admin_bar->remove_menu('edit-profile');
- $wp_admin_bar->remove_menu('comments');
- $wp_admin_bar->remove_menu('about');
- $wp_admin_bar->remove_menu('wporg');
- $wp_admin_bar->remove_menu('documentation');
- $wp_admin_bar->remove_menu('support-forums');
- $wp_admin_bar->remove_menu('feedback');
- $wp_admin_bar->remove_menu('customize');
- $wp_admin_bar->remove_menu('view-site');
- $wp_admin_bar->remove_menu('updates');
- $wp_admin_bar->remove_menu('comments');
- $wp_admin_bar->remove_menu('new-content');
- $wp_admin_bar->remove_menu('view');
- }
- add_action( 'admin_init', 'srh25_remove_dashboard_meta' );
- function srh25_remove_dashboard_meta() {
- remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
- remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
- remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );
- remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
- remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
- remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
- }
- add_action( 'admin_head-profile.php', 'srh25_remove_admin_color' );
- function srh25_remove_admin_color() {
- remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
- }
- add_filter('admin_footer_text', 'srh25_remove_admin_footer_text', 1000);
- function srh25_remove_admin_footer_text(){return '';}
- add_filter('update_footer', 'srh25_remove_admin_footer_upgrade', 1000);
- function srh25_remove_admin_footer_upgrade(){return '';}
- /***********************************************************
- ###################### Log In/Out ##########################
- ************************************************************/
- add_filter( 'login_headerurl', 'srh25_login_logo_url' );
- function srh25_login_logo_url() {
- return home_url();
- }
- add_filter( 'login_headertext', 'srh25_login_url_title' );
- function srh25_login_url_title() {
- return 'SRH Physicians';
- }
- add_action( 'login_enqueue_scripts', 'srh25_login_logo' );
- function srh25_login_logo() { ?>
- <style type="text/css">
- .login h1 a {
- background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/img/disc.png) !important;
- padding-bottom: 30px;
- }
- .wp-core-ui .button-primary {
- background: #4FB54F;
- border-color: #027643;
- }
- .login .message {
- border-left: 4px solid #027643;
- }
- .login form .forgetmenot label {
- display:none;
- }
- .login #backtoblog a {
- display:none;
- }
- </style>
- <?php }
- /***********************************************************
- ####################### Allow SVG ##########################
- ************************************************************/
- add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {
- global $wp_version;
- if ( $wp_version !== '4.7.1' ) {
- return $data;
- }
- $filetype = wp_check_filetype( $filename, $mimes );
- return [
- 'ext' => $filetype['ext'],
- 'type' => $filetype['type'],
- 'proper_filename' => $data['proper_filename']
- ];
- }, 10, 4 );
- add_action( 'admin_head', 'fix_svg' );
- function cc_mime_types( $mimes ){
- $mimes['svg'] = 'image/svg+xml';
- return $mimes;
- }
- add_filter( 'upload_mimes', 'cc_mime_types' );
- function fix_svg() {
- echo '<style type="text/css">
- .attachment-266x266, .thumbnail img {
- width: 100% !important;
- height: auto !important;
- }
- </style>';
- }
-
- /***********************************************************
- #################### Edit Page Link ########################
- ************************************************************/
- function add_edit_link() {
- ob_start();
- edit_post_link( __( 'Edit Page', 'textdomain' ), '<div class="wp-block-button">', '</div>', null, 'wp-block-button__link has-accent-2-background-color has-background wp-element-button' );
- return ob_get_clean();
- }
- add_action( 'init', 'add_edit_link_shortcode' );
- function add_edit_link_shortcode() {
- add_shortcode( 'edit-link', 'add_edit_link' );
- }
|