| 开发者 |
10up
jakemgold welcher helen thinkoomph jeffpaul |
|---|---|
| 更新时间 | 2025年5月19日 23:00 |
| 捐献地址: | 去捐款 |
| WordPress版本: | 6.8 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
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' );
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.
See the previous two answers - just add page-attributes to the list of supported post type features.
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).
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.
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.
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 );
Yes. The plugin registers the REST endpoint simple-page-ordering/v1/page_ordering.
tar-fs from 2.1.1 to 3.0.8 (props @dependabot, @peterwilsoncc via #238).@babel/runtime from 7.23.9 to 7.27.0 (props @dependabot, @peterwilsoncc via #237).webpack from 5.90.0 to 5.94.0 (props @dependabot, @faisal-alvi via #224).serve-static from 1.15.0 to 1.16.2 and express from 4.19.2 to 4.21.0 (props @dependabot, @peterwilsoncc via #226).cookie from 0.6.0 to 0.7.1 and express from 4.21.0 to 4.21.1 (props @dependabot, @Sidsector9 via #228).serialize-javascript from 6.0.0 to 6.0.2 and mocha from 10.2.0 to 11.1.0 (props @dependabot, @dkotter via #232).Undefined array key error occurs when a post parent ID does not exist in the $children_pages array (props @xDehy, @peterwilsoncc via #219).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 and webpack-dev-middleware from 5.3.3 to 5.3.4 (props @dependabot, @faisal-alvi via #208).braces from 3.0.2 to 3.0.3 and ws from 7.5.9 to 7.5.10 (props @dependabot, @iamdharmesh via #214).CONTRIBUTING.md file (props @kmgalanakis, @jeffpaul via #202).get_walked_pages for custom post types (props @sissibieber, @zachgibb, @peterwilsoncc, @mjot, @jeffpaul via #200).@wordpress/html-entities package (props @helen, @jeffpaul, @psorensen, @peterwilsoncc via #189).node version from 16 to 20 and clean up NPM dependencies (props @Sidsector9, @dkotter via #188).@babel/traverse from 7.20.12 to 7.23.6 (props @dependabot, @ravinderk via #184).sharp from 0.30.7 to 0.32.1 (props @dependabot, @Sidsector9 via #182).10up-toolkit from 4.3.1 to 5.2.2 (props @dependabot, @Sidsector9 via #182).wp-compat-validation-tool composer package to version 0.3.1 which properly removes the .git directory (props @Sidsector9, @dkotter via #180).10up-lib directory (props @Sidsector9, @dkotter via #175).@babel/traverse from 7.20.12 to 7.23.2 (props @peterwilsoncc via #170).word-wrap from 1.2.3 to 1.2.4 (props @dependabot, @peterwilsoncc via #).tough-cookie from 4.1.2 to 4.1.3 (props @faisal-alvi via #152).node-sass from 7.0.3 to 9.0.0 (props @faisal-alvi via #152).@cypress/request from 2.88.11 to 3.0.0 to resolve SSRF issue (props @faisal-alvi, @iamdharmesh, @peterwilsoncc, @dkotter via #152, #160).cypress from 9.5.2 to 11.2.0 (props @iamdharmesh, @jayedul, @Sidsector9) via #120.http-cache-semantics from 4.1.0 to 4.1.1 (props @peterwilsoncc via #131).webpack from 5.75.0 to 5.76.1 (props @Sidsector9) via #134.Active to Stable (props @jeffpaul, @dkotter via #123).build-zip action (props @iamdharmesh, @faisal-alvi, @dkotter via #119).loader-utils from 2.0.3 to 2.0.4 (props @dependabot via #115).simple-git from 3.12.0 to 3.15.1 (props @dependabot via #121).
View historical changelog details here.