mmirus / display-posts-meta-compare
Add a meta_compare argument to the Display Posts shortcode
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:wordpress-plugin
Requires
- php: >=7.1.0
- composer/installers: ^1.6
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-26 08:31:50 UTC
README
Add a meta_compare argument to the Display Posts shortcode.
You must have the Display Posts plugin installed. Docs for the plugin can be found at https://displayposts.com/.
[display-posts meta_key="my_custom_field" meta_compare="!=" meta_value="a value"]
Possible values for meta_compare
are the ones available in a WP_Query
: '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'EXISTS', 'NOT EXISTS', 'REGEXP', 'NOT REGEXP', and 'RLIKE'.
I haven't tested many different types of comparison, however, and it's likely that some won't work. Feel free to submit a PR or create an issue if you run into problems.
Installation
There are three options for installing this plugin:
- With composer from Packagist:
composer require mmirus/display-posts-meta-compare
- With GitHub Updater
- By downloading the latest release ZIP from this repository and installing it like any normal WordPress plugin
Contributing
To work on this project (for yourself or to contribute a PR):
- Clone this repo
- Run
composer install
And you should be good to go.
Pre-commit linting is enforced (PSR-2 for PHP).