windhamdavid 5 months ago
parent
commit
9b60a7c254
2 changed files with 67 additions and 49 deletions
  1. 66 46
      functions.php
  2. 1 3
      style.css

+ 66 - 46
functions.php

@@ -1,20 +1,5 @@
 <?php
 
-function lps24_enqueue_assets() {
-  wp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css');
-}
-add_action( 'wp_enqueue_scripts', 'lps24_enqueue_assets' );
-
-// Disable XML-RPC
-add_filter( 'xmlrpc_enabled', '__return_false' );
-
-// Disable X-Pingback
-add_filter( 'wp_headers', 'lps24_disable_x_pingback' );
-function lps24_disable_x_pingback( $headers ) {
-  unset( $headers['X-Pingback'] );
-return $headers;
-}
-
 /***********************************************************
 ###################### BrowserSync #########################
 ************************************************************/
@@ -41,6 +26,36 @@ add_action('wp_update_nav_menu', 'lps24_browsersync_save', 10, 3);
 add_action('updated_option', 'lps24_browsersync_save', 10, 3);
 
 
+/***********************************************************
+######################## Sucurity ##########################
+************************************************************/
+
+/* disabled xmlrpc and edit .htaccess
+<Files xmlrpc.php>
+order allow,deny
+deny from all
+</Files>
+*/
+add_filter( 'xmlrpc_enabled', '__return_false' );
+
+add_filter( 'wp_headers', 'lps24_disable_x_pingback' );
+function lps24_disable_x_pingback( $headers ) {
+  unset( $headers['X-Pingback'] );
+return $headers;
+}
+
+/* change login url and edit .htaccess
+RewriteBase /
+RewriteRule ^SRH$ wp-login.php
+*/
+//add_filter('site_url', 'lps24_wplogin_filter', 10, 3);
+function lps24_wplogin_filter( $url, $path, $orig_scheme ) {
+  $old = array( "/(wp-login\.php)/");
+  $new = array( "SRH");
+  return preg_replace( $old, $new, $url, 1);
+}
+
+
 /***********************************************************
 ######################### Admin ############################
 ************************************************************/
@@ -117,6 +132,11 @@ function lps24_disable_dashboard_items() {
 	remove_meta_box('dashboard_site_health', 'dashboard', 'normal');
 }
 
+add_action('admin_head', 'lps24_glance_version');
+function lps24_glance_version() {
+  echo '<style>#dashboard_right_now p:last-child {display:none;}</style>';
+}
+
 add_filter('admin_title', 'lps24_admin_title', 10, 2);
 function lps24_admin_title($admin_title, $title) {
   return $title .' - '. get_bloginfo('name');
@@ -151,13 +171,6 @@ function lps24_remove_help_tabs() {
     $screen->remove_help_tabs();
 }
 
-add_filter('site_url', 'lps24_wplogin_filter', 10, 3);
-function lps24_wplogin_filter( $url, $path, $orig_scheme ) {
-  $old = array( "/(wp-login\.php)/");
-  $new = array( "SRH");
-  return preg_replace( $old, $new, $url, 1);
-}
-
 add_filter( 'login_headerurl', 'lps24_login_url' );
 function lps24_login_url() {  return home_url(); }
 
@@ -193,32 +206,10 @@ function lps24_login_logo() {
         display: none !important;
       }
     </style>
-<?php }
-
-
-
-/***********************************************************
-####################### Comments ###########################
-************************************************************/
-
-add_action('admin_menu', function () {
-	remove_menu_page('edit-comments.php');
-});
-
-add_filter('comments_open', '__return_false', 20, 2);
-add_filter('pings_open', '__return_false', 20, 2);
-
-add_action('admin_init','lps24_disable_comments');
-function lps24_disable_comments() {
-	$post_types = get_post_types();
-	foreach ($post_types as $post_type) {
-			if(post_type_supports($post_type,'comments')) {
-					remove_post_type_support($post_type,'comments');
-					remove_post_type_support($post_type,'trackbacks');
-			}
-	}
+  <?php 
 }
 
+
 /***********************************************************
 ###################### Last Login ##########################
 ************************************************************/
@@ -258,10 +249,39 @@ function lps24_sort_last_login_column( $query ) {
 	return $query;
 }
 
+
+/***********************************************************
+####################### Comments ###########################
+************************************************************/
+
+add_action('admin_menu', function () {
+	remove_menu_page('edit-comments.php');
+});
+
+add_filter('comments_open', '__return_false', 20, 2);
+add_filter('pings_open', '__return_false', 20, 2);
+
+add_action('admin_init','lps24_disable_comments');
+function lps24_disable_comments() {
+	$post_types = get_post_types();
+	foreach ($post_types as $post_type) {
+			if(post_type_supports($post_type,'comments')) {
+					remove_post_type_support($post_type,'comments');
+					remove_post_type_support($post_type,'trackbacks');
+			}
+	}
+}
+
+
 /***********************************************************
 ######################## Blocks ############################
 ************************************************************/
 
+function lps24_enqueue_assets() {
+  wp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css');
+}
+add_action( 'wp_enqueue_scripts', 'lps24_enqueue_assets' );
+
 function lps24_restrict_locking_ui( $settings, $context ) {
   $settings[ 'canLockBlocks' ] = current_user_can( 'activate_plugins' );
 return $settings;

+ 1 - 3
style.css

@@ -19,9 +19,7 @@ Thanks:
 .no-padding {
   margin-block-start: 0;
 }
-.cover-heading {
-  padding-right:  200px;
-}
+
 
 /* https://wordpress.org/support/topic/wp-6-2-gutenberg-ul-has-background-sometimes-appears-and-sometimes-doesnt/ */
 /* https://github.com/WordPress/gutenberg/issues/50486 */