Simple Page Ordering

Описание

Упорядочивайте страницы, иерархически произвольный типы записи или пользовательский тип записи с «атрибутами страницы», с помощью простого перетаскивания прямо из встроенного списка страниц.

Просто перетащите страницу в нужное место. Это так просто. Никаких новых страниц меню администратора, никаких громоздких, прикрученных пользовательских интерфейсов. Просто перетащите страницу или запись на экран.

Плагин «учитывает возможности» — только пользователи, имеющие возможность редактировать чужие страницы (редакторы и администраторы), смогут изменять порядок содержимого.

Встроенная помощь прилагается: нужно щёлкнуть на вкладку «помощь» в правом верхнем углу экрана.

Обратите внимание, что плагин не совместим с Internet Explorer 7 и более ранними версиями из-за ограничений в этих браузерах.

Вклад в развитие

Мы будем рады, если вы присоединитесь к разработке на сайте GitHub.

Скриншоты

  • Dragging the page to its new position
  • Processing indicator

Установка

  1. Install either via the WordPress.org plugin directory, or by uploading the files to your server.
  2. Активируйте плагин на странице «Плагины» в панели управления WordPress.
  3. Get to work reordering your content!

Часто задаваемые вопросы

Why can’t I reorder my posts?

Generic posts are not displayed by menu order — they’re displayed by chronology. You can theoretically add menu ordering to posts in your code (theme functions.php, plug-in) by using:

add_post_type_support( 'post', 'page-attributes' );

Can I make my custom post type take advantage of this plug-in?

Yep. When you register the post type, include the page-attributes feature in the support list. This will add a Sort by Order option to the filter links above the drop downs. Once you sort by order, you can drag and drop the content.

'supports' => array( 'title', 'editor', 'page-attributes' ),

Alternatively, when you register the post type, set hierarchical to true — hierarchical post types natively order by menu order.

You can also take advantage of the simple_page_ordering_is_sortable filter, which passes the result of the default check and the post type name, to override default behavior.

I want my non-hierarchical post type to be sortable. Help!

See the previous two answers — just add page-attributes to the list of supported post type features.

I reordered my posts, but the order didn’t change on the front end of my site!

This plug-in doesn’t change any behavior on the front end, it simply changes the menu order stored in WordPress.

If you want a list of pages or custom post types to display in that defined order, you must change the post query’s orderby parameter to menu_order (if it’s not already).

I reordered my content, it seemed to work, but when I refreshed, it went back to the old order!

This most likely means the AJAX request — the server side code — failed after you dropped the content into the new position. Some shared hosts aggressively time out and limit AJAX requests. Version 2.0 batches these requests so you can try reducing the number of items it updates on each request using a filter in your theme’s functions.php or a custom plug-in:

add_filter( 'simple_page_ordering_limit', function($number) { return 5; } );

Where 5 is the number of items to batch on each request (the default is 50). Note that this example uses PHP 5.3+ callback functions, so if you’re still on PHP 5.2, you’ll need to add a traditional callback.

What happened to the drop down box that let me change the number of items on each page in the admin?

This feature is already built into WordPress natively, but a bit tucked away. If you pull down the «Screen Options» tab up top (on the list of post objects) there’s a field where you can specify the number of items to show per page. I decided it was not a very good practice to duplicate this.

How can I modify sortable post types?

Post types can be included or excluded by using the simple_page_ordering_is_sortable filter.

For example, to exclude the excluded_post_type custom post type, add the following snippet in the theme function file or custom plugin:

add_filter( 'simple_page_ordering_is_sortable', function( $sortable, $post_type ) {
    if ( 'excluded_post_type' === $post_type ) {
        return false;
    }
    return $sortable;
}, 10, 2 );

To include the include_post_type custom post type, add the following snippet in the theme function file or custom plugin:

add_filter( 'simple_page_ordering_is_sortable', function( $sortable, $post_type ) {
    if ( 'include_post_type' === $post_type ) {
        return true;
    }
    return $sortable;
}, 10, 2 );

Can I use REST to order posts?

Yes. The plugin registers the REST endpoint simple-page-ordering/v1/page_ordering.

Отзывы

15.08.2024 3 ответа
Hi,if I use Admin Columns Pro plugin, than Simple Page Ordering for custom post don´t work, I can´t drag and drop. If I disbale Admin Columns Pro plugin, than I can drag and drop correctly. Drag and drop stop working after upgrade Admin Columns plugin to to 6.4.10. Before upgrade Simple Page Ordering works ok. I use Simple Page Ordering for custom post type created by ACF. Here is link for free version Admin Columns plugin:
20.06.2024 2 ответа
Cool plugin in itself. Now if only the page attributes would be updated when reordering…..oh wait! I see that they do! Incredible, so you can output them with a query as intended and give the customer a better experience again. Thank you very much. I registered only for this review. Thank you !
13.12.2023 1 ответ
We’d struggled for a while implementing custom sort functionality for a long complex list for a client selling cameras … until we found this plugin. All the issues we were having with a competitor’s premium plugin were solved by switching to this plugin. The main thing was that we were able to manually sort on a custom post type whilst using custom filters. Works like a dream.
11.10.2023 2 ответа
Super nice to be able to order pages in what is almost a grouping. Also works for Elementor Landing Pages [LP] CPT. Thanks for this free plugin and your time maintaining it. Please consider adding this functionality to Elementor template library and other CPT. And enabling the page order tab to be the default view to save time and not need to click and wait for it to load when I open the LP post type
Посмотреть все 132 отзыва

Участники и разработчики

«Simple Page Ordering» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

«Simple Page Ordering» переведён на 32 языка. Благодарим переводчиков за их работу.

Перевести «Simple Page Ordering» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений

2.7.2 — 2024-08-21

2.7.1 — 2024-06-03

2.7.0 — 2024-04-03

2.6.3 — 2023-11-09

2.6.2 — 2023-11-09

  • Changed: Update the wp-compat-validation-tool composer package to version 0.3.1 which properly removes the .git directory (props @Sidsector9, @dkotter via #180).

2.6.1 — 2023-11-08

2.6.0 — 2023-10-25

2.5.1 — 2023-05-16

2.5.0 — 2023-04-18

Note that this release bumps the minimum required versions of PHP from 5.6 to 7.4 and WordPress from 3.8 to 5.7.

2.4.4 — 2023-01-10

View historical changelog details here.