Descrizione
Ordina le tue pagine, i tipi di contenuto personalizzati o i tipi di post personalizzati aventi gli attributi di pagina con un semplice “trascina e rilascia” proprio dall’elenco delle pagine di WordPress.
Basta trascinare e rilasciare la pagina nella posizione desiderata. Nient’altro. Non ci sono nuove pagine di menu di amministrazione, goffe e sovrapposte alle interfacce utente. È sufficiente trascinare e rilasciare gli elementi nella schermata delle pagine o dei tipi di contenuto.
Il plugin tiene conto dei permessi: solo gli utenti con i permessi di modificare le pagine degli altri (editori e amministratori) potranno riordinare il contenuto.
L’aiuto in linea è incluso: basta fare clic sulla scheda “Aiuto” posta in alto a destra della schermata.
Nota che il plugin non è compatibile con Internet Explorer 7 e versioni precedenti, a motivo dei limiti di questi browser.
Come contribuire
Saremmo molto lieti se ti unissi a noi nello sviluppo su GitHub.
Installazione
- Installa tramite la directory dei plugin di WordPress.org oppure caricando i file sul tuo server.
- Attiva il plugin dal menu “Plugin” in WordPress.
- Torna all’opera e riordina i tuoi contenuti!
FAQ
-
Perché non posso riordinare i miei articoli?
-
Gli articoli generici non vengono visualizzati per ordine di menu, ma per cronologia. In teoria puoi aggiungere l’ordinamento per menu agli articoli nel tuo codice (functions.php del tema, plugin) utilizzando:
add_post_type_support( 'post', 'page-attributes' );
-
Posso far sì che i miei tipi di contenuto possano sfruttare questo plugin?
-
Yep. When you register the post type, include the
page-attributes
feature in the support list. This will add aSort 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
totrue
– 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. -
Desidero che i miei tipi di contenuto non gerarchici siano ordinabili. Aiuto!
-
Vedi le due precedenti risposte: ti basta aggiungere
page-attributes
all’elenco di funzionalità supportate per il tipo di contenuto. -
Ho riordinato i miei articoli, ma l’ordine non è cambiato nel frontend del mio sito!
-
Questo plugin non cambia alcun comportamento nel frontend: cambia soltanto l’ordine del menu archiviato in WordPress.
Se desideri un elenco di pagine o tipi di contenuto personalizzato da visualizzare in quel preciso ordine, devi cambiare il parametro
orderby
della query dei post inmenu_order
(se non lo è già). -
Ho riordinato il mio contenuto e sembrava funzionare, ma quando ho aggiornato è tornato al vecchio ordine!
-
Ciò probabilmente significa che la richiesta AJAX – il codice eseguito sul server – non è andata a buon fine dopo che hai rilasciato il contenuto nella nuova posizione. Alcuni host condivisi fanno scadere e limitano in modo aggressivo le richieste AJAX. La versione 2.0 raggruppa queste richieste: in tal modo puoi provare a ridurre il numero di elementi da aggiornare ad ogni richiesta utilizzando un filtro nel functions.php del tuo tema o in un plugin personalizzato:
add_filter( 'simple_page_ordering_limit', function($number) { return 5; } );
Dove 5 è il numero di elementi da raggruppare per ogni richiesta (l’opzione predefinita è 50). Nota che questo esempio usa le funzioni di callback di PHP5.3+, quindi se usi ancora PHP 5.2, dovrai utilizzare un callback tradizionale.
-
What happened to the drop down box that let me change the number of items on each page in the admin?
-
Questa funzionalità è già disponibile in WordPress in modo nativo, ma è un po’ nascosta. Se tiri giù la scheda “Impostazioni schermata” posta in alto (nell’elenco degli articoli), c’è un campo dove puoi indicare il numero di elementi da mostrare per pagina. Ho pensato che non fosse giusto farne un duplicato.
-
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
.
Recensioni
Contributi e sviluppo
“Simple Page Ordering” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.
Collaboratori“Simple Page Ordering” è stato tradotto in 29 lingue. Grazie ai traduttori per i loro contributi.
Traduci “Simple Page Ordering” nella tua lingua.
Ti interessa lo sviluppo?
Esplora il Codice segui il Repository SVN iscriviti al Log delle Modifiche. Puoi farlo tramite RSS con un lettore di feed.
Changelog (registro delle modifiche)
2.6.3 – 2023-11-09
- Fix: Deployment issue with version 2.6.2 (props @Sidsector9, @dkotter via #181)
2.6.2 – 2023-11-09
- Changed: Update the
wp-compat-validation-tool
composer package to version0.3.1
which properly removes the.git
directory (props @Sidsector9, @dkotter via #180).
2.6.1 – 2023-11-08
- Changed: Bump WordPress “tested up to” version 6.4 (props @jeffpaul, @qasumitbagthariya, @faisal-alvi via #177).
- Changed: Remove the .git directory from the
10up-lib
directory (props @Sidsector9, @dkotter via #175). - Security: Bumps
@babel/traverse
from7.20.12
to7.23.2
(props @peterwilsoncc via #170).
2.6.0 – 2023-10-25
- Added: A check for minimum required PHP version before loading the plugin (props @vikrampm1, @kmgalanakis, @Sidsector9 via #153).
- Added: Mochawesome reporter added for Cypress test report (props @iamdharmesh, @jayedul, @faisal-alvi via #146).
- Added: Repo Automator GitHub Action (props @iamdharmesh, @jeffpaul via #158).
- Changed: Bump WordPress “tested up to” version 6.3 (props @jeffpaul, @QAharshalkadu).
- Changed: Slightly change how some of our text is translated, passing in the post type (props @dkotter, @ravinderk via #149).
- Changed: Updates the Dependency Review GitHub Action to check for GPL-compatible licenses (props @jeffpaul, @Sidsector9 via #147).
- Changed: Updated 10up Cypress Utilities to 0.2.0 (props @iamdharmesh, @peterwilsoncc via #160).
- Fixed: The “Are you sure…” popup text to be translatable (props @kebbet, @bmarshall511, @dkotter via #148).
- Fixed: Remove code that was no longer needed (props @dkotter, @ravinderk via #149).
- Fixed: Add missing escaping (props @dkotter, @ravinderk via #149).
- Fixed: Fatal error following the introduction of a namespace (props @peterwilsoncc, @iamdharmesh, @dkotter via #162).
- Fixed: Hidden pagination in admin screen when Sort by Order is clicked (props @tlovett1, @dkotter, @Sidsector9 via #165).
- Fixed: Fatal errors on PHP 5.6 (props @peterwilsoncc, @Sidsector9, @iamdharmesh via #166).
- Security: Bump
word-wrap
from 1.2.3 to 1.2.4 (props @dependabot, @peterwilsoncc via #). - Security: Bump
tough-cookie
from 4.1.2 to 4.1.3 (props @faisal-alvi via #152). - Security: Bump
node-sass
from 7.0.3 to 9.0.0 (props @faisal-alvi via #152). - Security: Bump
@cypress/request
from 2.88.11 to 3.0.0 to resolve SSRF issue (props @faisal-alvi, @iamdharmesh, @peterwilsoncc, @dkotter via #152, #160).
2.5.1 – 2023-05-16
- Security: Ensure we check user permissions properly in our REST endpoint (props @mikhail-net, @dkotter, @peterwilsoncc).
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.
- Added: Feature to reset page order (props @pattonwebz, @ruscoe, @Sidsector9, @dkotter) via #129.
- Added JS linting GitHub Action (props @Sidsector9, @kmgalanakis, @peterwilsoncc) via #136.
- Changed: Bump minimum PHP version to 7.4 (props @vikrampm1, @Sidsector9, @ravinderk, @cadic) via #111.
- Changed: Bump minimum required WordPress version from 3.8 to 5.7 (props @vikrampm1, @Sidsector9, @ravinderk, @cadic) via #111.
- Changed: Bump WordPress “tested up to” version 6.2 (props @av3nger via #138).
- Changed: Run E2E tests on the zip generated by “Build release zip” action (props @iamdharmesh, @jayedul, @dkotter) via #135.
- Fixed: Removed a typo in a REST response message (props @ruscoe, @Sidsector9) via #133.
- Security: Removed vulnerable NPM dependencies (props @vikrampm1, @Sidsector9, @ravinderk, @cadic) via #111.
- Security: Bump
cypress
from9.5.2
to11.2.0
(props @iamdharmesh, @jayedul, @Sidsector9) via #120. - Security: Bump
http-cache-semantics
from 4.1.0 to 4.1.1 (props @peterwilsoncc via #131). - Security: Bump
webpack
from5.75.0
to5.76.1
(props @Sidsector9) via #134.
2.4.4 – 2023-01-10
- Changed: Update Support Level from
Active
toStable
(props @jeffpaul, @dkotter via #123). - Changed: Bump WordPress “tested up to” version to 6.1 (props @jayedul, @dkotter via #118).
- Changed: Update the “Build release zip” workflow to use 10up’s
build-zip
action (props @iamdharmesh, @faisal-alvi, @dkotter via #119). - Security: Bump
loader-utils
from 2.0.3 to 2.0.4 (props @dependabot via #115). - Security: Bump
simple-git
from 3.12.0 to 3.15.1 (props @dependabot via #121).
2.4.3 – 2022-11-08
- Changed: Allow hierarchical post types that don’t have
page-attributes
set to be sorted properly (props @dkotter, @peterwilsoncc via #108). - Security: Bump
got
from 10.7.0 to 11.8.5 (props @dependabot via #106). - Security: Bump
@wordpress/env
from 4.9.0 to 5.3.0 (props @dependabot via #106). - Security: Bump
scss-tokenizer
from 0.3.0 to 0.4.3 (props @dependabot via #107). - Security: Bump
node-sass
from 7.0.1 to 7.0.3 (props @dependabot via #107).
2.4.2 – 2022-09-28
- Changed: Replaced our Grunt build process with
10up-toolkit
(props @cadic, @peterwilsoncc, @dinhtungdu via #97). - Fixed: Disable reordering for CPTs that don’t support
page-attributes
(props @dhanendran, @dinhtungdu, @peterwilsoncc via #103).
2.4.1 – 2022-06-21
- Added: Missing text domain to strings (props @kebbet, @dkotter, @jeffpaul via #92).
- Fixed: Condition in REST page sorting logic in
rest_page_ordering
method (props @szepeviktor, @iamdharmesh via #94). - Fixed: PHP Coding standards (props @szepeviktor, @dinhtungdu via #93).
- Changed: Bump WordPress “tested up to” version to 6.0 (props @peterwilsoncc, @vikrampm1, @Sidsector9, @jeffpaul via #95, #98).
- Security: Bump
grunt
from 1.5.2 to 1.5.3 (props @dependabot via #99).
2.4.0 – 2022-04-28
- Added: REST API for reordering posts:
/wp-json/simplepageordering/v1/
(props @rmccue, @ciprianimike, @cadic, @lkraav, @dinhtungdu). - Added: REST Endpoint Documentation.
- Added: Documentation to exclude post types (props @dzulfriday @dinhtungdu, @jeffpaul).
- Added: PHP8 compatibility testing GitHub Action (props @nomnom99, @dharm1025).
- Added: Cypress E2E tests (props @dinhtungdu, @dharm1025, @faisal03).
- Added: Dependency security scanning GitHub Action (props @jeffpaul, @nomnom99).
- Changed:
PLUGIN_VERSION
toSIMPLE_PAGE_ORDERING_VERSION
(props @dinhtungdu, @dkotter). - Changed: Bump WordPress “tested up to” version to 5.9 (props @ankitguptaindia, @phpbits, @sudip-10up).
- Security: Bump rmccue/requests from 1.7.0 to 1.8.0 (props @dependabot).
- Security: Bump async from 2.6.3 to 2.6.4 (props @dependabot).
2.3.4 – 2020-04-07
- Changed: Avoid failed reordering introduced in v2.3.3 when handling a large number of non-hierarchical items (props @dinhtungdu).
- Changed: Bump WordPress version support to 5.4 (props @tmoorewp).
- Fixed: Ensure titles of reordered items appear in a human-readable way (props @dinhtungdu).
2.3.3 – 2020-03-04
- Added: Nonce verify for AJAX requests (props @williampatton, @dtbaker).
- Changed: Disable Post Revisions now using the correct action of
post_updated
(props @blue-liquid-designs). - Changed: Bump WordPress version “tested up to” 5.3 (props @adamsilverstein, @dinhtungdu).
- Changed: Documentation updates (props @jeffpaul).
- Fixed: Mismatched localized data variable name (props @dinhtungdu).
- Fixed: VIP Go coding standards (props @mrasharirfan, @dinhtungdu, @pereirinha, @brentvr).
2.3.2 – 2018-05-08
- Added: Allow cancellation of drag operation by pressing escape key.
- Fixed: Allow form input elements added to a row by plugins to be interacted with.
2.3.1 – 2018-04-13
- Fixed: Prevent rows with hidden columns from jumping around while dragging.
2.3.0 – 2018-03-05
- Added: Use WordPress core’s spinner class.
- Added: Grunt-based build process with Sass.
- Changed: Use
WP_Query
instead ofget_posts()
for better performance. - Changed: Remove bundled translations in favor of WordPress.org language packs.
- Fixed: Avoid exceeding PHP’s max input variables, which could cause incorrectly assigned page order.
- Fixed: Malformed URL that would take you to posts instead of pages.
- Fixed: PHPDoc and coding standards to align with 10up’s Engineering Best Practices.
2.2.4 – 2015-02-08
- Fixed: Redundant URL encoding when sorting in admin page list.
2.2.3 – 2014-09-27
- Fixed: Ordering in WordPress 4.0 following core changes to
ORDER BY
inWP_Query
.
2.2.2 – 2014-08-19
- Added: German localization (props @glueckpress).
- Fixed: Column widths no longer change when dragging a row (partial props @griffinjt).
- Security: Closed obscure XSS vulnerability related to Sort by Order link (props @simon-waters).
2.2.1 – 2014-05-31
- Added: Brazilian translation (props @felds).
- Fixed: Bring back translations / text domain (yikes!).
2.2.0 – 2014-04-06
- Changed: Look and feel to better match WordPress 3.8 admin redesign.
- Changed: Improved awareness of and compatibility with Quick Edit (inline editor).
- Fixed: Prevent collisions with themes and plugins bundling Simple Page Ordering.
2.1.2 – 2013-05-30
- Fixed: Hierarchical custom post types without page-attributes was still broken – doh!
- Fixed: Extreme edge case where post columns did not include the post title now supported.
2.1.1 – 2013-05-27
- Fixed: custom post types with page-attributes or hierarchical properties, but not both, breaking ordering.
2.1.0 – 2013-05-19
- Added: Awareness of custom user capabilities for post types, in addition to a filter (
simple_page_ordering_edit_rights
) for overriding reordering rights (previously usededit_others_pages
globally). - Added: Awareness of custom post statuses (so they are not skipped during backend ordering operation).
- Changed: UI refinements: Better “spinner” positioning (and HiDPI), translucent row when moving, improved appearance of “drop” placeholder, wait till row dragged by at least 5px to start sorting.
- Changed: Major JavaScript refactoring and simplification (combined with new stylesheet) for better performance.
2.0.0 – 2012-11-12
- Added: Drag pages into any part of the page hierarchy! No longer limited to same branch of tree!
- Added: Big performance improvements under the hood: leaner queries, batched requests, less processing.
- Added: New filters and hooks to extend / override default functionality.
- Changed: Scales much more reliably in situations with very high page counts due to batching of requests.
- Changed: Order of the first page is now set to “1” instead of “0”, so pages added after ordering are added at the top (instead of second).
- Changed: Removed “number of pages” drop down, which is repetitive of a field accessible under Screen Options.
- Changed: Improved compatibility with newer versions of WordPress.
1.0.0 – 2011-07-04
- Added: Support for ordering non-hierarchical post types that have “page-attributes” support.
- Added: New filter link for “Sort by Order” to restore (hierarchical) or set (non-hierarchical, page attributes support) post list sort to menu order.
- Changed: Users are now forced to wait for current sort operation to finish before they can sort another item.
- Changed: Smarter about “not sortable” view states.
- Changed: Localization ready! Rough Spanish translation included.
- Changed: Assorted other performance and code improvements.
- Fixed: Unexpected page ordering results when pages have not been explictly ordered yet (sorts by menu_order, then title, not just menu_order).
- Fixed: “Per page” drop down filter selection not saving between page loads (was broken in 3.1).
- Fixed: Items are always ordered with positive integers (potential negative sort orders had some performance benefits in last version, but sometimes caused issues).
0.9.6 – 2011-04-04
- Fixed: for broken inline editing (quick edit) fields in Firefox.
0.9.5 – 2011-03-27
- Changed: Smarter awareness of “sorted” modes in WordPress 3.1 (can only use when sorted by menu order).
- Changed: Smarter awareness of “quick edit” mode (can’t drag).
- Changed: Generally simplified / better organized code.
0.9.0 – 2010-12-29
- Added: Further directions in the plug-in description (some users were confused about how to use it).
- Added: Basic compatibility with 3.1 RC (prevent clashes with post list sorting).
- Changed: “Move” cursor only set if JavaScript enabled.
- Fixed: Page count display always showing “0” on non-hierarchical post types (Showing 1-X of X).
- Fixed: Hidden menu order not updating after sort (causing Quick Edit to reset order when used right after sorting).
0.8.4 – 2010-08-24
- Changed: Loosened constraints on drag and drop to ease dropping into top and bottom position.
- Changed: Improved some terminology (with custom post types in mind).
- Fixed: Row background staying “white” after dropping into a new position.
- Fixed: Double border on the bottom of the row while dragging.
0.8.2 – 2010-08-21
- Changed: Simplified code – consolidated hooks.
- Changed: Updated version requirements.