|
|
@@ -1,5 +1,5 @@
|
|
|
<?php
|
|
|
-/*
|
|
|
+/*
|
|
|
This file handles the admin area and functions.
|
|
|
You can use this file to make changes to the
|
|
|
dashboard. Updates to this page are coming soon.
|
|
|
@@ -26,15 +26,15 @@ function disable_default_dashboard_widgets() {
|
|
|
|
|
|
// remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); // Quick Press Widget
|
|
|
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); // Recent Drafts Widget
|
|
|
- remove_meta_box('dashboard_primary', 'dashboard', 'core'); //
|
|
|
+ remove_meta_box('dashboard_primary', 'dashboard', 'core'); //
|
|
|
remove_meta_box('dashboard_secondary', 'dashboard', 'core'); //
|
|
|
-
|
|
|
- // removing plugin dashboard boxes
|
|
|
+
|
|
|
+ // removing plugin dashboard boxes
|
|
|
remove_meta_box('yoast_db_widget', 'dashboard', 'normal'); // Yoast's SEO Plugin Widget
|
|
|
-
|
|
|
- /*
|
|
|
- have more plugin widgets you'd like to remove?
|
|
|
- share them with us so we can get a list of
|
|
|
+
|
|
|
+ /*
|
|
|
+ have more plugin widgets you'd like to remove?
|
|
|
+ share them with us so we can get a list of
|
|
|
the most commonly used. :D
|
|
|
https://github.com/eddiemachado/bones/issues
|
|
|
*/
|
|
|
@@ -42,7 +42,7 @@ function disable_default_dashboard_widgets() {
|
|
|
|
|
|
/*
|
|
|
Now let's talk about adding your own custom Dashboard widget.
|
|
|
-Sometimes you want to show clients feeds relative to their
|
|
|
+Sometimes you want to show clients feeds relative to their
|
|
|
site's content. For example, the NBA.com feed for a sports
|
|
|
site. Here is an example Dashboard Widget that displays recent
|
|
|
entries from an RSS Feed.
|
|
|
@@ -51,7 +51,7 @@ For more information on creating Dashboard Widgets, view:
|
|
|
http://digwp.com/2010/10/customize-wordpress-dashboard/
|
|
|
*/
|
|
|
|
|
|
-// RSS Dashboard Widget
|
|
|
+// RSS Dashboard Widget
|
|
|
function bones_rss_dashboard_widget() {
|
|
|
if(function_exists('fetch_feed')) {
|
|
|
include_once(ABSPATH . WPINC . '/feed.php'); // include the required file
|
|
|
@@ -59,7 +59,7 @@ function bones_rss_dashboard_widget() {
|
|
|
$limit = $feed->get_item_quantity(7); // specify number of items
|
|
|
$items = $feed->get_items(0, $limit); // create an array of items
|
|
|
}
|
|
|
- if ($limit == 0) echo '<div>The RSS Feed is either empty or unavailable.</div>'; // fallback message
|
|
|
+ if ($limit == 0) echo '<div>The RSS Feed is either empty or unavailable.</div>'; // fallback message
|
|
|
else foreach ($items as $item) : ?>
|
|
|
|
|
|
<h4 style="margin-bottom: 0;">
|
|
|
@@ -68,16 +68,16 @@ function bones_rss_dashboard_widget() {
|
|
|
</a>
|
|
|
</h4>
|
|
|
<p style="margin-top: 0.5em;">
|
|
|
- <?php echo substr($item->get_description(), 0, 200); ?>
|
|
|
+ <?php echo substr($item->get_description(), 0, 200); ?>
|
|
|
</p>
|
|
|
- <?php endforeach;
|
|
|
+ <?php endforeach;
|
|
|
}
|
|
|
|
|
|
// calling all custom dashboard widgets
|
|
|
function bones_custom_dashboard_widgets() {
|
|
|
wp_add_dashboard_widget('bones_rss_dashboard_widget', 'Recently on Themble (Customize on admin.php)', 'bones_rss_dashboard_widget');
|
|
|
/*
|
|
|
- Be sure to drop any other created Dashboard Widgets
|
|
|
+ Be sure to drop any other created Dashboard Widgets
|
|
|
in this function and they will all load.
|
|
|
*/
|
|
|
}
|
|
|
@@ -91,17 +91,17 @@ add_action('wp_dashboard_setup', 'bones_custom_dashboard_widgets');
|
|
|
|
|
|
/************* CUSTOM LOGIN PAGE *****************/
|
|
|
|
|
|
-// calling your own login css so you can style it
|
|
|
+// calling your own login css so you can style it
|
|
|
function bones_login_css() {
|
|
|
/* i couldn't get wp_enqueue_style to work :( */
|
|
|
echo '<link rel="stylesheet" href="' . get_stylesheet_directory_uri() . '/library/css/login.css">';
|
|
|
}
|
|
|
|
|
|
-// changing the logo link from wordpress.org to your site
|
|
|
-function bones_login_url() { echo home_url(); }
|
|
|
+// changing the logo link from wordpress.org to your site
|
|
|
+function bones_login_url() { return home_url(); }
|
|
|
|
|
|
-// changing the alt text on the logo to show your site name
|
|
|
-function bones_login_title() { echo get_option('blogname'); }
|
|
|
+// changing the alt text on the logo to show your site name
|
|
|
+function bones_login_title() { return get_option('blogname'); }
|
|
|
|
|
|
// calling it only on the login page
|
|
|
add_action('login_head', 'bones_login_css');
|
|
|
@@ -114,7 +114,7 @@ add_filter('login_headertitle', 'bones_login_title');
|
|
|
/*
|
|
|
I don't really reccomend editing the admin too much
|
|
|
as things may get funky if Wordpress updates. Here
|
|
|
-are a few funtions which you can choose to use if
|
|
|
+are a few funtions which you can choose to use if
|
|
|
you like.
|
|
|
*/
|
|
|
|