Intuitive Custom Post Order

説明

Intuitively reorder Posts, Pages, Custom Post Types, Taxonomies, and Sites with a simple drag-and-drop interface.

Intuitive Custom Post Order lets you reorder items with simple drag and drop in the WordPress admin.
You can sort Posts, Pages, Custom Post Types, Taxonomies, and (on Multisite) Sites.

Go to Settings Intuitive CPO and select which content types you want to make sortable.
Once enabled, just drag and drop items in the list tables—no extra setup is required.

If you create custom queries in your theme or plugins, set orderby=menu_order and order=ASC to respect the drag-and-drop order.
To keep the default WordPress order (by date), explicitly set orderby=date and order=DESC.

Source code and development are available on GitHub.

スクリーンショット

  • Settings screen (choose sortable post types and taxonomies).
  • Reordering posts with drag and drop.
  • Reordering taxonomy terms.
  • Network settings (for Multisite).
  • Reordering Sites in Network Admin (for Multisite).

インストール

  1. /wp-content/plugins/ ディレクトリに ‘intuitive-custom-post-order’ フォルダーをアップロードします。
  2. 「プラグイン」メニューからプラグインを有効化します。
  3. Go to Settings Intuitive CPO and choose which post types or taxonomies you want to make sortable.
  4. Simply drag and drop items in the list tables to reorder them.

FAQ

Do I need to change my theme to make ordering work?

No. After activation, items are sortable in the admin UI, and front-end queries for enabled post types are ordered by menu_order ASC automatically—unless you explicitly pass your own orderby.

How do I make my custom query respect the drag-and-drop order?

Specify orderby=menu_order and order=ASC in your query args.

WP_Query:

<?php
new WP_Query( array(
    'post_type' => 'your_cpt',
    'orderby'   => 'menu_order',
    'order'     => 'ASC',
) );
?>

get_posts():

<?php
get_posts( array(
    'post_type' => 'your_cpt',
    'orderby'   => 'menu_order',
    'order'     => 'ASC',
) );
?>

I want date order (newest first) for a specific query. How?

Explicitly set:

<?php
new WP_Query( array(
    'orderby' => 'date',
    'order'   => 'DESC',
) );
?>

For get_posts(), the plugin supports a small switch:

<?php
get_posts( array(
    'orderby' => 'default_date',
    'order'   => 'DESC',
) );
?>

Is query_posts() supported?

query_posts() is discouraged by WordPress core because it alters the main query in a fragile way.
Use pre_get_posts (recommended) or WP_Query instead.

Example with pre_get_posts to force date order on the main blog page:

<?php
add_action( 'pre_get_posts', function( $q ) {
    if ( is_admin() || ! $q->is_main_query() ) {
        return;
    }
    if ( is_home() ) {
        $q->set( 'orderby', 'date' );
        $q->set( 'order', 'DESC' );
    }
} );
?>

Does this work with taxonomies and terms?

Yes. For enabled taxonomies, terms can be reordered and are returned in that order on the front end.
When you build custom term queries, make sure you don’t override the order unless you intend to.

Multisite: can I reorder Sites in Network Admin?

Yes. When enabled in Network settings, Sites are ordered by menu_order ASC. Drag & drop in Network Admin updates the order.

How can I move a post from the second page to the top of the first page?

Go to the “Screen Options” tab at the top right of the list table and increase the “Number of items per page”.
This way, all items you want to reorder will appear on the same page and can be dragged to the desired position.

評価

2024年6月24日
これまで長く使ってきたが、WordPress 6.5.4では動かない。感謝して別れを告げるべきか…。
138件のレビューをすべて表示

貢献者と開発者

Intuitive Custom Post Order はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“Intuitive Custom Post Order” は20ロケールに翻訳されています。 翻訳者のみなさん、翻訳へのご協力ありがとうございます。

“Intuitive Custom Post Order” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。

変更履歴

3.2.0

  • Security hardening: unified CSRF/nonces, capability checks, and standardized JSON responses in all AJAX handlers.
  • Network admin: switched to manage_network_options capability and *_site_option APIs for multisite settings.
  • Improved redirect handling: use admin_url() / network_admin_url() and ensure exit; after redirects.
  • Input sanitization: strengthened handling of $_GET, $_POST, and $_SERVER values with strict comparisons.
  • Code refactoring: replaced custom version parsing with get_file_data(), cleaned up pre_get_posts return values.
  • JavaScript: improved sortable behavior with clear success/failure feedback, disabled UI while saving, and accessibility notifications via wp.a11y.speak.
  • UI/UX: added saving indicator (semi-transparent rows + central spinner) during drag & drop reorder operations.
  • WordPress compatibility: tested up to WP 6.4+ and aligned with WordPress Coding Standards (WPCS).

3.1.5.1

  • バグの修正

3.1.4.1

  • fixed hicpo_add_capabilities: add capabilities only when role exists.

3.1.4

  • fixed current security issues. (Thank you @timohubois)
    Arbitrary Menu Order Update via CSRF.
    Subscriber+ Arbitrary Menu Order Update.

3.1.3

  • 重複した注文を修復する機能を追加。

3.1.2.1

  • このプラグインがテストされた WordPress のバージョンを更新。

3.1.2

  • ドラッグ & ドロップのソート中にレイアウトが崩壊するという問題を解決。

