# Paid Memberships Pro - Member Directory Add On

`meteorgpl-plugin/pmpro-member-directory` — a WordPress plugin as a Composer package.

Adds a customizable Member Directory and Member Profiles to your membership site.

- Author: Paid Memberships Pro — https://www.paidmembershipspro.com/
- Homepage: https://www.paidmembershipspro.com/add-ons/member-directory/
- License: not declared (profile: undeclared)
- Buy a license from the vendor: https://www.paidmembershipspro.com/add-ons/member-directory/
- Latest version: 1.2.2 (2022-07-07)
- Page: https://meteorgpl.com/packages/meteorgpl-plugin/pmpro-member-directory
- Requires WordPress: 4.0
- Tested up to WordPress: 5.9
- Translations: fr_FR
- Vendor: Paid Memberships Pro — https://meteorgpl.com/vendors/paidmembershipspro.com

## About

The Member Directory Add On enhances your membership site with a public or private, searchable directory and member profiles.

[Read the full documentation for the Member Directory and Profiles Add On](https://www.paidmembershipspro.com/add-ons/member-directory/)

= Official Paid Memberships Pro Add On =

This is an official Add On for [Paid Memberships Pro](https://www.paidmembershipspro.com), the most complete member management and membership subscriptions plugin for WordPress.

= Shortcodes and Attributes =
This plugin creates 2 shortcodes for a Member Directory and Member Profile pages, which can be defined in Memberships > Page Settings of the WordPress admin.

Shortcode attributes for `[pmpro_member_directory]` include:

1. avatar_size: The square pixel dimensions of the avatar to display. Requires the "show_avatar" attribute to be set to 'true'. default: '128' (accepts any numerical value).
1. fields: Display additional user meta fields. default: none (accepts a list of label names and field IDs, i.e. fields="Company,company;Website,user_url").
1. layout: The format of the directory. default: div (accepts 'table', 'div', '2col', '3col', and '4col').
1. levels: The level ID or a comma-separated list of level IDs to include in the directory. default: all levels (accepts a single level ID or a comma-separated list of IDs).
1. limit: the number of members to display per page
1. link: Optionally link the member directory item to the single member profile page. default: true (accepts 'true' or 'false').
1. order: Sort the results based on the order_by attribute in ascending or descending order. default: ASC (accepts 'DESC' or 'ASC').
1. order_by: The sort order for the results. default: 'u.display_name' (accepts 'u.user_email', 'u.user_email', 'u.display_name', 'u.user_login', 'u.user_registered', 'mu.membership_id', 'mu.startdate', 'joindate')
1. show_avatar: Display the user's avatar generated via Gravatar (https://en.gravatar.com) or user-submitted using a plugin like Simple Local Avatars (https://wordpress.org/plugins/simple-local-avatars/); default: true (accepts 'true' or 'false').
1. show_email: Display the user's email address; default: true (accepts 'true' or 'false').
1. show_level: Display the user's membership level; default: true  (accepts 'true' or 'false').
1. show_search: Display a search form (searches on member display name or email address); default: true (accepts 'true' or 'false').
1. show_startdate: Display the user's membership start date for their current level; default: true (accepts 'true' or 'false').

Shortcode attributes for `[pmpro_member_profile]` include:

1. avatar_size: The square pixel dimensions of the avatar to display. Requires the "show_avatar" attribute to be set to 'true'. default: '128' (accepts any numerical value).
1. fields: Display additional user meta fields. default: none (accepts a list of label names and field IDs, i.e. fields="Company,company;Website,user_url").
1. show_avatar: Display the user's avatar generated via Gravatar (https://en.gravatar.com) or user-submitted using a plugin like Simple Local Avatars (https://wordpress.org/plugins/simple-local-avatars/); default: true (accepts 'true' or 'false').
1. show_bio: Display the user's bio (if available); default: true (accepts 'true' or 'false').
1. show_billing: Display the user's billing address (if available); default: true (accepts 'true' or 'false').
1. show_email: Display the user's email address; default: true (accepts 'true' or 'false').
1. show_level: Display the user's membership level; default: true  (accepts 'true' or 'false').
1. show_phone: Display the user's billing phone (if available); default: true (accepts 'true' or 'false').
1. show_search: Display a search form (searches on member display name or email address); default: true (accepts 'true' or 'false').
1. show_startdate: Display the user's membership start date for their current level; default: true (accepts 'true' or 'false').
1. user_id: Show a specific member's profile; default: none (accepts any numeric uesr id, i.e. user_id="125").

## Changelog

### 1.2.2 — 2022-07-07

* BUG FIX: Fixed issue when profile page was nested within a nested page (Thanks @JarrydLong)
* BUG FIX: Fixed fatal error when Paid Memberships Pro plugin wasn't active. (Thanks @JarrydLong)
* BUG FIX: Fixed a layout issue conflict on the directory page for the Membership Maps Add On being included in the div container and now displays it correctly. (Thanks @JarrydLong)
* BUG FIX: Fixed warnings of undefined variables when navigating to a profile page of a non-existing user. (Thanks @ipokkel)
* REFACTOR: Adjusted incorrect docblock variable for the format the profile field method. (Thanks @ipokkel)

### 1.2.1 — 2022-04-07

* ENHANCEMENT: Added small sanitization check for query parameter values.
* BUG FIX: Fixed issue where passing "user_id" attribute in shortcode was returning empty results.
* BUG FIX: Removed debug code that was causing minor output issues.

### 1.2 — 2022-03-31

* ENHANCEMENT: General improvements to localization and translatable strings.
* ENHANCEMENT: Improvement to profile pretty permalinks structure that's more SEO friendly (e.g. membership-account/profile/admin/). Automatically flush permalinks when needed in admin area.
* ENHANCEMENT: Improved handling of clickable links, we try to automatically embed custom fields first or fallback to clickable URL fields.
* ENHANCEMENT: pmpro_get_element_class implemented on directory and profile pages to load HTML classes as needed.
* ENHANCEMENT: Added "Edit Profile" link for administrators when viewing the profile page. Redirects to the edit profile WordPress page.
* ENHANCEMENT: New filter `pmpromd_try_oembed_url` added to allow trying to embed possible fields first. Set this false if you don't want to automatically embed embeddable URL's.
* ENHANCEMENT: New filter `pmpromd_format_profile_field` added to allow how to format any fields that may be clickable and allows custom output for fields.
* ENHANCEMENT: New filter `pmpromd_user_identifier` added to allow how to identify/retrieve the user information. Defaults to "slug" (user_nicename) or can use user ID to retrieve relevant information in the directory or profile page.
* ENHANCEMENT: New filter `pmpro_member_directory_sql_search_where` added to allow filtering of search WHERE SQL conditions to offer more specific search results.
* ENHANCEMENT: Profile page title no longer changes to the user's name.
* ENHANCEMENTX: Improved the displaying of level dependent custom fields.
* BUG FIX: Fixed issue where pagination would cause issues with search. (Thanks @jcotter).

### 1.1 — 2020-11-16

* BUG FIX: Fixed issue where saving "hide from directory" wasn't saving on the front-end profile page.
* BUG FIX: Fixed issue where profile page wasn't showing user information (fields) correctly.

### 1.0 — 2020-08-27

* BUG FIX/ENHANCEMENT: Moved `pmpro_member_directory_after` outside div container for better styling with Membership Maps.
* ENHANCEMENT: Added new filter to adjust user display name on directory and profile page. `pmpro_member_directory_display_name`.
* ENHANCEMENT: New filter added to allow PHP to adjust the user results further. `pmpromd_user_directory_results`.

Full changelog: https://meteorgpl.com/packages/meteorgpl-plugin/pmpro-member-directory/changelog

## Install

```sh
composer config repositories.meteorgpl composer https://composer.meteorgpl.com
composer require meteorgpl-plugin/pmpro-member-directory
```

The repository needs a token (see https://meteorgpl.com/docs). The vendor's license checks are intact: activate the plugin in WordPress with a key bought from the vendor.

## Versions

| Version | Released | Size | SHA-256 | Status |
| --- | --- | --- | --- | --- |
| 1.2.2 | 2022-07-07 | 69.7 KB | d56a6e264e5f1ba144586db4360470044557a979c30aa4e9daed38046faac170 | verified |

