|
@@ -26,20 +26,20 @@ discard block |
|
|
block discarded – undo |
|
26
|
26
|
*/ |
|
27
|
27
|
function disable_default_dashboard_widgets() { |
|
28
|
28
|
global $wp_meta_boxes; |
|
29
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity'] ); // Activity Widget. |
|
30
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] ); // Comments Widget. |
|
31
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); // Incoming Links Widget. |
|
32
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] ); // Plugins Widget. |
|
|
29
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); // Activity Widget. |
|
|
30
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); // Comments Widget. |
|
|
31
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); // Incoming Links Widget. |
|
|
32
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); // Plugins Widget. |
|
33
|
33
|
|
|
34
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] ); // Quick Press Widget. |
|
35
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts'] ); // Recent Drafts Widget. |
|
36
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // WordPress related feed. |
|
37
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] ); // |
|
|
34
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); // Quick Press Widget. |
|
|
35
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); // Recent Drafts Widget. |
|
|
36
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // WordPress related feed. |
|
|
37
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // |
|
38
|
38
|
|
|
39
|
39
|
// remove plugin dashboard boxes |
|
40
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['yoast_db_widget'] ); // Yoast's SEO Plugin Widget. |
|
41
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard'] ); // Gravity Forms Plugin Widget. |
|
42
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['bbp-dashboard-right-now'] ); // bbPress Plugin Widget. |
|
|
40
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['yoast_db_widget']); // Yoast's SEO Plugin Widget. |
|
|
41
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard']); // Gravity Forms Plugin Widget. |
|
|
42
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['bbp-dashboard-right-now']); // bbPress Plugin Widget. |
|
43
|
43
|
|
|
44
|
44
|
/* |
|
45
|
45
|
Have more plugin widgets you'd like to remove? |
|
@@ -62,29 +62,29 @@ discard block |
|
|
block discarded – undo |
|
62
|
62
|
* RSS Dasboars Widget |
|
63
|
63
|
*/ |
|
64
|
64
|
function strip_rss_dashboard_widget() { |
|
65
|
|
- if ( function_exists( 'fetch_feed' ) ) { |
|
66
|
|
- $feed = fetch_feed( 'https://silent-comics.tumblr.com/rss/' );// specify the source feed. |
|
67
|
|
- if ( is_wp_error( $feed ) ) { |
|
|
65
|
+ if (function_exists('fetch_feed')) { |
|
|
66
|
+ $feed = fetch_feed('https://silent-comics.tumblr.com/rss/'); // specify the source feed. |
|
|
67
|
+ if (is_wp_error($feed)) { |
|
68
|
68
|
$limit = 0; |
|
69
|
69
|
$items = 0; |
|
70
|
70
|
return; |
|
71
|
71
|
} |
|
72
|
|
- $limit = $feed->get_item_quantity( 7 ); // specify number of items. |
|
73
|
|
- $items = $feed->get_items( 0, $limit ); // create an array of items. |
|
|
72
|
+ $limit = $feed->get_item_quantity(7); // specify number of items. |
|
|
73
|
+ $items = $feed->get_items(0, $limit); // create an array of items. |
|
74
|
74
|
} |
|
75
|
|
- if ( 0 ) { echo '<div>The RSS Feed is either empty or unavailable.</div>'; // fallback message. |
|
|
75
|
+ if (0) { echo '<div>The RSS Feed is either empty or unavailable.</div>'; // fallback message. |
|
76
|
76
|
return; |
|
77
|
77
|
} |
|
78
|
|
- foreach ( $items as $item ) { ?> |
|
|
78
|
+ foreach ($items as $item) { ?> |
|
79
|
79
|
|
|
80
|
80
|
<h4 style="margin-bottom: 0;"> |
|
81
|
|
- <a href="<?php echo $item->get_permalink(); ?>" title="<?php echo mysql2date( __( 'j F Y @ g:i a', 'strip' ), $item->get_date( 'Y-m-d H:i:s' ) ); ?>" target="_blank"> |
|
|
81
|
+ <a href="<?php echo $item->get_permalink(); ?>" title="<?php echo mysql2date(__('j F Y @ g:i a', 'strip'), $item->get_date('Y-m-d H:i:s')); ?>" target="_blank"> |
|
82
|
82
|
<?php echo $item->get_title(); ?> |
|
83
|
83
|
</a> |
|
84
|
84
|
</h4> |
|
85
|
85
|
<p style="margin-top: 0.5em; |
|
86
|
86
|
.inside { max-width: 240px;}"> |
|
87
|
|
- <?php echo substr( $item->get_description(), 0, 600 ); ?> |
|
|
87
|
+ <?php echo substr($item->get_description(), 0, 600); ?> |
|
88
|
88
|
</p> |
|
89
|
89
|
<?php |
|
90
|
90
|
} |
|
@@ -94,16 +94,16 @@ discard block |
|
|
block discarded – undo |
|
94
|
94
|
* Calling all custom dashboard widgets. |
|
95
|
95
|
*/ |
|
96
|
96
|
function strip_custom_dashboard_widgets() { |
|
97
|
|
- wp_add_dashboard_widget( 'strip_rss_dashboard_widget', __( 'SILENT COMICS on tumblr', 'strip' ), 'strip_rss_dashboard_widget' ); |
|
|
97
|
+ wp_add_dashboard_widget('strip_rss_dashboard_widget', __('SILENT COMICS on tumblr', 'strip'), 'strip_rss_dashboard_widget'); |
|
98
|
98
|
/** |
|
99
|
99
|
* Be sure to drop any other created Dashboard Widgets. |
|
100
|
100
|
* in this function and they will all load. |
|
101
|
101
|
*/ |
|
102
|
102
|
} |
|
103
|
103
|
// removing the dashboard widgets. |
|
104
|
|
-add_action( 'wp_dashboard_setup', 'disable_default_dashboard_widgets' ); |
|
|
104
|
+add_action('wp_dashboard_setup', 'disable_default_dashboard_widgets'); |
|
105
|
105
|
// adding any custom widgets. |
|
106
|
|
-add_action( 'wp_dashboard_setup', 'strip_custom_dashboard_widgets' ); |
|
|
106
|
+add_action('wp_dashboard_setup', 'strip_custom_dashboard_widgets'); |
|
107
|
107
|
|
|
108
|
108
|
|
|
109
|
109
|
/************* CUSTOM LOGIN PAGE *****************/ |
|
@@ -114,10 +114,10 @@ discard block |
|
|
block discarded – undo |
|
114
|
114
|
* See http://codex.wordpress.org/Plugin_API/Action_Reference/login_enqueue_scripts. |
|
115
|
115
|
*/ |
|
116
|
116
|
function strip_login_css() { |
|
117
|
|
- wp_enqueue_style( 'strip_login_css', get_template_directory_uri() . '/assets/css/login.css', false ); |
|
|
117
|
+ wp_enqueue_style('strip_login_css', get_template_directory_uri() . '/assets/css/login.css', false); |
|
118
|
118
|
|
|
119
|
119
|
// Enqueue custom font to the login form. |
|
120
|
|
- wp_enqueue_style( 'inconsolata', get_template_directory_uri() . '/assets/fonts/inconsolata.css', array(), null ); |
|
|
120
|
+ wp_enqueue_style('inconsolata', get_template_directory_uri() . '/assets/fonts/inconsolata.css', array(), null); |
|
121
|
121
|
} |
|
122
|
122
|
|
|
123
|
123
|
/** |
|
@@ -130,14 +130,14 @@ discard block |
|
|
block discarded – undo |
|
130
|
130
|
* Changing the alt text on the logo to show your site name. |
|
131
|
131
|
*/ |
|
132
|
132
|
function strip_login_title() { |
|
133
|
|
- return get_option( 'blogname' ); } |
|
|
133
|
+ return get_option('blogname'); } |
|
134
|
134
|
|
|
135
|
135
|
// calling it only on the login page. |
|
136
|
|
-add_action( 'login_enqueue_scripts', 'strip_login_css', 10 ); |
|
|
136
|
+add_action('login_enqueue_scripts', 'strip_login_css', 10); |
|
137
|
137
|
// Add custom font to the login form. |
|
138
|
|
-add_action( 'login_enqueue_scripts', 'inconsolata.css', 10 ); |
|
139
|
|
-add_filter( 'login_headerurl', 'strip_login_url' ); |
|
140
|
|
-add_filter( 'login_headertitle', 'strip_login_title' ); |
|
|
138
|
+add_action('login_enqueue_scripts', 'inconsolata.css', 10); |
|
|
139
|
+add_filter('login_headerurl', 'strip_login_url'); |
|
|
140
|
+add_filter('login_headertitle', 'strip_login_title'); |
|
141
|
141
|
|
|
142
|
142
|
|
|
143
|
143
|
/************* CUSTOMIZE ADMIN *******************/ |
|
@@ -154,10 +154,10 @@ discard block |
|
|
block discarded – undo |
|
154
|
154
|
*/ |
|
155
|
155
|
function strip_custom_admin_footer() { |
|
156
|
156
|
?> |
|
157
|
|
- <span id="footer-thankyou"><a href="<?php echo esc_url( __( 'http://silent-comics.com/', 'strip' ) ); ?>"><?php printf( esc_html__( 'Developed by %s', 'strip' ), 'Silent Comics' ); ?></a> |
|
|
157
|
+ <span id="footer-thankyou"><a href="<?php echo esc_url(__('http://silent-comics.com/', 'strip')); ?>"><?php printf(esc_html__('Developed by %s', 'strip'), 'Silent Comics'); ?></a> |
|
158
|
158
|
<span class="sep"> | </span> |
|
159
|
|
- <a href="<?php echo esc_url( __( 'https://github.com/SilentComics/Strip/', 'strip' ) ); ?>"><?php printf( esc_html__( 'Contribute on %s', 'strip' ), 'GitHub' ); ?></a> |
|
|
159
|
+ <a href="<?php echo esc_url(__('https://github.com/SilentComics/Strip/', 'strip')); ?>"><?php printf(esc_html__('Contribute on %s', 'strip'), 'GitHub'); ?></a> |
|
160
|
160
|
<?php } |
|
161
|
161
|
|
|
162
|
162
|
// adding it to the admin area. |
|
163
|
|
-add_filter( 'admin_footer_text', 'strip_custom_admin_footer' ); |
|
|
163
|
+add_filter('admin_footer_text', 'strip_custom_admin_footer'); |