3.1.1

  • 廃止された関数 ‘secreen_icon()’ を削除。

3.1.0

  • サイトをサポートする。
  • アクティベーションの改善。

3.0.8

  • ‘get_posts()’ の場合でも、’order’ または ‘orderby’ パラメータを使用するカスタムクエリが推奨されます。
    注意: ‘get_posts()’ を使用してデフォルトの順序に再上書きする場合にのみ (orderby=date, order=DESC)、独自のカスタムパラメータ ‘orderby=default_date’ を使用する必要があります。

3.0.7

  • このプラグインは上記のtranslate.wordpress.org翻訳システムにインポートされます。完全に翻訳されたローカルの言語パックも、このプラグインで有効になります(100%)。

3.0.6

  • Support ‘next_post_link()’ and ‘previous_post_link(), etc.
    • Parameters( $in_same_term, $excluded_terms, $taxonomy ) works perfectly.

3.0.5

  • Fixed bug
    • Initialize of menu_order of pages.( orderby=menu_order, post_title, order=asc )

3.0.4

  • ‘order’ または ‘orderby’ パラメーターを使用するカスタム クエリが推奨されます。
    クエリのパラメータを優先するには、’WP_Query()’ または ‘query_posts()’ を使用する必要があります。
    除外された ‘get_posts()’。
  • Fixed bug
    • Decision of Enabling Sortable JavaScript.
    • ページの menu_order を初期化。( orderby=post_title, order=asc )

3.0.3

  • アクティベーションのパフォーマンス向上。
  • カスタムタクソノミーの初期化を追加します。
  • 更新方法のバグを修正。
  • 注文を上書きし、注文が改善されました。(@newashと@anriettec のおかげ)

3.0.1 & 3.0.2

  • バグの修正

3.0.0

  • カスタムタクソノミー順番をサポート。
    ( wp_list_categories, get_categories, the_terms, the_tags, get_terms, get_the_terms, get_the_term_list, the_category, wp_dropdown_categories, the_taxonomies)
  • 管理 UI で並べ替えを行います。
    並べ替え中に、ドラッグ & ドロップの並べ替え可能な Javascript は実行されません。
  • 非公開オブジェクトをサポート (show_ui = true、show_in_menu = true)
  • 日本語翻訳を追加。

2.1.0

  • バグ修正: ‘order’ または ‘orderby’ パラメータを使用するカスタムクエリが優先されます。
  • 引数の指定方法に依存しません ( パラメータ )。
    ( $args = ‘orderby=&order=’ または $args = array( ‘orderby’ => ”, ‘order’ => ” ) )
  • 2.0.7, 2.0.8, 2.0.9に存在した不具合が改善されました!
  • 2.0.6から2.1.0に更新してください。

2.0.9

  • 管理者のパフォーマンスの向上。
    致命的なパフォーマンスの問題が大幅に改善されました。
  • バグ修正: アタッチメントオブジェクトは壊れていません。
  • バグ修正: マルチサイトの警告表示が解決されました。
  • バグを修正: まず項目を有効にする場合、項目の ‘メニュー順序’ が壊れにくい。
  • ‘order’ または ‘orderby’ パラメータを使用するカスタムクエリが優先されます。

2.0.8

  • 管理者のパフォーマンスの向上。
    リフレッシュ方法 (すべてのメニュー順序を再構成する) は、アクティブなオブジェクトのリストページでのみ実行されます。

2.0.7

  • バグ修正: WordPress 3.8用
  • スウェーデン語の翻訳を追加する(by Thomas)

2.0.6

  • ver.2.0.5を修正。

2.0.5

  • ‘next_post_link()’ と ‘previous_post_link()’ をサポート (シングルからシングル)。

2.0.4

  • バグの修正

2.0.3

  • 直感的なCPO設定ページが[設定]メニューに移動しました。

2.0.2

  • バグの修正

2.0.0

  • ソートする対象を選択します。 (投稿、固定ページ、カスタム投稿)
  • 固定ページと階層型カスタム投稿をサポート。
  • ソート可能なアイテムのステータスは「公開」だけでなく、他のすべてのステータス(「保留」、「下書き」、「非公開」、「予約投稿」)です。
  • ページングでは、それはすべて正常にアクティブ化されています。だから、’screen-per-page’ はユーザーのようなものです。
  • カテゴリ (カテゴリ、タグ、タクソノミー) を並べ替えたリストでは、すべて標準で有効になります。
  • 子投稿と子固定ページをサポートします。アイテムを並べ替えると、そのアイテム間の親アイテムの関係が維持されます。

1.2.1

  • バグを修正しました

1.2.0

  • 視覚的にクリアされた並べ替え可能な UI。(カーソルの変更など)。
  • ソート可能なアイテムは垂直方向にのみドラッグできます。
  • クイック編集メニューが有効になりました。
  • 項目をドラッグするたびに、セルの幅が折りたたまれるわけではありません。

1.1.1

  • バグの修正

1.1.0

  • 1画面あたりのページ数は自動的に ‘999’に設定され、未設定よるトラブルを防ぎます。
  • ‘get_posts’ や ‘query_posts’ などで ‘order’ または ‘orderby’ パラメータを使用するカスタムクエリを除外します。

1.0.0

最初のリリース