Skip to content

Commit 9d53550

Browse files
Kathy DarlingKathy Darling
authored andcommitted
1.7.8 version bump, changelog, and readme style tweaks
1 parent bdf1e78 commit 9d53550

File tree

6 files changed

+44
-140
lines changed

6 files changed

+44
-140
lines changed

js/nav-menu-roles.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/nav-menu-roles.pot

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the GPL2.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Nav Menu Roles 1.7.7\n"
5+
"Project-Id-Version: Nav Menu Roles 1.7.8\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/nav-menu-roles\n"
7-
"POT-Creation-Date: 2016-02-09 22:49:34+00:00\n"
7+
"POT-Creation-Date: 2016-02-17 15:40:32+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -163,44 +163,37 @@ msgstr ""
163163
msgid "Nav Menu Roles"
164164
msgstr ""
165165

166-
#: nav-menu-roles.php:175
166+
#: nav-menu-roles.php:168
167167
msgid ""
168168
"Import %snav menu roles%s and other menu item meta skipped by the default "
169169
"importer"
170170
msgstr ""
171171

172-
#: nav-menu-roles.php:236
173-
msgid ""
174-
"Nav Menu Roles has detected a possible conflict in the following locations: "
175-
"%1$s. Please direct the author of the conflicting theme or plugin to the "
176-
"%2$sFAQ%3$s for a solution. | %4$sHide Notice%3$s"
177-
msgstr ""
178-
179-
#: nav-menu-roles.php:278
172+
#: nav-menu-roles.php:221
180173
msgid "FAQ"
181174
msgstr ""
182175

183-
#: nav-menu-roles.php:279
176+
#: nav-menu-roles.php:222
184177
msgid "Donate"
185178
msgstr ""
186179

187-
#: nav-menu-roles.php:347
180+
#: nav-menu-roles.php:291
188181
msgid "Display Mode"
189182
msgstr ""
190183

191-
#: nav-menu-roles.php:355
184+
#: nav-menu-roles.php:299
192185
msgid "Logged In Users"
193186
msgstr ""
194187

195-
#: nav-menu-roles.php:362
188+
#: nav-menu-roles.php:306
196189
msgid "Logged Out Users"
197190
msgstr ""
198191

199-
#: nav-menu-roles.php:369
192+
#: nav-menu-roles.php:313
200193
msgid "Everyone"
201194
msgstr ""
202195

203-
#: nav-menu-roles.php:376
196+
#: nav-menu-roles.php:320
204197
msgid "Restrict menu item to a minimum role"
205198
msgstr ""
206199

nav-menu-roles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Nav Menu Roles
44
Plugin URI: http://www.kathyisawesome.com/449/nav-menu-roles/
55
Description: Hide custom menu items based on user roles.
6-
Version: 1.7.7
6+
Version: 1.7.8
77
Author: Kathy Darling
88
Author URI: http://www.kathyisawesome.com
99
License: GPL2

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Nav Menu Roles",
33
"name": "nav-menu-roles",
4-
"version": "1.7.7",
4+
"version": "1.7.8",
55
"description": "Hide menu items based on user roles",
66
"main": "Gruntfile.js",
77
"license": "GPL-3.0",

readme.md

Lines changed: 19 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
**Tags:** menu, menus, nav menu, nav menus
66
**Requires at least:** 4.4.0
77
**Tested up to:** 4.4.0
8-
**Stable tag: 1.7.7
8+
**Stable tag:** 1.7.8
99
**License:** GPLv3
1010

