|
@@ -21,20 +21,20 @@ discard block |
|
|
block discarded – undo |
|
21
|
21
|
*/ |
|
22
|
22
|
function disable_default_dashboard_widgets() { |
|
23
|
23
|
global $wp_meta_boxes; |
|
24
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity'] ); // Activity Widget. |
|
25
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] ); // Comments Widget. |
|
26
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); // Incoming Links Widget. |
|
27
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] ); // Plugins Widget. |
|
|
24
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); // Activity Widget. |
|
|
25
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); // Comments Widget. |
|
|
26
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); // Incoming Links Widget. |
|
|
27
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); // Plugins Widget. |
|
28
|
28
|
|
|
29
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] ); // Quick Press Widget. |
|
30
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts'] ); // Recent Drafts Widget. |
|
31
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // WordPress related feed. |
|
32
|
|
- unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] ); // |
|
|
29
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); // Quick Press Widget. |
|
|
30
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); // Recent Drafts Widget. |
|
|
31
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // WordPress related feed. |
|
|
32
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // |
|
33
|
33
|
|
|
34
|
34
|
// remove plugin dashboard boxes |
|
35
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['yoast_db_widget'] ); // Yoast's SEO Plugin Widget. |
|
36
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard'] ); // Gravity Forms Plugin Widget. |
|
37
|
|
- unset( $wp_meta_boxes['dashboard']['normal']['core']['bbp-dashboard-right-now'] ); // bbPress Plugin Widget. |
|
|
35
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['yoast_db_widget']); // Yoast's SEO Plugin Widget. |
|
|
36
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard']); // Gravity Forms Plugin Widget. |
|
|
37
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['bbp-dashboard-right-now']); // bbPress Plugin Widget. |
|
38
|
38
|
|
|
39
|
39
|
/* |
|
40
|
40
|
Have more plugin widgets you'd like to remove? |
|
@@ -66,50 +66,50 @@ discard block |
|
|
block discarded – undo |
|
66
|
66
|
); |
|
67
|
67
|
|
|
68
|
68
|
// Loop through Feeds |
|
69
|
|
- foreach ( $my_feeds as $feed) : |
|
|
69
|
+ foreach ($my_feeds as $feed) : |
|
70
|
70
|
|
|
71
|
71
|
// Get a SimplePie feed object from the specified feed source. |
|
72
|
|
- $rss = fetch_feed( $feed ); |
|
73
|
|
- if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly |
|
|
72
|
+ $rss = fetch_feed($feed); |
|
|
73
|
+ if ( ! is_wp_error($rss)) : // Checks that the object is created correctly |
|
74
|
74
|
// Figure out how many total items there are, and choose a limit |
|
75
|
|
- $maxitems = $rss->get_item_quantity( 3 ); |
|
|
75
|
+ $maxitems = $rss->get_item_quantity(3); |
|
76
|
76
|
|
|
77
|
77
|
// Build an array of all the items, starting with element 0 (first element). |
|
78
|
|
- $rss_items = $rss->get_items( 0, $maxitems ); |
|
|
78
|
+ $rss_items = $rss->get_items(0, $maxitems); |
|
79
|
79
|
|
|
80
|
80
|
// Get RSS title |
|
81
|
|
- $rss_title = '<a href="'.$rss->get_permalink().'" target="_blank">'.strtoupper( $rss->get_title() ).'</a>'; |
|
|
81
|
+ $rss_title = '<a href="' . $rss->get_permalink() . '" target="_blank">' . strtoupper($rss->get_title()) . '</a>'; |
|
82
|
82
|
endif; |
|
83
|
83
|
|
|
84
|
84
|
// Display the container |
|
85
|
85
|
echo '<div class="rss-widget">'; |
|
86
|
|
- echo '<strong>'.$rss_title.'</strong>'; |
|
|
86
|
+ echo '<strong>' . $rss_title . '</strong>'; |
|
87
|
87
|
echo '<hr style="border: 0; background-color: #DFDFDF; height: 1px;">'; |
|
88
|
88
|
|
|
89
|
89
|
// Starts items listing within <ul> tag |
|
90
|
90
|
echo '<ul>'; |
|
91
|
91
|
|
|
92
|
92
|
// Check items |
|
93
|
|
- if ( $maxitems == 0 ) { |
|
94
|
|
- echo '<li>'.__( 'No item', 'rc_mdm').'.</li>'; |
|
|
93
|
+ if ($maxitems == 0) { |
|
|
94
|
+ echo '<li>' . __('No item', 'rc_mdm') . '.</li>'; |
|
95
|
95
|
} { |
|
96
|
96
|
// Loop through each feed item and display each item as a hyperlink. |
|
97
|
|
- foreach ( $rss_items as $item ) : |
|
|
97
|
+ foreach ($rss_items as $item) : |
|
98
|
98
|
// Uncomment line below to display non human date |
|
99
|
99
|
//$item_date = $item->get_date( get_option('date_format').' @ '.get_option('time_format') ); |
|
100
|
100
|
|
|
101
|
101
|
// Get human date (comment if you want to use non human date) |
|
102
|
|
- $item_date = human_time_diff( $item->get_date('U'), current_time('timestamp')).' '.__( 'ago', 'rc_mdm' ); |
|
|
102
|
+ $item_date = human_time_diff($item->get_date('U'), current_time('timestamp')) . ' ' . __('ago', 'rc_mdm'); |
|
103
|
103
|
|
|
104
|
104
|
// Start displaying item content within a <li> tag |
|
105
|
105
|
echo '<li>'; |
|
106
|
106
|
// create item link |
|
107
|
|
- echo '<a href="'.esc_url( $item->get_permalink() ).'" title="'.$item_date.'">'; |
|
|
107
|
+ echo '<a href="' . esc_url($item->get_permalink()) . '" title="' . $item_date . '">'; |
|
108
|
108
|
// Get item title |
|
109
|
|
- echo esc_html( $item->get_title() ); |
|
|
109
|
+ echo esc_html($item->get_title()); |
|
110
|
110
|
echo '</a>'; |
|
111
|
111
|
// Display date |
|
112
|
|
- echo ' <span class="rss-date">'.$item_date.'</span><br />'; |
|
|
112
|
+ echo ' <span class="rss-date">' . $item_date . '</span><br />'; |
|
113
|
113
|
// Get item content |
|
114
|
114
|
$content = $item->get_content(); |
|
115
|
115
|
// Shorten content |
|
@@ -130,16 +130,16 @@ discard block |
|
|
block discarded – undo |
|
130
|
130
|
* Calling all custom dashboard widgets. |
|
131
|
131
|
*/ |
|
132
|
132
|
function strip_custom_dashboard_widgets() { |
|
133
|
|
- wp_add_dashboard_widget( 'strip_rss_dashboard_widget', __( 'SILENT COMICS blog', 'strip' ), 'strip_rss_dashboard_widget' ); |
|
|
133
|
+ wp_add_dashboard_widget('strip_rss_dashboard_widget', __('SILENT COMICS blog', 'strip'), 'strip_rss_dashboard_widget'); |
|
134
|
134
|
/** |
|
135
|
135
|
* Be sure to drop any other created Dashboard Widgets. |
|
136
|
136
|
* in this function and they will all load. |
|
137
|
137
|
*/ |
|
138
|
138
|
} |
|
139
|
139
|
// removing the dashboard widgets. |
|
140
|
|
-add_action( 'wp_dashboard_setup', 'disable_default_dashboard_widgets' ); |
|
|
140
|
+add_action('wp_dashboard_setup', 'disable_default_dashboard_widgets'); |
|
141
|
141
|
// adding any custom widgets. |
|
142
|
|
-add_action( 'wp_dashboard_setup', 'strip_custom_dashboard_widgets' ); |
|
|
142
|
+add_action('wp_dashboard_setup', 'strip_custom_dashboard_widgets'); |
|
143
|
143
|
|
|
144
|
144
|
|
|
145
|
145
|
/************* CUSTOM LOGIN PAGE *****************/ |
|
@@ -150,10 +150,10 @@ discard block |
|
|
block discarded – undo |
|
150
|
150
|
* See http://codex.wordpress.org/Plugin_API/Action_Reference/login_enqueue_scripts. |
|
151
|
151
|
*/ |
|
152
|
152
|
function strip_login_css() { |
|
153
|
|
- wp_enqueue_style( 'strip_login_css', get_template_directory_uri() . '/assets/css/login.css', false ); |
|
|
153
|
+ wp_enqueue_style('strip_login_css', get_template_directory_uri() . '/assets/css/login.css', false); |
|
154
|
154
|
|
|
155
|
155
|
// Enqueue custom font to the login form. |
|
156
|
|
- wp_enqueue_style( 'strip_inconsolata_css', get_template_directory_uri() . '/assets/fonts/inconsolata.css', array(), null ); |
|
|
156
|
+ wp_enqueue_style('strip_inconsolata_css', get_template_directory_uri() . '/assets/fonts/inconsolata.css', array(), null); |
|
157
|
157
|
} |
|
158
|
158
|
|
|
159
|
159
|
/** |
|
@@ -170,12 +170,12 @@ discard block |
|
|
block discarded – undo |
|
170
|
170
|
* @return blog title. |
|
171
|
171
|
*/ |
|
172
|
172
|
function strip_login_title() { |
|
173
|
|
- return get_option( 'blogname' ); } |
|
|
173
|
+ return get_option('blogname'); } |
|
174
|
174
|
|
|
175
|
175
|
// calling only on the login page. |
|
176
|
|
-add_action( 'login_enqueue_scripts', 'strip_login_css', 10 ); |
|
177
|
|
-add_filter( 'login_headerurl', 'strip_login_url' ); |
|
178
|
|
-add_filter( 'login_headertext', 'strip_login_title' ); |
|
|
176
|
+add_action('login_enqueue_scripts', 'strip_login_css', 10); |
|
|
177
|
+add_filter('login_headerurl', 'strip_login_url'); |
|
|
178
|
+add_filter('login_headertext', 'strip_login_title'); |
|
179
|
179
|
|
|
180
|
180
|
/************* CUSTOMIZE ADMIN *******************/ |
|
181
|
181
|
|
|
@@ -191,10 +191,10 @@ discard block |
|
|
block discarded – undo |
|
191
|
191
|
*/ |
|
192
|
192
|
function strip_custom_admin_footer() { |
|
193
|
193
|
?> |
|
194
|
|
- <span id="footer-thankyou"><a href="<?php echo esc_url( __( 'https://silent-comics.com/', 'strip' ) ); ?>"><?php printf( esc_html__( 'Developed by %s', 'strip' ), 'Silent Comics' ); ?></a> |
|
|
194
|
+ <span id="footer-thankyou"><a href="<?php echo esc_url(__('https://silent-comics.com/', 'strip')); ?>"><?php printf(esc_html__('Developed by %s', 'strip'), 'Silent Comics'); ?></a> |
|
195
|
195
|
<span class="sep"> | </span> |
|
196
|
|
- <a href="<?php echo esc_url( __( 'https://github.com/SilentComics/Strip/', 'strip' ) ); ?>"><?php printf( esc_html__( 'Contribute on %s', 'strip' ), 'GitHub' ); ?></a> |
|
|
196
|
+ <a href="<?php echo esc_url(__('https://github.com/SilentComics/Strip/', 'strip')); ?>"><?php printf(esc_html__('Contribute on %s', 'strip'), 'GitHub'); ?></a> |
|
197
|
197
|
<?php } |
|
198
|
198
|
|
|
199
|
199
|
// adding it to the admin area. |
|
200
|
|
-add_filter( 'admin_footer_text', 'strip_custom_admin_footer' ); |
|
|
200
|
+add_filter('admin_footer_text', 'strip_custom_admin_footer'); |