=== Maya Team Directory ===
Contributors: ayalip
Tags: team, directory, staff, members, profile
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A focused team / staff directory with a custom post type, group taxonomy, a responsive grid layout, and a single-member template.

== Description ==

Maya Team Directory lets you create and display a clean, fast team directory on your WordPress site. Add team members with profile photos, positions, departments, contact details, and bios, then display them with a simple `[maya_team]` shortcode.

The free plugin is intentionally lean and focused. It ships with everything you need to publish a working team page: the custom post type, group taxonomy, a responsive grid layout, search, group filtering, pagination, and a single-member template.

This plugin makes no remote calls, has no license key, no in-plugin upsell prompts, and never asks for your credit card to unlock built-in features.

Optional companion add-ons (CSV import/export, REST API endpoints, extra layouts, sidebar widget, custom CSS, accent color picker, social-network fields and icons — LinkedIn, X, Facebook, Instagram, GitHub, YouTube — featured-member highlighting, per-group layout overrides, and more) are available separately at https://mayanaikotech.com/maya-team-directory/. They install as their own plugin and are 100% optional — this plugin works fully without them.

= What's Included (Free) =

* Custom post type for team members
* Group taxonomy for organizing members
* Custom fields: Position, Department, Email, Phone, Website
* Responsive grid layout
* Search bar and group filter
* Pagination
* Single-member profile template
* Mobile responsive
* Admin photo thumbnails and sortable columns
* Translation-ready (.pot file included)
* A documented hook & filter API for add-ons (see below)

= Shortcode Usage =

Display all team members:
`[maya_team]`

Filter by group:
`[maya_team group="management"]`

Show multiple groups:
`[maya_team groups="management,board"]`

Hide members in a specific group:
`[maya_team exclude_groups="alumni"]`

Custom pagination and ordering:
`[maya_team per_page="8" orderby="title" order="ASC"]`

Hide controls:
`[maya_team search="false" filter="false"]`

Force grid column count (1–6):
`[maya_team columns="4"]`

= Template Overrides =

Copy templates from `maya-team-directory/templates/` to your theme:

* `your-theme/maya-team-directory/single-maya_member.php`
* `your-theme/maya-team-directory/archive-maya_member.php`
* `your-theme/maya-team-directory/taxonomy-maya_group.php`

= Hooks & Filters =

These hooks form the public API that companion add-ons (and any third-party plugin) can use to extend the free plugin without modifying its files.

Filters:

* `maya_td_query_args` — Modify the main member query (receives `$query_args`, `$atts`).
* `maya_td_card_data` — Modify card template data before rendering (receives `$data`, `$post_id`).
* `maya_td_card_renderer` — Return a callable to take over rendering for a non-grid layout (receives `null`, `$layout`, `$data`, `$post_id`).
* `maya_td_card_social_keys` — Add extra social networks to read for each card (receives `network-slug => meta-key` map).
* `maya_td_meta_fields` — Add extra fields to the Member Details meta box.
* `maya_td_social_fields` — Add extra fields to the Social Links meta box.
* `maya_td_social_icons` — Provide SVG icon markup for additional social networks.
* `maya_td_member_meta_keys` — Extend the list of meta keys cleaned up on uninstall.
* `maya_td_available_layouts` — Register additional layouts (list, compact, masonry, etc.) so they appear in the layout toggle and validate as shortcode `layout=""` values.
* `maya_td_layout_icon` — Provide the SVG icon for a registered layout's toggle button.
* `maya_td_single_member_template` — Override the path of the single-member template file.
* `maya_td_sanitize_settings` — Sanitize and persist add-on-registered settings fields.
* `maya_td_resource_links` — Add, remove, or reorder links in the Settings page Resources sidebar.

Actions:

* `maya_td_init` — Fires after the free plugin's core classes are instantiated. Add-ons should bootstrap from here.
* `maya_td_register_admin_menu` — Fires after the Settings submenu is registered, so add-ons can add their own submenus under the Maya Team Directory menu.
* `maya_td_settings_sections` — Render extra `<div class="maya-settings-section">` blocks inside the settings form.
* `maya_td_settings_sidebar` — Render extra panels in the settings sidebar.
* `maya_td_before_directory` — Fires before the directory wrapper opens (receives `$atts`, `$members` WP_Query).
* `maya_td_after_directory` — Fires after the directory wrapper closes (receives `$atts`, `$members` WP_Query).
* `maya_td_after_card_content` — Add content inside each card, after the bio (receives `$data`, `$post_id`).
* `maya_td_after_member_details_fields` — Add inputs inside the Member Details meta box.
* `maya_td_after_social_fields` — Add inputs inside the Social Links meta box.
* `maya_td_display_options_fields` — Add inputs inside the Display Options side meta box.
* `maya_td_save_member_meta` — Persist add-on-owned member meta keys when a member post is saved.