11-
Hide custom menu items based on user roles. PLEASE READ THE FAQ IF YOU ARE NOT SEEING THE SETTINGS.
11+
Hide custom menu items based on user roles. PLEASE READ THE [FAQ](#frequently-asked-questions) IF YOU ARE NOT SEEING THE SETTINGS.
1212

1313
## Description ##
1414

1515
This plugin lets you hide custom menu items based on user roles. So if you have a link in the menu that you only want to show to logged in users, certain types of users, or even only to logged out users, this plugin is for you.
1616

17-
Nav Menu Roles is very flexible. In addition to standard user roles, you can customize the functionality by adding your own check boxes with custom labels using the `nav_menu_roles` filter and then using the `nav_menu_roles_item_visibility` filter to check against whatever criteria you need. You can check against any user meta values (like capabilities) and any custom attributes added by other plugins. See the [FAQ](http://wordpress.org/plugins/nav-menu-roles/faq/#new-role).
17+
Nav Menu Roles is very flexible. In addition to standard user roles, you can customize the functionality by adding your own check boxes with custom labels using the `nav_menu_roles` filter and then using the `nav_menu_roles_item_visibility` filter to check against whatever criteria you need. You can check against any user meta values (like capabilities) and any custom attributes added by other plugins. See the [FAQ](#im-using-xyz-membership-plugin-and-i-dont-see-its-levels).
1818

1919
### IMPORTANT NOTE ###
2020

@@ -49,7 +49,7 @@ Please report any bugs, errors, warnings, code problems to [Github](https://gith
4949

5050
## Frequently Asked Questions ##
5151

52-
= <a id="conflict"></a>I don't see the Nav Menu Roles options in the admin menu items? =
52+
# I don't see the Nav Menu Roles options in the admin menu items? #
5353

5454
This is because you have another plugin (or theme) that is also trying to alter the same code that creates the Menu section in the admin.
5555

@@ -66,33 +66,33 @@ WordPress does not have sufficient hooks in this area of the admin and until the
6666
7. Jupiter Theme
6767

6868

69-
= <a id="compatibility"></a>Workaround #1 =
69+
# Workaround #1 #
7070
[Shazdeh](https://profiles.wordpress.org/shazdeh/) had the genius idea to not wait for a core hook and simply add the hook ourselves. If all plugin and theme authors use the same hook, we can make our plugins play together.
7171

7272
Therefore, as of version 1.6 I am modifying my admin nav menu Walker to *only* adding the following lines (right after the description input):
7373

74-
`
74+
```
7575
<?php
7676
// Place this in your admin nav menu Walker
7777
do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
7878
// end added section
7979
?>
80-
`
80+
```
8181

8282
**Ask your conflicting plugin/theme's author to add this code to his plugin or theme and our plugins will become compatible.**
8383

84-
= <a id="patch"></a>Patching Your Plugin/Theme =
84+
# Patching Your Plugin/Theme #
8585

8686
**Should you wish to attempt this patch yourself, you can modify your conflicting plugin/theme's admin menu Walker class. **Reminder:** I do not provide support for fixing your plugin/theme. If you aren't comfortable with the following instructions, contact the developer of the conflicting plugin/theme!**
8787

8888
1. Find the class that extends the `Walker_Nav_Menu`. As a hint, it is filtering `wp_edit_nav_menu_walker` and you might even be getting a warning about it from Nav Menu Roles. Example:
8989

90-
`
90+
```
9191
add_filter( 'wp_edit_nav_menu_walker', 'sample_edit_nav_menu_walker');
9292
function sample_edit_nav_menu_walker( $walker ) {
9393
return 'Walker_Nav_Menu_Edit_Roles'; // this is the class name
9494
}
95-
`
95+
```
9696

9797
2. Find the file for the extending class. In my plugin this is in a file located at `inc/class.Walker_Nav_Menu_Edit_Roles.php`. I can't know *where* this file is in your plugin/theme. Please don't ask me, but here's what the beginning of that class will look like:
9898

@@ -110,7 +110,7 @@ In that file you will eventually see a class method that looks like:
110110

111111
In Nav Menu Roles, I have placed the hook directly after the description, ex:
112112

113-
`
113+
```
114114
<p class="field-description description description-wide">
115115
<label for="edit-menu-item-description-<?php echo $item_id; ?>">
116116
<?php _e( 'Description' ); ?><br />
@@ -124,7 +124,7 @@ In Nav Menu Roles, I have placed the hook directly after the description, ex:
124124
do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
125125
// end added section
126126
?>
127-
`
127+
```
128128

129129
### Workaround #2 ###
130130

@@ -136,9 +136,9 @@ There are apparently a few membership plugins out there that *don't* use traditi
136136

137137
Here's an example where I've added a new pseudo role, creatively called "new-role". The first function adds it to the menu item admin screen. The second function is pretty generic and won't actually do anything because you need to supply your own logic based on the plugin you are using. Nav Menu Roles will save the new "role" info and add it to the item in an array to the `$item->roles` variable.
138138

139-
= <a id="new-role"></a>Adding a new "role" =
139+
# Adding a new "role" #
140140

141-
`
141+
```
142142
/*
143143
* Add custom roles to Nav Menu Roles menu list
144144
** * param:** $roles an array of all available roles, by default is global $wp_roles
@@ -149,13 +149,13 @@ function kia_new_roles( $roles ){
149149
return $roles;
150150
}
151151
add_filter( 'nav_menu_roles', 'kia_new_roles' );
152-
`
152+
```
153153

154154
Note, if you want to add a WordPress capability the above is literally all you need. Because Nav Menu Roles checks whether a role has permission to view the menu item using `current_user_can($role) you do not need to right a custom callback for the `nav_menu_roles_item_visibility` filter.
155155

156156
In case you *do* need to check your visibility status against something very custom, here is how you'd go about it:
157157

158-
`
158+
```
159159
/*
160160
* Change visibilty of each menu item
161161
** * param:** $visible boolean
@@ -174,7 +174,7 @@ function kia_item_visibility( $visible, $item ){
174174
return $visible;
175175
}
176176
add_filter( 'nav_menu_roles_item_visibility', 'kia_item_visibility', 10, 2 );
177-
`
177+
```
178178

179179
Note that you have to generate your own if/then logic. I can't provide free support for custom integration with another plugin. You may [contact me](http://kathyisawesome.com/contact) to discuss hiring me, or I would suggest using a plugin that supports WordPress' roles, such as Justin Tadlock's [Members](http://wordpress.org/plugins/members).
180180

@@ -186,9 +186,9 @@ Therefore, if you have no items to display, WordPress will end up displaying ALL
186186

187187
If you don't want this, you must set the fallback argument to be a null string.
188188

189-
`
189+
```
190190
wp_nav_menu( array( 'theme_location' => 'primary-menu', 'fallback_cb' => '' ) );
191-
`
191+
```
192192

193193
### What happened to my menu roles on import/export? ###
194194

@@ -204,100 +204,3 @@ However, the Import plugin only imports certain post meta for menu items. As of
204204
1. Use the same .xml file and perform a second import
205205
1. No duplicate posts will be created but all menu post meta (including your Nav Menu Roles info) will be imported
206206

207-
## Changelog ##
208-
209-
### 1.7.6 ###
210-
* tweak CSS to initially hide checkboxes on newly added menu items (defaults to "Everyone" so roles should not appear)
211-
212-
### 1.7.5 ###
213-
* Update Walker_Nav_Menu_Edit_Roles to mimic Walker_Nav_Menu in WordPress 4.4
214-
215-
### 1.7.4 ###
216-
* Change language in metabox to try to explain min caps versus strict role checking
217-
* keep tweaking the FAQ
218-
219-
### 1.7.3 ###
220-
* update readme, update error notice, add more links to the FAQ
221-
222-
### 1.7.2 ###
223-
* add Italian language. props @sododesign
224-
225-
### 1.7.1 ###
226-
* Updated FAQ with patch instructions for conflicting plugins/themes
227-
* add Portugeuse language. props @brunobarros
228-
229-
### 1.7.0 ###
230-
* adjust admin UI to be more user-friendly. Options are now: show to everyone, show to logged out users, and show to logged in users (optionally, logged in users by specific role)
231-
232-
### 1.6.5 ###
233-
* add Guajarati language. props @rohilmistry93
234-
235-
### 1.6.4 ###
236-
* more language issues -> sync svn+git version numbers
237-
238-
### 1.6.3 ###
239-
* Try again to add languages. Where'd they all go?
240-
241-
### 1.6.2 ###
242-
* Add French translation. Props @Philippe Gilles
243-
244-
### 1.6.1 ###
245-
* Update list of conflits
246-
* Don't display radio buttons if no roles - allows for granular permissions control
247-
248-
### 1.6.0 ###
249-
* Feature: Hiding a parent menu item will automatically hide all its children
250-
* Feature: Add compatibility with Menu Item Visibility Control plugin and any plugin/theme that is willing to add its inputs via the `wp_nav_menu_item_custom_fields` hook. See the [FAQ](http://wordpress.org/plugins/nav-menu-roles/faq/#compatibility) to make our plugins compatible.
251-
252-
### 1.5.1 ###
253-
* Hopefully fix missing nav-menu-roles.min.js SVN issue
254-
255-
### 1.5.0 ###
256-
* Switch to instance of plugin
257-
* Add notice when conflicting plugins are detected
258-
* Remove some extraneous parameters
259-
* Add Spanish translation thanks to @deskarrada
260-
261-
### 1.4.1 ###
262-
* update to WP 3.8 version of Walker_Nav_Menu_Edit (prolly not any different from 3.7.1)
263-
* minor CSS adjustment to admin menu items
264-
* checked against WP 3.8
265-
266-
### 1.4 ###
267-
* Add to FAQ
268-
* add JS flair to admin menu items
269-
* update to WP 3.7.1 version of Walker_Nav_Menu_Edit
270-
271-
### 1.3.5 ###
272-
* Add nav_menu_roles_item_visibility filter to work with plugins that don't use traditional roles
273-
274-
### 1.3.4 ###
275-
* Update admin language thanks to @hassanhamm
276-
* Add Arabic translation thanks to @hassanhamm
277-
278-
### 1.3.3 ###
279-
* Fix Nav_Menu_Roles_Import not found error
280-
281-
### 1.3.2 ###
282-
* Stupid comment error causing save issues
283-
284-
### 1.3.1 ###
285-
* SVN failure to include importer files!
286-
287-
### 1.3 ###
288-
* Added custom importer
289-
290-
### 1.2 ###
291-
* Major fix for theme's that use their own custom Walkers, thanks to Evan Stein @vanpop http://vanpop.com/
292-
* Instead of a custom nav Walker, menu items are controlled through the wp_get_nav_menu_items filter
293-
* Remove the custom nav Walker code
294-
295-
### 1.1.1 ###
296-
* Fix link to plugin site
297-
* Fix labels in admin Walker
298-
299-
### 1.1 ###
300-
* Clean up debug messages
301-
302-
### 1.0 ###
303-
* Initial release

readme.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Donate link: https://www.paypal.me/helgatheviking
55
Tags: menu, menus, nav menu, nav menus
66
Requires at least: 4.4.0
77
Tested up to: 4.4.0
8-
Stable tag: 1.7.7
8+
Stable tag: 1.7.8
99
License: GPLv3
1010

1111
Hide custom menu items based on user roles. PLEASE READ THE FAQ IF YOU ARE NOT SEEING THE SETTINGS.
@@ -81,7 +81,9 @@ do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
8181

8282
= <a id="patch"></a>Patching Your Plugin/Theme =
8383

84-
Should you wish to attempt this patch yourself, you can modify your conflicting plugin/theme's admin menu Walker class. **Reminder: I do not provide support for fixing your plugin/theme. If you aren't comfortable with the following instructions, contact the developer of the conflicting plugin/theme!**
84+
Should you wish to attempt this patch yourself, you can modify your conflicting plugin/theme's admin menu Walker class.
85+
86+
**Reminder: I do not provide support for fixing your plugin/theme. If you aren't comfortable with the following instructions, contact the developer of the conflicting plugin/theme!**
8587

8688
1. Find the class that extends the `Walker_Nav_Menu`. As a hint, it is filtering `wp_edit_nav_menu_walker` and you might even be getting a warning about it from Nav Menu Roles. Example:
8789

@@ -134,7 +136,7 @@ There are apparently a few membership plugins out there that *don't* use traditi
134136

135137
Here's an example where I've added a new pseudo role, creatively called "new-role". The first function adds it to the menu item admin screen. The second function is pretty generic and won't actually do anything because you need to supply your own logic based on the plugin you are using. Nav Menu Roles will save the new "role" info and add it to the item in an array to the `$item->roles` variable.
136138

137-
= <a id="new-role"></a>Adding a new "role" =
139+
= <a id="new-role"></a>Adding a new "role" =
138140

139141
`
140142
/*
@@ -204,6 +206,12 @@ However, the Import plugin only imports certain post meta for menu items. As of
204206

205207
== Changelog ==
206208

209+
= 1.7.8 =
210+
* remove all admin notices
211+
212+
= 1.7.7 =
213+
* add fancy debug messages
214+
207215
= 1.7.6 =
208216
* tweak CSS to initially hide checkboxes on newly added menu items (defaults to "Everyone" so roles should not appear)
209217

0 commit comments

Comments
 (0)