Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bug fix for add_menu_page on menus
  • Loading branch information
Damian Taggart committed Jul 22, 2015
1 parent b837c12 commit 87e9e94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -10,6 +10,9 @@ Provides a library of additional template tags, 3rd-party libraries, and functio

# Changelog:

## 0.9
- Bug fix for moving nav menus to top

## 0.8.9
- Add Instagram to `mapi_social_links()`

Expand Down
8 changes: 4 additions & 4 deletions core/mapi-user.php
Expand Up @@ -40,14 +40,14 @@ function mapi_set_admin_color_scheme($color_scheme) {
*
*/
function mapi_admin_menu_nav_menus() {
add_menu_page('Menus', 'Menus', 'edit_theme_options', 'nav-menus.php', '', 'dashicons-networking', 6);
add_menu_page('Menus', 'Menus', 'edit_theme_options', 'nav-menus.php', '', 'dashicons-networking', '6.55');
add_submenu_page('nav-menus.php', 'All Menus', 'All Menus', 'edit_theme_options', 'nav-menus.php');
add_submenu_page('nav-menus.php', 'Add New', 'Add New', 'edit_theme_options', '?action=edit&menu=0');
add_submenu_page('nav-menus.php', 'Menu Locations', 'Menu Locations', 'edit_theme_options', '?action=locations');
$menus = wp_get_nav_menus(array('orderby' => 'name'));
foreach($menus as $menu) {
add_submenu_page(
'nav-menus.php', esc_attr(ucwords($menu->name)), esc_attr(ucwords($menu->name)), 'edit_theme_options', 'nav-menus.php?action=edit&menu='.$menu->term_id, '');
'nav-menus.php', esc_attr(ucwords($menu->name)), esc_attr(ucwords($menu->name)), 'edit_theme_options', 'nav-menus.php?action=edit&menu=' . $menu->term_id, '');
}
}

Expand Down Expand Up @@ -99,7 +99,7 @@ function mapi_get_author_id($post_id = NULL) {
$post_id = get_the_ID();
}
$post = get_post($post_id);
$author_id = (int) $post->post_author;
$author_id = (int)$post->post_author;

/*if($author_id === 0) {
Expand Down Expand Up @@ -237,7 +237,7 @@ function mapi_has_role($user, $role) {
return FALSE;
}

if(in_array($role, (array) $user->roles)) {
if(in_array($role, (array)$user->roles)) {
return TRUE;
} else {
return FALSE;
Expand Down
4 changes: 2 additions & 2 deletions mindshare-api.php
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://mindsharelabs.com/downloads/mindshare-theme-api/
Description: Provides a library of additional template tags, 3rd-party libraries, and functions for WordPress themes and additional features for WordPress CMS websites.
Author: Mindshare Studios, Inc
Version: 0.8.9
Version: 0.9
Author URI: https://mind.sh/are/
Network: false
*/
Expand Down Expand Up @@ -106,7 +106,7 @@ class Mindshare_API {
*
* @var string
*/
private $class_version = '0.8.9';
private $class_version = '0.9';

/**
* Used for automatic updates
Expand Down

0 comments on commit 87e9e94

Please sign in to comment.