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