WP Manifestindependent plugin directory
manifest / content / wordpress-custom-directory

WordPress Custom Directory

Wordpress plugin to create custom directories or lists of items fairly easy

by Mario Yepes · github.com/marioy47/wordpress-custom-directory · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/marioy47/wordpress-custom-directory/archive/refs/heads/master.zip

Wordpress Custom Directory Plugin

WordPress directory to create a list of "things" in WordPress.

A list of things can be

  • A list of people
  • A list of machine parts
  • A list of products (Although WooCommerce is better for that use case)
  • A list of documents

How it works

The plugin creates 1 custom type, 1 taxonomy and 2 shortcodes.

The custom post type, that by default is called Directory Item, allows you to enter information of each element. Since its a WordPress Post Type you can use the Advanced Custom Field (ACF) plugin to add attributes to each item.

The Custom Taxonomy allows you to group items in different directories. This way you can create multiple list in one site.

The 2 main shortcodes allows you to display the list on any page and to add a Live Search Form to filter the directory.

Help

You can refer to the Online Help inside the plugin by accesing the path Custom Directory > Help

Development

You need to have installed node with npm, php as a command-line app and composer globally.

cd /path/to/wordpress/wp-content/plugins/
git clone git@bitbucket.org:dazzet/wordpress-custom-directory.git
cd wordpress-custom-directory
composer install
npm install
composer phpcs
npm start # Optional

The last command is required if you are going to change the js files. Otherwise you don't need the watch activated.

NPM commands

  • npm run build: Cleans the environment, reinstalls composer packages, rebuilds the .pot translations template file and compiles the .js files
  • npm run lint and npm run lint:fix: Finds and fixes lint errors on .js files
  • npm start o npm run watch: Starts a development environment:
    • Install development dependencies (development composer packages)
    • Watches for changes in src/js files and compiles them in real time
  • npm run zip: Creates an instllable wordpress .zip plugin file

Take into account that the project uses husky to find and fix lint errors before commiting any code.

Script to deploy on a remote server

#!/bin/bash

REMOTE_USER=username
REMOTE_HOST=example.com
REMOTE_CONN=${REMOTE_USER}@${REMOTE_HOST} # Or a connection in your .ssh/hosts
REMOTE_PATH=/path/to/wordrpess/wp-content/plugins/`basename $PWD` # NO TRAILING SLASH

echo "Uploading to ${REMOTE_CONN}:${REMOTE_PATH}/"
sleep 2

npm run build

rsync -avz -e ssh --delete ./{classes,help,js,languages,vendor,*.php} ${REMOTE_CONN}:${REMOTE_PATH}/

composer install
composer dump-autoload -o