forked from argoproject/Argo
-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1778 from WPBuddy/1777-fix-largo-mailchimp-link
1777 Project Largo Help dashboard widget updates
- Loading branch information
Showing
2 changed files
with
37 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,30 +6,8 @@ | |
* @since 0.1 | ||
*/ | ||
|
||
// cleanup the wordpress dashboard and add a few of our own widgets | ||
function largo_dashboard_widgets_member() { | ||
global $wp_meta_boxes; | ||
|
||
unset( | ||
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'], | ||
$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'], | ||
$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'], | ||
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'], | ||
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'], | ||
$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts'], | ||
$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] | ||
); | ||
|
||
wp_add_dashboard_widget( 'dashboard_quick_links', __( 'Project Largo Help', 'largo' ), 'largo_dashboard_quick_links' ); | ||
|
||
wp_add_dashboard_widget( 'dashboard_network_news', __( 'INN Network News', 'largo' ), 'largo_dashboard_network_news' ); | ||
$my_widget = $wp_meta_boxes['dashboard']['normal']['core']['dashboard_network_news']; | ||
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_network_news']); | ||
$wp_meta_boxes['dashboard']['side']['core']['dashboard_network_news'] = $my_widget; | ||
} | ||
|
||
// we'll still clean things up a bit for non INN members | ||
function largo_dashboard_widgets_nonmember() { | ||
// dashboad widgets for everyone! | ||
function largo_dashboard_widgets() { | ||
global $wp_meta_boxes; | ||
|
||
unset( | ||
|
@@ -42,43 +20,37 @@ function largo_dashboard_widgets_nonmember() { | |
|
||
wp_add_dashboard_widget( 'dashboard_quick_links', __( 'Project Largo Help', 'largo' ), 'largo_dashboard_quick_links' ); | ||
|
||
wp_add_dashboard_widget( 'dashboard_network_news', __( 'INN Network News', 'largo' ), 'largo_dashboard_network_news' ); | ||
$my_widget = $wp_meta_boxes['dashboard']['normal']['core']['dashboard_network_news']; | ||
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_network_news']); | ||
$wp_meta_boxes['dashboard']['side']['core']['dashboard_network_news'] = $my_widget; | ||
} | ||
|
||
// custom dashboard widgets for INN members | ||
function largo_dashboard_network_news() { | ||
echo '<div class="rss-widget">'; | ||
wp_widget_rss_output( array( | ||
'url' => 'https://feeds.feedburner.com/INNArticles', | ||
'title' => __( 'INN Network News', 'largo' ), | ||
'items' => 1, | ||
'show_summary' => 1, | ||
'show_author' => 0, | ||
'show_date' => 1 | ||
)); | ||
echo '</div>'; | ||
} | ||
|
||
/** | ||
* Largo dashboard quick links | ||
*/ | ||
function largo_dashboard_quick_links() { | ||
echo ' | ||
<div class="list-widget"> | ||
<p>If you\'re having trouble with your site, want to request a new feature or are just interested in learning more about Project Largo, here are a few helpful links:</p> | ||
<ul> | ||
<li><a href="https://largo.inn.org/">Largo Project Website</a></li> | ||
<li><a href="https://largo.readthedocs.io/">Largo Documentation</a></li> | ||
<li><a href="mailto:[email protected]">Contact Us</a></li> | ||
<li><a href="https://support.inn.org/">Help Desk</a></li> | ||
<li><a href="https://support.inn.org/">Knowledge Base</a></li> | ||
</ul> | ||
<p>Developers can also log issues on <a href="https:/INN/Largo">our public github repository</a> and if you would like to be included in our Largo users\' group, <a href="http://inn.us1.list-manage1.com/subscribe?u=81670c9d1b5fbeba1c29f2865&id=913028b23c">sign up here</a>.</p> | ||
</div> | ||
'; | ||
echo '<div class="list-widget">'; | ||
printf( | ||
'<p>%1$s</p>', | ||
__( 'If you\'re having trouble with your site, want to request a new feature or are just interested in learning more about Project Largo, here are a few helpful links:', 'largo' ) | ||
); | ||
echo '<ul>'; | ||
$links = array( | ||
// these are translated with their HTML in case we have different-language versions of these | ||
__( '<a href="https://largo.wpbuddy.co/">Largo Project Website</a>', 'largo' ), | ||
__( '<a href="https://largo.readthedocs.io/">Largo Documentation</a>', 'largo' ), | ||
__( '<a href="https://largo.wpbuddy.co/support">Help Desk and Knowledge Base</a>', 'largo' ), | ||
__( '<a href="mailto:[email protected]">Contact Us</a>', 'largo' ), | ||
); | ||
foreach ( $links as $link ) { | ||
printf( | ||
'<li>%1$s</li>', | ||
$link | ||
); | ||
} | ||
echo '</ul>'; | ||
printf( | ||
'<p>%1$s</p>', | ||
__( 'Developers can also log issues on <a href="https:/WPBuddy/Largo">the theme\'s GitHub repository</a>. We welcome contributions.', 'largo' ), // translate the HTML in case the link needs localization. | ||
); | ||
echo '</div>'; | ||
} | ||
|
||
// add the largo logo to the login page | ||
|
@@ -95,13 +67,9 @@ function largo_custom_login_logo() { | |
'; | ||
} | ||
|
||
// only load the dashboard customizations if this is an INN member site | ||
if ( INN_MEMBER === TRUE ) { | ||
add_action('login_head', 'largo_custom_login_logo'); | ||
add_action('wp_dashboard_setup', 'largo_dashboard_widgets_member'); | ||
} else { | ||
add_action('wp_dashboard_setup', 'largo_dashboard_widgets_nonmember'); | ||
} | ||
// load the dashboard customizations | ||
add_action('login_head', 'largo_custom_login_logo'); | ||
add_action('wp_dashboard_setup', 'largo_dashboard_widgets'); | ||
|
||
/** | ||
* Largo Dashboard / Admin Bar Menu | ||
|
@@ -117,50 +85,38 @@ function largo_dash_admin_menu( $wp_admin_bar ) { | |
$wp_admin_bar->add_node( $args ); | ||
|
||
// Main Website | ||
$args = array( 'id' => 'website', 'title' => 'Main Website', 'href' => 'https://largo.inn.org//', 'parent' => 'largo_admin_mega' ); | ||
$args = array( 'id' => 'website', 'title' => 'Main Website', 'href' => 'https://largo.wpbuddy.co/', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// Documentation | ||
$args = array( 'id' => 'largo_docs', 'title' => 'Documentation', 'href' => 'https://largo.readthedocs.io/', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// Knowledge Base | ||
$args = array( 'id' => 'knowledge_base', 'title' => 'Knowledge Base', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' ); | ||
$args = array( 'id' => 'knowledge_base', 'title' => 'Knowledge Base', 'href' => 'https://largo.wpbuddy.co/support', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// Member Help Desk | ||
$args = array( 'id' => 'support', 'title' => 'Help Desk', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' ); | ||
$args = array( 'id' => 'support', 'title' => 'Help Desk', 'href' => 'https://largo.wpbuddy.co/support', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// Member Forums | ||
$args = array( 'id' => 'user_forums', 'title' => 'Community Forums', 'href' => 'https://support.inn.org/', 'parent' => 'largo_admin_mega' ); | ||
$args = array( 'id' => 'user_forums', 'title' => 'Community Forums', 'href' => 'https://largo.wpbuddy.co/support', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// Largo on GitHub | ||
$args = array( 'id' => 'github', 'title' => 'Largo on GitHub', 'href' => 'https:/inn/largo', 'parent' => 'largo_admin_mega' ); | ||
$args = array( 'id' => 'github', 'title' => 'Largo on GitHub', 'href' => 'https:/WPBuddy/largo', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// Largo on Twitter | ||
$args = array( 'id' => 'twitter', 'title' => '@LargoProject on Twitter', 'href' => 'https://twitter.com/largoproject', 'parent' => 'largo_admin_mega'); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// INN Nerds | ||
$args = array( 'id' => 'inn_nerds', 'title' => 'INN Nerds', 'href' => 'https://labs.inn.org/', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// About INN | ||
$args = array( 'id' => 'about_inn', 'title' => 'About INN', 'href' => 'https://inn.org', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
// Donate | ||
$args = array( 'id' => 'donate_inn', 'title' => 'Donate', 'href' => 'https://inn.org/donate/', 'parent' => 'largo_admin_mega' ); | ||
$wp_admin_bar->add_node( $args ); | ||
|
||
} | ||
|
||
// add a credit line to the admin footer | ||
function largo_admin_footer_text( $default_text ) { | ||
return '<span id="footer-thankyou">This website powered by <a href="https://largo.inn.org/">Project Largo</a> from <a href="https://inn.org/">INN</a> and <a href="https://wordpress.org">WordPress</a>.</span>'; | ||
return '<span id="footer-thankyou">This website powered by <a href="https://largo.wpbuddy.co/">Project Largo</a> from <a href="https://wpbuddy.co/">WP Buddy</a> and <a href="https://wordpress.org">WordPress</a>.</span>'; | ||
} | ||
add_filter( 'admin_footer_text', 'largo_admin_footer_text' ); | ||
|
||
|