All Purpose Directory

Everything you need to build directory and listing websites with All Purpose Directory and its module ecosystem.

Getting Started

All Purpose Directory is available on WordPress.org. Install it in a few steps:

  1. In your WordPress admin, go to Plugins → Add New and search for "All Purpose Directory".
  2. Click Install Now, then Activate.
  3. Navigate to APD → Settings to configure your first directory.
  4. Create a new page and add the [flavor_listings] shortcode to display your listings.

Once active, the plugin registers a listing post type with categories, custom fields, frontend submission, and search out of the box. You can extend it further with any of the APD modules.

All Purpose Directory

Core Concepts

Listings are the core content type. Each listing is a custom post that can hold an unlimited number of custom fields, belong to categories, and move through moderation statuses.

Categories organize listings into groups. Categories support hierarchy, custom icons, and per-category field configurations so different listing types can collect different data.

Fields define the data each listing collects. APD ships with 25+ field types including text, textarea, select, checkbox, radio, number, URL, email, date, file upload, gallery, repeater, and more. Fields are managed through the admin and automatically rendered on the frontend.

Statuses control the listing lifecycle: pending, published, expired, and rejected. Admins configure which statuses require moderation and whether auto-approval is enabled.

Shortcodes

[flavor_listings]
Display a grid or list of listings with filtering and pagination.
Parameters: category, per_page, orderby, status
[flavor_search]
Render a search form with field-based filters and AJAX support.
Parameters: fields, layout, ajax
[flavor_submit]
Frontend submission form for users to create new listings.
Parameters: category, fields
[flavor_single]
Display a single listing with all its fields and meta.
Parameters: none (uses current post context)
[flavor_categories]
Render a grid or list of listing categories with counts and icons.
Parameters: layout, columns, hide_empty
[flavor_favorites]
Show the currently logged-in user's favorited listings.
Parameters: per_page
[flavor_dashboard]
User dashboard with listing management, profile, and activity.
Parameters: none

Gutenberg Blocks

APD provides three Gutenberg blocks for the WordPress block editor:

Frontend Submission

Allow users to submit listings from the frontend without accessing the WordPress admin:

  1. Create a new page (e.g., "Submit a Listing").
  2. Add the [flavor_submit] shortcode or the Submission Form block.
  3. In APD → Settings → Submission, configure which fields are available, required, and their order.
  4. Set the moderation mode: Auto-approve publishes immediately; Manual review sets submissions to pending.
  5. Optionally restrict submission to logged-in users or specific roles.

Submitted listings appear in the WordPress admin under APD → Listings where they can be reviewed, edited, or rejected.

Reviews & Favorites

Enable reviews in APD → Settings → Reviews. Users can rate listings on a 1-5 star scale and leave written reviews. Reviews support moderation — set them to auto-approve or require admin approval before display.

Average ratings display automatically on listing cards and single listing pages. Listings can be sorted by rating in the [flavor_listings] shortcode using orderby="rating".

Favorites let logged-in users save listings for later. Add a favorites page with the [flavor_favorites] shortcode. A heart icon on listing cards toggles the favorite state via AJAX.

Email Notifications

APD sends email notifications for key events. Each notification can be enabled/disabled and its template customized in APD → Settings → Emails:

New Listing — Sent to admin when a listing is submitted.
Listing Approved — Sent to the listing author when approved.
Listing Rejected — Sent to the listing author when rejected.
New Review — Sent to the listing author when a review is posted.
Review Reply — Sent to the reviewer when the author replies.
Listing Expiring — Sent to the author before a listing expires.
Listing Expired — Sent to the author when a listing has expired.

REST API

APD registers REST API endpoints under the /wp-json/flavor/v1/ namespace. Authenticate with a WordPress nonce (for logged-in users) or an application password.

GET /wp-json/flavor/v1/listings
POST /wp-json/flavor/v1/listings
PUT /wp-json/flavor/v1/listings/{id}
DELETE /wp-json/flavor/v1/listings/{id}

Example — fetch all published listings:

JavaScript
const response = await fetch( '/wp-json/flavor/v1/listings', {
  headers: {
    'X-WP-Nonce': wpApiSettings.nonce
  }
});
const listings = await response.json();

Template Overrides

Customize the look and feel of APD by overriding its templates in your theme. The plugin uses a template hierarchy similar to WooCommerce:

  1. Locate the template you want to override in wp-content/plugins/flavor/templates/.
  2. Copy it to wp-content/themes/your-theme/flavor/ keeping the same directory structure.
  3. Edit your copy. APD will load your theme's version instead of the plugin default.

Available templates include listing-card.php, single-listing.php, search-form.php, submit-form.php, and category-grid.php.

Hooks Reference

APD provides filters and actions for developers to extend and customize behavior.

flavor_listing_fields
Filter
Modify the array of fields for a listing. Use this to add, remove, or reorder fields programmatically.
PHP
add_filter( 'flavor_listing_fields', function( $fields, $listing_id ) {
    $fields[] = [
        'key'  => 'custom_field',
        'type' => 'text',
        'label' => 'My Custom Field',
    ];
    return $fields;
}, 10, 2 );
flavor_before_submit
Action
Fired before a new listing is saved. Use this to validate custom data or run side effects.
flavor_after_approve
Action
Fired after a listing is approved. Useful for sending external notifications or syncing with third-party services.
flavor_search_query
Filter
Modify the WP_Query arguments used for listing search. Add custom query parameters or meta queries.
PHP
add_filter( 'flavor_search_query', function( $args ) {
    $args['meta_query'][] = [
        'key'   => 'featured',
        'value' => 1,
    ];
    return $args;
});
flavor_listing_statuses
Filter
Add or modify available listing statuses. Register custom statuses with labels and capabilities.
flavor_notification_recipients
Filter
Modify the list of email recipients for any notification type. Add CC recipients or override the default.

APD Modules

APD modules extend the core plugin with specialized listing types. Each module registers via the apd_modules_init hook and requires All Purpose Directory 1.0.0+. Install modules alongside the core plugin and activate them individually.

URL Directory

Build a website or link directory with automatic favicon fetching, scheduled link checking, and click tracking.

Business Directory

Create a local business directory with maps, business hours, and verification.

Classifieds

Add buy/sell/trade classified ad functionality similar to Craigslist or Facebook Marketplace.

Job Board

Build a job board with application tracking, alerts, and company profiles.

Real Estate

List properties for sale or rent with specialized real estate fields.

FAQ

What versions of WordPress and PHP are supported?

All Purpose Directory requires WordPress 6.0+ and PHP 7.4+. We recommend WordPress 6.4+ and PHP 8.1+ for optimal performance.

Does APD work on WordPress Multisite?

Yes. APD is multisite compatible and can be network-activated or activated per site. Each site maintains its own listings, categories, and settings independently.

Will APD slow down my site?

No. APD uses efficient database queries with proper indexing, lazy-loads assets only on pages where they're needed, and supports object caching (Redis, Memcached). The REST API responses are also cached.

Can I create custom field types?

Yes. Register custom field types using the flavor_field_types filter. Each field type needs a render callback, a save callback, and a search callback. See the Hooks Reference section for examples.

Do APD modules require the core plugin?

Yes. All modules require All Purpose Directory 1.0.0+ to be installed and active. Modules register themselves via the apd_modules_init hook and will deactivate gracefully if the core plugin is missing.

Is APD available in other languages?

APD is fully translatable using standard WordPress internationalization (.pot/.po/.mo files). Community translations are managed through WordPress.org's translate platform.