Title: philzo's Replies | WordPress.org

---

# philzo

  [  ](https://wordpress.org/support/users/philzo/)

 *   [Profile](https://wordpress.org/support/users/philzo/)
 *   [Topics Started](https://wordpress.org/support/users/philzo/topics/)
 *   [Replies Created](https://wordpress.org/support/users/philzo/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/philzo/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/philzo/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/philzo/engagements/)
 *   [Favorites](https://wordpress.org/support/users/philzo/favorites/)

 Search replies:

## Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Ultimate CSV Importer – WordPress Import & Export for CSV, XML & Excel] After installing the plugin does not appear in the wordpress dashboard.](https://wordpress.org/support/topic/after-installing-the-plugin-does-not-appear-in-the-wordpress-dashboard/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/after-installing-the-plugin-does-not-appear-in-the-wordpress-dashboard/#post-5553332)
 * I had a similar problem where after installing and activating, the plugin would
   not display its admin menu. The stats and activity widgets would display, but
   no menu option.
 * I solved this by turning off all plugins and then enabling WP Ultimate CSV Importer.
   The menu appeared and stayed on when I turned on various other plugins. When 
   I turned on ‘Groups’ the menu disappeared.
 * Not exactly scientific, but perhaps this info will help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nav Menu Roles] Getting Roles from 'Groups' (Groups plugin)](https://wordpress.org/support/topic/getting-roles-from-groups-groups-plugin/)
 *  Thread Starter [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/getting-roles-from-groups-groups-plugin/#post-5086020)
 * So I’ve been exploring the ‘nav_menu_roles_item_visibility’ as helgatheviking
   suggested and ended up writing a plugin to add Group names as custom roles and
   enable a filter to turn on menu items when a group-based role has been selected.
   This approach reduces chance of user error and the redundancy of having to add
   a capability within Groups.
 * The plugin has two functions:
    1) nmr_groups_to_roles – almost exactly like the
   function that I started this thread with except the name is more accurate and
   the $key for $roles[$key] is also the name of the Group. This is important because
   when we compare arrays of Group names and NMR roles in the next function, $items-
   >roles is an array of the $key values, not the names of the roles. (‘nmr’ is 
   short for Nav Menu Roles, of course.) (BTW – I scoured the Groups API and forum
   but couldn’t find a way to pull just the names of the Groups w/o a direct database
   query.) 2) nmr_item_visibility – this is the filter modeled after helgatheviking’s
   example in the NMR [FAQ](https://wordpress.org/plugins/nav-menu-roles/faq/). 
   It puts the current user’s groups into an array and then checks to see if any
   of those groups are also in the $item->roles array using array_intersect. Here’s
   the code:
 *     ```
       /*
       Add Group names as custom roles to Nav Menu Roles menu list
       param: $roles an array of all available roles, by default is global $wp_roles
       return: array
       */
   
       function nmr_groups_to_roles ( $roles ) {
       	global $wpdb;
   
       	$order_by = 'name';
       	$order = 'ASC';
   
       	$group_table = _groups_get_tablename( "group" );
       	if ( $groups = $wpdb->get_results(
       			"SELECT group_id FROM $group_table ORDER BY $order_by $order" ))
       		{
       			foreach( $groups as $group ) {
       				$group = new Groups_Group( $group->group_id );
       				// set $key of $roles to $group->name;
       				// this is important because $item->roles is an array of the $key values
       				$roles [$group->name] = $group->name;
       			}
       	}
       	return $roles;
       }
   
       add_filter( 'nav_menu_roles', 'nmr_groups_to_roles' );
   
       /*
       Set visibility of menu item to true, if
       - current user is a member of a group
       - AND that group has been given permission to see the menu item via Menu interface
       param: $visible boolean
       param: $item object, the complete menu object. Nav Menu Roles adds its info to $item->roles
       return: boolean
       */
   
       function nmr_item_visibility( $visible, $item ){
   
       	if( isset( $item->roles ) && is_array( $item->roles ) ){
       		$current_users_groups = array();
   
       		// get current user's groups and put into array
       		$user_ID = get_current_user_id();
       		$user = new Groups_User( $user_ID );
       		$groups = $user->groups;
       		foreach( $groups as $group ) {
       			$current_users_groups[] = $group->name;
       		}
   
       		if (! empty($current_users_groups)) {
       			// if any of the user's groups are among the roles selected via Nav Menu Groups, set visibility to true
       			if ((bool) array_intersect($current_users_groups, $item->roles) ) {
       				$visible = true;
       			}
       		}
        	}
       	return $visible;
       }
   
       add_filter( 'nav_menu_roles_item_visibility', 'nmr_item_visibility', 10, 2);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nav Menu Roles] Getting Roles from 'Groups' (Groups plugin)](https://wordpress.org/support/topic/getting-roles-from-groups-groups-plugin/)
 *  Thread Starter [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/getting-roles-from-groups-groups-plugin/#post-5085996)
 * Hi, helgatheviking. I’m not sure if this answers your question
 * > I couldn’t tell you how to determine if the current user in in a specific group?
 *  but you can try the following which I also posted in Groups forum [under your comment](http://wordpress.org/support/topic/list-of-groups?replies=2#post-5788186)
   🙂
 *     ```
       $user = new Groups_User( $user_id );
       $groups = $user->groups;
   
       print_r($groups);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Groups - Memberships and Access Control] list of groups](https://wordpress.org/support/topic/list-of-groups/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/list-of-groups/#post-5069364)
 * Also, just figured out that this will return an array of the groups of the specified
   user if you know the User ID:
 *     ```
       $user = new Groups_User( $user_id );
       			$groups = $user->groups;
   
       			print_r($groups);
       ```
   
 * Try it in your theme’s functions.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Groups - Memberships and Access Control] list of groups](https://wordpress.org/support/topic/list-of-groups/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/list-of-groups/#post-5069363)
 * If you are looking to print the list of a user’s groups to the screen, there 
   is a shortcode for that per the [documentation](http://www.itthinx.com/documentation/groups/shortcodes/):
 * [groups_user_groups] – Lists the current user’s or a specific user’s groups.
 * If you want to do it via your own code, take a look at class-groups-shortcodes.
   php in plugins/groups/lib/views/ and see how the author uses a SELECT query to
   pull those. Perhaps a direct database query is not ideal from our perspective
   but it works.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Nav Menu Roles] Getting Roles from 'Groups' (Groups plugin)](https://wordpress.org/support/topic/getting-roles-from-groups-groups-plugin/)
 *  Thread Starter [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/getting-roles-from-groups-groups-plugin/#post-5085900)
 * You’re welcome. Thanks for the great plugin!
 * I agree… there ought to be a better way. I looked for a while and found a few
   posts like this [Groups support thread](http://wordpress.org/support/topic/getting-all-groups-names-through-function?replies=2)
   that point to a direct query solution on [github](https://github.com/eggemplo/Groups-Utilities/blob/master/get_groups.php).
   I ended up borrowing from Groups’ shortcode handler code from the plugin itself(
   see lib/views/class-groups-shortcode.php).
 * If I come up with something better I’ll add to this topic.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[BackUpWordPress] wp-cron 404](https://wordpress.org/support/topic/wp-cron-404/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/wp-cron-404/#post-3415163)
 * There’s more info in the [FAQ](http://wordpress.org/extend/plugins/backupwordpress/faq/).
   Does that help?
 * **What do I do if I get the wp-cron error message**
 * The issue is that your wp-cron.php is not returning a 200 response when hit with
   a http request originating from your own server, it could be several things, 
   most of the time it’s an issue with the server / site and not with BackUpWordPress.
 * Some things you can test are.
 *  Are scheduled posts working? (They use wp-cron too).
    Are you hosted on Heart
   Internet? (wp-cron is known not to work with them). If you click manual backup
   does it work? Try adding define( ‘ALTERNATE_WP_CRON’, true ); to yourwp-config.
   php`, do automatic backups work? Is your site private (I.E. is it behind some
   kind of authentication, maintenance plugin, .htaccess) if so wp-cron won’t work
   until you remove it, if you are and you temporarily remove the authentication,
   do backups start working?
 * If you have tried all these then feel free to contact support.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [AnythingSlider autoplay problem](https://wordpress.org/support/topic/anythingslider-autoplay-problem/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/anythingslider-autoplay-problem/#post-2344181)
 * If you look in the plugins/slideshow directory and open up slideshow.js, you’ll
   find ‘timeout’ in the jquery cycle settings (line 32 of the code):
 * `timeout: 0,`
 * Comment that line out or remove it altogether to get your autoplay to work.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [3.1.4 to 3.2 and admin functions are not working](https://wordpress.org/support/topic/314-to-32-and-admin-functions-are-not-working/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/314-to-32-and-admin-functions-are-not-working/page/2/#post-2168687)
 * I share this fix in case it is pertinent to your setup. It works for mine, but
   may have no use for others.
 * I lost drag and drop functionality (and perhaps more) in the menu admin interface
   after updating to 3.2.1. I was able to get it working again when I commented 
   out the code in my custom functions.php file that was deregistering WP’s jquery
   and replacing it with the library hosted by google. This is what the original
   code looked like:
 *     ```
       /* 	Deregister native jquery and register google's */
       wp_deregister_script( 'jquery' );
       wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
       wp_enqueue_script( 'jquery' );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SH Slideshow] [Plugin: SH Slideshow] Randomize](https://wordpress.org/support/topic/plugin-sh-slideshow-randomize/)
 *  Thread Starter [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-sh-slideshow-randomize/#post-1992125)
 * Thanks, Sam! Let me know if you need someone to test it when the time comes.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Boilerplate Shortcode] [Plugin: WP Boilerplate Shortcode] Can't get 'class' attribute to appear](https://wordpress.org/support/topic/plugin-wp-boilerplate-shortcode-cant-get-class-attribute-to-appear/)
 *  Thread Starter [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-boilerplate-shortcode-cant-get-class-attribute-to-appear/#post-1760975)
 * looks good, thanks! just need to change the version number in the code 😉
 * cheers!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Boilerplate Shortcode] [Plugin: WP Boilerplate Shortcode] Can't get 'class' attribute to appear](https://wordpress.org/support/topic/plugin-wp-boilerplate-shortcode-cant-get-class-attribute-to-appear/)
 *  Thread Starter [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-boilerplate-shortcode-cant-get-class-attribute-to-appear/#post-1760836)
 * Thanks, Mike – A couple things on v1.0.5
 * 1) After removing the old and activating the new plugin, I got the following 
   error:
    `Fatal error: Call to undefined method WPBoilerplateShortcode::boilerplate_shortcode()
   in wp-content/plugins/wp-boilerplate-shortcode/wp-boilerplate-shortcode.php on
   line 32`
 * Line 32 is looking for the function ‘boilerplate_shortcode’ but in this version
   it is called ‘shortcode’. So, I changed ‘shortcode’ on line 40 (where you add_shortcode)
   and the name of the function on line 171 to ‘boilerplate_shortcode’. That cleared
   the error.
 * 2) I still had the problem with the css class not appearing. In the function ‘
   shortcode’ (now called ‘boilerplate_shortcode’ in my copy) $class is not defined.
   I simply added
    `$class = $args->class;` below line 204, where $div_id is defined
   and now my css class is appearing as expected.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Map Categories to Pages] [Plugin: Map Categories to Pages] Page Categories Not Saving](https://wordpress.org/support/topic/plugin-map-categories-to-pages-page-categories-not-saving/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-map-categories-to-pages-page-categories-not-saving/#post-1571868)
 * It had me pulling my hair out too after upgrading to WP 3.0, but I encourage 
   you to try out the sample code found here:
 * [http://wordpress.org/support/topic/388581](http://wordpress.org/support/topic/388581)
 * I added it to function.php and it worked for me, so I’ve disabled this plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [view category list in page with custom write panel](https://wordpress.org/support/topic/view-category-list-in-page-with-custom-write-panel/)
 *  [philzo](https://wordpress.org/support/users/philzo/)
 * (@philzo)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/view-category-list-in-page-with-custom-write-panel/#post-1467273)
 * Thank you, MichaelH, that code did the trick and saved my bacon.

Viewing 14 replies - 1 through 14 (of 14 total)