-
Notifications
You must be signed in to change notification settings - Fork 8
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 #28 from GuyPrimavera/feature_refactor
v3.1 updates
- Loading branch information
Showing
75 changed files
with
2,498 additions
and
8,386 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 |
---|---|---|
@@ -1,35 +1,29 @@ | ||
<?php | ||
<?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { exit; } | ||
|
||
function aquila_admin_bar_links() { | ||
global $wp_admin_bar; | ||
$wp_admin_bar->remove_menu('updates'); | ||
$wp_admin_bar->remove_menu('comments'); | ||
$wp_admin_bar->remove_menu('new-content'); | ||
$wp_admin_bar->remove_menu('vc_inline-admin-bar-link'); | ||
$wp_admin_bar->remove_menu('revslider'); | ||
$wp_admin_bar->remove_menu('customize'); | ||
$wp_admin_bar->remove_menu('themes'); | ||
$wp_admin_bar->remove_menu('widgets'); | ||
$wp_admin_bar->remove_menu('menus'); | ||
|
||
global $wp_admin_bar; | ||
$wp_admin_bar -> remove_menu('updates'); | ||
$wp_admin_bar -> remove_menu('comments'); | ||
$wp_admin_bar -> remove_menu('new-content'); | ||
$wp_admin_bar -> remove_menu('vc_inline-admin-bar-link'); | ||
$wp_admin_bar -> remove_menu('revslider'); | ||
$wp_admin_bar -> remove_menu('customize'); | ||
$wp_admin_bar -> remove_menu('themes'); | ||
$wp_admin_bar -> remove_menu('widgets'); | ||
$wp_admin_bar -> remove_menu('menus'); | ||
} | ||
add_action( 'wp_before_admin_bar_render', 'aquila_admin_bar_links', 999 ); | ||
|
||
|
||
// Remove "How are you" // | ||
add_action('wp_before_admin_bar_render', 'aquila_admin_bar_links', 999); | ||
|
||
// Remove "How are you" | ||
function aquila_admin_bar_appearance() { | ||
global $wp_admin_bar; | ||
$user_id = get_current_user_id(); | ||
$user_id = get_current_user_id(); | ||
$current_user = wp_get_current_user(); | ||
$adminUser = $current_user->display_name; | ||
$avatar = get_avatar( $user_id, 16 ); | ||
$wp_admin_bar->add_menu( array( | ||
'id' => 'my-account', | ||
'title' => ' ' . $adminUser . $avatar ) | ||
$adminUser = $current_user -> display_name; | ||
$avatar = get_avatar($user_id, 16); | ||
$wp_admin_bar -> add_menu(array( | ||
'id' => 'my-account', | ||
'title' => ' ' . $adminUser . $avatar ) | ||
); | ||
} | ||
add_action( 'wp_before_admin_bar_render', 'aquila_admin_bar_appearance' ); | ||
|
||
|
||
|
||
?> | ||
add_action('wp_before_admin_bar_render', 'aquila_admin_bar_appearance'); |
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
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 |
---|---|---|
@@ -1,77 +1,82 @@ | ||
<?php if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; } | ||
<?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { exit; } | ||
|
||
// Admin Bar links | ||
if ( ! isset( $GLOBALS['aquilaShowAdminbarLinks'] ) || !$GLOBALS['aquilaShowAdminbarLinks']) { | ||
add_action( 'admin_bar_menu', 'aquila_admin_bar_cleanup', 200 ); | ||
function aquila_admin_bar_cleanup() | ||
{ | ||
global $wp_admin_bar; | ||
if ( !is_object( $wp_admin_bar ) ) { | ||
return; | ||
} | ||
if (!isset($GLOBALS['aquilaShowAdminbarLinks']) || !$GLOBALS['aquilaShowAdminbarLinks']) { | ||
function aquila_admin_bar_cleanup() { | ||
global $wp_admin_bar; | ||
if (!is_object($wp_admin_bar)) { | ||
return; | ||
} | ||
|
||
$nodes = $wp_admin_bar->get_nodes(); | ||
$nodesKeep = array('wp-logo', 'site-name', 'adminTitle', 'screenOptions', 'contextHelp', 'menu-toggle', 'my-account', 'view', 'edit'); | ||
$nodes = $wp_admin_bar -> get_nodes(); | ||
$nodesKeep = array( | ||
'wp-logo', | ||
'site-name', | ||
'adminTitle', | ||
'screenOptions', | ||
'contextHelp', | ||
'menu-toggle', | ||
'my-account', | ||
'view', | ||
'edit' | ||
); | ||
|
||
foreach( $nodes as $node ) | ||
{ | ||
if( (!$node->parent || 'top-secondary' == $node->parent) && (!in_array($node->id, $nodesKeep)) ) { | ||
$wp_admin_bar->remove_menu( $node->id ); | ||
//echo $node->id . '<br/>'; | ||
} | ||
} | ||
foreach($nodes as $node) { | ||
if((!$node->parent || 'top-secondary' == $node -> parent) && (!in_array($node -> id, $nodesKeep))) { | ||
$wp_admin_bar->remove_menu($node->id); | ||
} | ||
} | ||
} | ||
add_action('admin_bar_menu', 'aquila_admin_bar_cleanup', 200); | ||
} | ||
|
||
// Remove nodes | ||
add_action( 'admin_bar_menu', 'aquila_remove_wp_logo_nodes', 999 ); | ||
add_action('admin_bar_menu', 'aquila_remove_wp_logo_nodes', 999); | ||
function aquila_remove_wp_logo_nodes() { | ||
global $wp_admin_bar; | ||
$wp_admin_bar->remove_node( 'about' ); | ||
$wp_admin_bar->remove_node( 'wporg' ); | ||
$wp_admin_bar->remove_node( 'documentation' ); | ||
$wp_admin_bar->remove_node( 'support-forums' ); | ||
$wp_admin_bar->remove_node( 'feedback' ); | ||
global $wp_admin_bar; | ||
$wp_admin_bar -> remove_node('about'); | ||
$wp_admin_bar -> remove_node('wporg'); | ||
$wp_admin_bar -> remove_node('documentation'); | ||
$wp_admin_bar -> remove_node('support-forums'); | ||
$wp_admin_bar -> remove_node('feedback'); | ||
} | ||
|
||
// Add Aquila links | ||
if ( !isset($GLOBALS['aquilaHideLogoMenu']) || !$GLOBALS['aquilaHideLogoMenu']) { | ||
if (!isset($GLOBALS['aquilaHideLogoMenu']) || !$GLOBALS['aquilaHideLogoMenu']) { | ||
add_action('admin_bar_menu', 'aquila_wp_logo_links', 100); | ||
} | ||
function aquila_wp_logo_links($admin_bar){ | ||
$admin_bar->add_menu( array( | ||
'id' => 'wpLessons', | ||
'parent'=> 'wp-logo', | ||
'title' => __( 'WordPress Lessons', 'aquila-admin-theme' ), | ||
'href' => 'https://codex.wordpress.org/WordPress_Lessons', | ||
'meta' => array( | ||
'title' => __(''), | ||
'class' => __(''), | ||
'target' => __('_blank'), | ||
), | ||
)); | ||
$admin_bar->add_menu( array( | ||
'id' => 'wpGuide', | ||
'parent'=> 'wp-logo', | ||
'title' => __( 'WordPress User Guide', 'aquila-admin-theme' ), | ||
'href' => 'http://easywpguide.com/wordpress-manual/', | ||
'meta' => array( | ||
'title' => __(''), | ||
'class' => __(''), | ||
'target' => __('_blank'), | ||
), | ||
)); | ||
$admin_bar->add_menu( array( | ||
'id' => 'mitoSupport', | ||
'parent'=> 'wp-logo-external', | ||
'title' => __( 'Aquila Support', 'aquila-admin-theme' ), | ||
'href' => 'https://designbymito.com/support/', | ||
'meta' => array( | ||
'title' => __(''), | ||
'class' => __(''), | ||
'target' => __('_blank'), | ||
), | ||
)); | ||
$admin_bar->add_menu(array( | ||
'id' => 'wpLessons', | ||
'parent' => 'wp-logo', | ||
'title' => __('WordPress Lessons', 'aquila-admin-theme'), | ||
'href' => 'https://wordpress.org/support/article/wordpress-lessons/', | ||
'meta' => array( | ||
'title' => __(''), | ||
'class' => __(''), | ||
'target' => __('_blank'), | ||
), | ||
)); | ||
$admin_bar->add_menu(array( | ||
'id' => 'wpGuide', | ||
'parent' => 'wp-logo', | ||
'title' => __('WordPress User Guide', 'aquila-admin-theme'), | ||
'href' => 'http://easywpguide.com/wordpress-manual/', | ||
'meta' => array( | ||
'title' => __(''), | ||
'class' => __(''), | ||
'target' => __('_blank'), | ||
), | ||
)); | ||
$admin_bar->add_menu(array( | ||
'id' => 'mitoSupport', | ||
'parent' => 'wp-logo-external', | ||
'title' => __('Aquila Support', 'aquila-admin-theme'), | ||
'href' => 'https://wordpress.org/support/plugin/aquila-admin-theme/#new-post', | ||
'meta' => array( | ||
'title' => __(''), | ||
'class' => __(''), | ||
'target' => __('_blank'), | ||
), | ||
)); | ||
} | ||
|
||
?> |
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
<?php if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; } | ||
<?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { exit; } | ||
|
||
// Admin Bar height | ||
function aquila_admin_bar() { | ||
if ( is_admin_bar_showing() ) { | ||
if (is_admin_bar_showing()) { | ||
$topMargin = 0; | ||
if (isset($GLOBALS['aquilaShowFullAdminbar']) && $GLOBALS['aquilaShowFullAdminbar']) { | ||
$topMargin = 50; | ||
} | ||
|
||
echo "<style type='text/css' media='screen'> | ||
html { margin-top: 0px !important; } | ||
* html body { margin-top: 0px !important; } | ||
html { margin-top: " . $topMargin . "px !important; } | ||
* html body { margin-top: " . $topMargin . "px !important; } | ||
@media screen and ( max-width: 782px ) { | ||
html { margin-top: 0px !important; } | ||
* html body { margin-top: 0px !important; } | ||
html { margin-top: " . $topMargin . "px !important; } | ||
* html body { margin-top: " . $topMargin . "px !important; } | ||
} | ||
</style> | ||
"; | ||
} | ||
} | ||
add_action( 'wp_head', 'aquila_admin_bar', 99 ); | ||
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); | ||
|
||
?> | ||
add_action('wp_head', 'aquila_admin_bar', 99); | ||
remove_action('admin_color_scheme_picker', 'admin_color_scheme_picker'); |
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 |
---|---|---|
@@ -1,25 +1,22 @@ | ||
<?php if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; } | ||
<?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { exit; } | ||
|
||
if ( is_admin() ) { | ||
if (is_admin()) { | ||
add_action('admin_bar_menu', 'aquila_adminbar_title', 100); | ||
} | ||
|
||
function aquila_adminbar_title($admin_bar){ | ||
$postType = false; | ||
$postType = get_current_screen()->post_type; | ||
$postTypeName = get_post_type_object( $postType ); | ||
$postType = get_current_screen() -> post_type; | ||
$adminTitle = false; | ||
$adminTitle = get_admin_page_title(); | ||
if ($adminTitle !== false && $postType !== false && is_admin()) { | ||
$admin_bar->add_menu( array( | ||
'id' => 'adminTitle', | ||
$admin_bar -> add_menu(array( | ||
'id' => 'adminTitle', | ||
'title' => $adminTitle, | ||
'href' => '', | ||
'meta' => array( | ||
'href' => '', | ||
'meta' => array( | ||
'title' => __($adminTitle), | ||
), | ||
)); | ||
} | ||
} | ||
|
||
?> |
Oops, something went wrong.