8 Commits

Author SHA1 Message Date
Cooper Dalrymple a77413f556 Push to version 1.1.2 2026-05-27 12:45:19 -05:00
ogrecooper e140229f27 Merge pull request 'Fix minor deprecation when filter is disabled' (#6) from query-loop into main
Reviewed-on: #6
2026-05-27 17:43:35 +00:00
Cooper Dalrymple f222062180 Remove $accepted_args argument on remove_filter and remove_action 2026-05-27 12:33:51 -05:00
ogrecooper 735a4c3038 Merge pull request 'Improve query args modification with term relationship' (#4) from query-block into main
Reviewed-on: #4
2026-03-03 23:17:26 +00:00
Cooper Dalrymple 37572b5a8a Improve identification of tax query term 2026-03-03 17:16:00 -06:00
Cooper Dalrymple 681e2ed152 Prevent modifying query if term not found 2026-03-03 17:11:33 -06:00
Cooper Dalrymple 79fff56a25 Remove SFTP 2026-03-03 17:00:58 -06:00
Cooper Dalrymple 06485c47b2 Fix package root 2026-03-03 14:28:34 -06:00
9 changed files with 58 additions and 49 deletions
+1 -1
View File
@@ -26,4 +26,4 @@ jobs:
uses: akkuman/gitea-release-action@v1
with:
files: |-
*.zip
dist/*.zip
+1
View File
@@ -2,3 +2,4 @@ vendor
lib
node_modules
*.zip
dist
-25
View File
@@ -1,25 +0,0 @@
{
"name": "acornfinehomes.com",
"host": "og6.cleverogre.com",
"protocol": "sftp",
"port": 22,
"username": "acornfinehomes",
"password": "kwSSrK7nkV3J54nV2E7XcjHH",
"privateKeyPath": "~/.ssh/id_rsa",
"remotePath": "/home/acornfinehomes/htdocs/acornfinehomes.com/wp-content/plugins/ogre-sort/",
"uploadOnSave": true,
"useTempFile": false,
"openSsh": false,
"ignore": [
".vscode",
".git",
".DS_Store",
".gitignore",
"composer.json",
"composer.lock",
"gulpfile.js",
"Makefile",
"package-lock.json",
"package.json"
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "cleverogre/ogre-sort",
"version": "1.1.1",
"version": "1.1.2",
"title": "Ogre Sort",
"description": "WordPress plugin which enables drag-and-drop sorting within the admin area for posts, terms, and posts within terms.",
"author": "CleverOgre",
+36 -8
View File
@@ -1,19 +1,37 @@
const gulp = require('gulp'),
const fs = require('fs'),
gulp = require('gulp'),
clean = require('gulp-clean'),
path = require('path'),
zip = require('gulp-zip').default;
const NAME = path.basename(__dirname);
const PACKAGE = require('./package.json');
const NAME = PACKAGE.name.split('/').pop();
// Clean Tasks
gulp.task('clean-package', () => {
return gulp.src(`${NAME}.zip`, {
gulp.task('clean-package-files', (done) => {
if (!fs.existsSync('./dist')) return done();
return gulp.src(`./dist/${NAME}`, {
read: false,
allowEmpty: true,
}).pipe(clean());
});
gulp.task('clean-package-zip', (done) => {
if (!fs.existsSync('./dist')) return done();
return gulp.src('./dist/*.zip', {
read: false,
allowEmpty: true,
}).pipe(clean());
});
gulp.task(
'clean-package',
gulp.series(
'clean-package-files',
'clean-package-zip'
)
);
gulp.task(
'clean',
gulp.series(
@@ -23,7 +41,7 @@ gulp.task(
// Package Tasks
gulp.task('package-compress', () => {
gulp.task('package-copy', () => {
return gulp.src([
'assets/**/*',
'inc/**/*',
@@ -35,16 +53,26 @@ gulp.task('package-compress', () => {
], {
base: './',
encoding: false,
})
.pipe(gulp.dest(`./dist/${NAME}`));
});
gulp.task('package-compress', () => {
return gulp.src(`./dist/${NAME}/**/*`, {
base: './dist',
encoding: false,
})
.pipe(zip(`${NAME}.zip`))
.pipe(gulp.dest('./'));
.pipe(gulp.dest('./dist'));
});
gulp.task(
'package',
gulp.series(
'clean',
'package-compress'
'package-copy',
'package-compress',
'clean-package-files'
)
);
+11 -10
View File
@@ -4,7 +4,7 @@
* @author cleverogre
* @copyright 2025 CleverOgre
* @license GLP-3.0-or-later
* @version 1.1.0
* @version 1.1.2
* @since 1.0.0
*/
@@ -116,18 +116,18 @@ final class Sort {
if (empty($this->relationships)) return;
// Post Types
remove_action('pre_get_posts', [$this, 'pre_get_posts'], 10, 1);
remove_action('pre_get_posts', [$this, 'pre_get_posts'], 10);
remove_filter('get_previous_post_where', [$this, 'previous_post_where']);
remove_filter('get_previous_post_sort', [$this, 'previous_post_sort']);
remove_filter('get_next_post_where', [$this, 'next_post_where']);
remove_filter('get_next_post_sort', [$this, 'next_post_sort']);
// Taxonomy
remove_filter('terms_clauses', [$this, 'terms_clauses'], 10, 3);
remove_filter('get_terms_orderby', [$this, 'get_terms_orderby'], 10, 3);
remove_filter('wp_get_object_terms', [$this, 'wp_get_object_terms'], 10, 4);
remove_filter('get_terms', [$this, 'get_terms'], 10, 4);
remove_action('create_term', [$this, 'add_term_relationship'], 10, 3);
remove_filter('terms_clauses', [$this, 'terms_clauses'], 10);
remove_filter('get_terms_orderby', [$this, 'get_terms_orderby'], 10);
remove_filter('wp_get_object_terms', [$this, 'wp_get_object_terms'], 10);
remove_filter('get_terms', [$this, 'get_terms'], 10);
remove_action('create_term', [$this, 'add_term_relationship'], 10);
}
public function current_screen() {
@@ -300,17 +300,18 @@ final class Sort {
foreach ($wp_query->query['tax_query'] as $tax) {
if (!isset($tax['taxonomy'])) continue;
if ($current_relationship['taxonomy'] != $tax['taxonomy']) continue;
$term_by = $tax['field'];
$term_by = $tax['field'] ?? 'term_id';
$term_id = $tax['terms'];
break;
}
} else if ($current_relationship['taxonomy'] === 'category' && isset($wp_query->query['category_name'])) {
$term_id = $wp_query->query['category_name'];
}
if (empty($term_id)) break;
if (is_array($term_id)) $term_id = array_values($term_id)[0];
if (empty($term_id)) return;
$term = get_term_by($term_by, $term_id, $current_relationship['taxonomy']);
if (!is_a($term, 'WP_Term')) break;
if (!is_a($term, 'WP_Term')) return;
$wp_query->set('meta_key', "ogre-sort_{$current_relationship['taxonomy']}_{$term->term_id}");
$wp_query->set('orderby', 'meta_value_num');
+2 -2
View File
@@ -6,14 +6,14 @@
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 1.1.1
* @version 1.1.2
* @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: Ogre Sort
* Plugin URI: https://plugins.cleverogre.com/plugin/ogre-sort/
* Description: WordPress plugin which enables drag-and-drop sorting within the admin area for posts, terms, and posts within terms.
* Version: 1.1.1
* Version: 1.1.2
* Requires at least: 5.0
* Requires PHP: 8.0
* Author: CleverOgre
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://www.schemastore.org/package.json",
"name": "cleverogre/ogre-sort",
"version": "1.1.1",
"version": "1.1.2",
"title": "Ogre Sort",
"description": "WordPress plugin which enables drag-and-drop sorting within the admin area for posts, terms, and posts within terms.",
"author": "CleverOgre",
+5 -1
View File
@@ -3,7 +3,7 @@ Contributors: ogrecooper, cleverogre
Tested up to: 6.8
Requires at least: 5.0
Requires PHP: 8.0
Version: 1.1.1
Version: 1.1.2
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Copyright: CleverOgre
@@ -28,6 +28,10 @@ If you don't know what plugin you have downloaded, please contact [CleverOgre](t
== Changelog ==
= 1.1.2 - 2026-05-27 =
* Fix minor deprecation warning when disabled
* Improve query args modification with term relationships
= 1.1.1 - 2026-02-03 =
* Add name slugs to admin UI
* Fix undefined array key notice