|
@@ -0,0 +1,149 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+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' )
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+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 '';}
|
|
|
+
|
|
|
+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>';
|
|
|
+}
|
|
|
+
|
|
|
+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' );
|
|
|
+}
|