= External Services =

This plugin does not connect to any external services. All processing happens locally on your WordPress site. No data is sent to any third-party server.

== Installation ==

1. Upload the `maya-team-directory` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Team Members > Add New to create team members
4. Use the `[maya_team]` shortcode on any page or post
5. Configure settings at Team Members > Settings

== Frequently Asked Questions ==

= How do I display team members? =

Use the shortcode `[maya_team]` on any page or post. You can filter by group with `[maya_team group="your-group-slug"]`.

= Does it work with page builders? =

Yes. The shortcode works with Elementor, Beaver Builder, Divi, and any builder that supports WordPress shortcodes.

= Can I customize the design? =

Override any template by copying it from the plugin's `templates/` folder into your theme under `your-theme/maya-team-directory/`. You can also style the front-end output from your theme's stylesheet — every element has a stable `.maya-*` class.

= Does the plugin call any external services? =

No. The plugin operates entirely on your own WordPress install. Nothing is sent to any third-party server.

= Where did Import/Export, the REST API, the sidebar widget, list/compact layouts, custom CSS, accent color, and the social-network fields go? =

They were moved to a separately-distributed companion add-on so the free plugin can stay small and focused. The hooks and filters required to add them back are documented above. The add-on is available at https://mayanaikotech.com/maya-team-directory/ and is entirely optional.

= Why are there no LinkedIn / X / Facebook fields in the member editor? =

Social-network fields and their icons (LinkedIn, X, Facebook, Instagram, GitHub, YouTube, etc.) are entirely owned by the optional companion add-on. The free plugin exposes the `maya_td_social_fields`, `maya_td_social_icons`, and `maya_td_card_social_keys` filters so any plugin can register networks and have them appear in the Social Links meta box and on member cards.

== Screenshots ==

1. Frontend grid layout with search and filter
2. Single member profile page
3. Admin member editor
4. Settings page

== Changelog ==

= 1.0.2 =
* Plugin Check pass. Fixed two `WordPress.Security.EscapeOutput.OutputNotEscaped` errors in `Maya_Shortcode::render_shortcode()`: the wrapper inline-style is now built as a value-only string and escaped with `esc_attr()` at the point of output, and the `<option selected>` attribute now uses the core `selected()` helper instead of a hand-rolled string. Renamed every template-scope variable in `templates/single-maya_member.php`, `templates/archive-maya_member.php`, and `templates/taxonomy-maya_group.php` to use the `$maya_` prefix so Plugin Check's `WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound` rule no longer fires. Added narrowly-scoped `phpcs:ignore` annotations (with justifications) for the unavoidable `tax_query`, `meta_query`, and `post__not_in` query parameters that are inherent to the directory's filtering and ordering features.

= 1.0.1 =
* Pre-release hardening based on the WordPress.org plugin review feedback. Updated the readme `Contributors` field to use the correct WordPress.org username (`ayalip`). Sanitized the nonce input in `Maya_Meta_Fields::save_meta()` with `sanitize_text_field( wp_unslash( ... ) )` before passing it to `wp_verify_nonce()`. Captured the `ob_start()` buffer in `Maya_Shortcode::ajax_load_more()` into an explicit `$html` variable via `ob_get_clean()` in the same function scope, so the buffer is unambiguously paired and cannot be left open by any code path. Replaced the `Maya_Meta_Fields::kses_svg()` echo helper with direct `wp_kses( $svg, Maya_Meta_Fields::svg_allowed_tags() )` calls at every echo site (front-end card renderer and the single-member template) so Plugin Check sees a recognised core escaper at the point of output. Wrapped the imploded group-link list in `wp_kses_post()` instead of relying on a phpcs ignore comment. The `kses_svg()` helper itself is kept as a thin wrapper around `wp_kses()` for backwards compatibility.

= 1.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.2 =
Plugin Check clean. Fixes two output-escaping errors in the shortcode and renames template variables to use the `$maya_` prefix. No data, settings, or feature changes.

= 1.0.1 =
Security and code-quality hardening based on WordPress.org review feedback. No data, settings, or feature changes.

= 1.0 =
Initial release.

== Support ==

For support, please email ayalip@mayanaikotech.com or visit https://mayanaikotech.com/maya-team-directory.
