-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfunctions-plugin.php
78 lines (60 loc) · 2.51 KB
/
functions-plugin.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
<?php
function ewpac_edit_footer()
{
add_filter( 'admin_footer_text', 'ewpac_edit_text', 11 );
}
function ewpac_edit_text($content) {
return esc_attr( get_option('footer-message') );
}
function ewpac_remove_dashboard_widgets() {
if(get_option('hide-widgets-front')){
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
remove_meta_box( 'rg_forms_dashboard', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
}
}
function ewpac_remove_wp_logo( $wp_admin_bar ) {
if(get_option('hide-wp-logo-left')){
$wp_admin_bar->remove_node('wp-logo');
}
}
if(get_option('hide_welcome_widget_home')){
remove_action( 'welcome_panel', 'wp_welcome_panel' );
}
function ewpac_hide_update(){
if(get_option('hide_update_box')){
echo "<style>.update-nag { display:none; } #footer-upgrade { display:none; } </style>";
}
}
function ewpac_hide_update_page_f(){
if(get_option('hide_update_page')){
remove_submenu_page('index.php','update-core.php');
}
}
function ewpac_dashboard_widgets() {
if(get_option('active_custom_box_dashboard')){
global $wp_meta_boxes;
if(get_option('input_name_custom_field_box')) { $inputName = get_option('input_name_custom_field_box'); }
if(isset($inputName)){
wp_add_dashboard_widget('custom_help_widget', $inputName, 'ewpac_custom_dashboard_settings');
}else{
wp_add_dashboard_widget('custom_help_widget', ' ', 'ewpac_custom_dashboard_settings');
}
}
}
function ewpac_custom_dashboard_settings(){
echo '<p><img src="' . esc_attr( get_option('logo_custom_widget') ) . '" /></p><p style="font-size: 13px;padding-bottom: 5px;line-height: 22px;">' . esc_attr( get_option('message_custom_widget') ) . '</p>';
}
/////// HOOKS ///////
add_action( 'admin_init', 'ewpac_edit_footer' );
add_action( 'wp_dashboard_setup', 'ewpac_remove_dashboard_widgets' );
add_action( 'admin_bar_menu', 'ewpac_remove_wp_logo', 999);
add_action( 'admin_head', 'ewpac_hide_update' );
add_action( 'admin_menu', 'ewpac_hide_update_page_f' );
add_action('wp_dashboard_setup', 'ewpac_dashboard_widgets');