Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/agencecinq/cinq-wp-admin-filter-by-year/archive/refs/heads/main.zipWordPress plugin that adds a year drop-down filter to the admin list screens of custom post types. No settings screen.
Repository: agencecinq/cinq-wp-admin-filter-by-year
Requirements
- WordPress 6.0+
- PHP 8.1+
Lint (WordPress Coding Standards)
composer install
composer lint # phpcs
composer lint:fix # phpcbf (auto-fix)
Use ./vendor/bin/phpcs, not the global phpcs binary — the global install does not register the WordPress standards.
Install
Copy the folder to wp-content/plugins/cinq-wp-admin-filter-by-year and activate CINQ Admin Filter By Year in the WordPress admin, or with WP-CLI:
wp plugin activate cinq-wp-admin-filter-by-year
To load it on every request without activation, copy the plugin file into mu-plugins. It is then listed under Plugins → Must-Use.
cp cinq-wp-admin-filter-by-year.php /path/to/wp-content/mu-plugins/
Behaviour
The drop-down sits next to the core filters, above the list table. It submits the public year query var, so WordPress filters the list itself: edit.php?post_type=project&year=2024.
It only lists years that have posts in the current view: the current status (All, Draft, Trash…) and taxonomy filters are taken into account.
Optional filter
// Post types that get the year filter (default: every non built-in post type).
add_filter( 'cinq_admin_filter_by_year_post_types', fn () => array( 'project', 'post' ) );
Migration from wp-admin-filter-by-year
- Deactivate and delete
wp-admin-filter-by-year, then install and activatecinq-wp-admin-filter-by-year. - The URL parameter is now
yearinstead ofy. Update bookmarks or links such asedit.php?post_type=project&y=2024. - The functions are renamed and the parse query function is gone. Replace any call or
remove_action()/remove_filter()that targetswp_admin_filter_by_year_*withcinq_admin_filter_by_year_dropdown. - The select no longer has the
filter-by-yearclass. Target#filter-by-yearinstead. - Query parameters that are not fields of the filter form (for example a taxonomy term opened from a column link) are no longer kept when filtering by year, as with the core date filter.
Scope
- Post types: every non built-in post type by default, more or fewer through
cinq_admin_filter_by_year_post_types - No options, no admin UI, no front-end output
License
MIT © CINQ
Releases
1 release.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.