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.
-
Cosa è successo al box a discesa che mi permetteva di cambiare il numero di elementi su ogni pagina nell’area di amministrazione??
-
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 32 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, segui il log delle modifiche tramite RSS.
Changelog
2.7.2 – 2024-08-21
- Changed: Bump WordPress “tested up to” version 6.6 (props @sudip-md, @ankitguptaindia, @jeffpaul via #216, #217).
- Changed: Bump WordPress minimum from 6.3 to 6.4 (props @sudip-md, @ankitguptaindia, @jeffpaul via #216).
- Fixed: Issue where an
Undefined array key
error occurs when a post parent ID does not exist in the$children_pages
array (props @xDehy, @peterwilsoncc via #219). - Security: Bump
express
from 4.18.2 to 4.19.2,follow-redirects
from 1.15.5 to 1.15.6,postcss
from 7.0.39 to 8.4.33,10up-toolkit
from 5.2.3 to 6.1.0 andwebpack-dev-middleware
from 5.3.3 to 5.3.4 (props @dependabot, @faisal-alvi via #208). - Security: Bump
braces
from 3.0.2 to 3.0.3 andws
from 7.5.9 to 7.5.10 (props @dependabot, @iamdharmesh via #214).
2.7.1 – 2024-06-03
- Added: The missing Text Domain (props @alexclassroom, @dkotter via #199).
- Added: The “Testing” section in the
CONTRIBUTING.md
file (props @kmgalanakis, @jeffpaul via #202). - Changed: Bump WordPress “tested up to” version 6.5 (props @jeffpaul, @sudip-md, @dkotter via #201).
- Changed: Bump WordPress minimum from 5.7 to 6.3 (props @jeffpaul, @sudip-md, @dkotter via #201).
- Fixed: Fixed error in call to
get_walked_pages
for custom post types (props @sissibieber, @zachgibb, @peterwilsoncc, @mjot, @jeffpaul via #200).
2.7.0 – 2024-04-03
- Added: Ability to modify the page hierarchy (props @amityweb, @jeffpaul, @peterwilsoncc, @shannonmfisher, @ankitguptaindia, @faisal-alvi via #172).
- Added: Support for the WordPress.org plugin preview (props @dkotter, @jeffpaul via #183).
- Changed: Replaced custom HTML entity decoding code in favor of the
@wordpress/html-entities
package (props @helen, @jeffpaul, @psorensen, @peterwilsoncc via #189). - Changed: Bump minimum
node
version from16
to20
and clean up NPM dependencies (props @Sidsector9, @dkotter via #188). - Changed: Updated CODEOWNERS (props @jeffpaul, @dkotter via #186).
- Changed: Upgrade the download-artifact from v3 to v4 (props @iamdharmesh, @jeffpaul via #194).
- Changed: Replaced lee-dohm/no-response with actions/stale to help with closing no-response/stale issues (props @jeffpaul, @dkotter via @195).
- Changed: Disabled auto sync pull requests with target branch (props @iamdharmesh, @jeffpaul via #196).
- Security: Bump
@babel/traverse
from7.20.12
to7.23.6
(props @dependabot, @ravinderk via #184). - Security: Bump
sharp
from0.30.7
to0.32.1
(props @dependabot, @Sidsector9 via #182). - Security: Bump
10up-toolkit
from4.3.1
to5.2.2
(props @dependabot, @Sidsector9 via #182).
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).