Simple Page Ordering - Version 2.1.1

Version Description

  • Bug fix: custom post types with page-attributes or hierarchical properties, but not both, breaking ordering
Download this release

Release Info

Developer jakemgold
Plugin Icon 128x128 Simple Page Ordering
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1 to 2.1.1

readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://10up.com/plugins/simple-page-ordering-wordpress/
4
Tags: order, re-order, ordering, pages, page, manage, menu_order, hierarchical, ajax, drag-and-drop, admin
5
Requires at least: 3.4
6
Tested up to: 3.6
7
- Stable tag: 2.1
8
9
Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
10
@@ -75,7 +75,10 @@ This feature is already built into WordPress natively, but a bit tucked away. If
75
1. Processing indicator
76
77
78
- == Changelog ==
79
80
= 2.1 =
81
* 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
4
Tags: order, re-order, ordering, pages, page, manage, menu_order, hierarchical, ajax, drag-and-drop, admin
5
Requires at least: 3.4
6
Tested up to: 3.6
7
+ Stable tag: 2.1.1
8
9
Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
10
75
1. Processing indicator
76
77
78
+ == Changelog ==
79
+
80
+ = 2.1.1 =
81
+ * Bug fix: custom post types with page-attributes or hierarchical properties, but not both, breaking ordering
82
83
= 2.1 =
84
* 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
simple-page-ordering.dev.js CHANGED
@@ -14,8 +14,14 @@ function update_simple_ordering_callback(response) {
14
var inline_key = document.getElementById('inline_' + key);
15
if ( null !== inline_key && new_pos.hasOwnProperty(key) ) {
16
if ( undefined !== new_pos[key]['menu_order'] ) {
17
- inline_key.querySelector('.menu_order').innerHTML = new_pos[key]['menu_order'];
18
- inline_key.querySelector('.post_parent').innerHTML = new_pos[key]['post_parent'];
19
var post_title = inline_key.querySelector('.post_title').innerHTML;
20
21
var dashes = 0;
14
var inline_key = document.getElementById('inline_' + key);
15
if ( null !== inline_key && new_pos.hasOwnProperty(key) ) {
16
if ( undefined !== new_pos[key]['menu_order'] ) {
17
+ var dom_menu_order = inline_key.querySelector('.menu_order');
18
+ if ( null !== dom_menu_order )
19
+ dom_menu_order.innerHTML = new_pos[key]['menu_order'];
20
+
21
+ var dom_post_parent = inline_key.querySelector('.post_parent');
22
+ if ( null !== dom_post_parent )
23
+ dom_post_parent.innerHTML = new_pos[key]['post_parent'];
24
+
25
var post_title = inline_key.querySelector('.post_title').innerHTML;
26
27
var dashes = 0;
simple-page-ordering.js CHANGED
@@ -1 +1 @@
1
- function update_simple_ordering_callback(e){if("children"===e){window.location.reload();return}var t=jQuery.parseJSON(e);var n=t.new_pos;for(var r in n){if("next"===r)continue;var i=document.getElementById("inline_"+r);if(null!==i&&n.hasOwnProperty(r)){if(undefined!==n[r]["menu_order"]){i.querySelector(".menu_order").innerHTML=n[r]["menu_order"];i.querySelector(".post_parent").innerHTML=n[r]["post_parent"];var s=i.querySelector(".post_title").innerHTML;var o=0;while(o<n[r]["depth"]){s="— "+s;o++}i.parentNode.querySelector(".row-title").innerHTML=s}else{i.querySelector(".menu_order").innerHTML=n[r]}}}if(t.next){jQuery.post(ajaxurl,{action:"simple_page_ordering",id:t.next["id"],previd:t.next["previd"],nextid:t.next["nextid"],start:t.next["start"],excluded:t.next["excluded"]},update_simple_ordering_callback)}else{jQuery(document.querySelector(".spo-updating-row")).removeClass("spo-updating-row");sortable_post_table.removeClass("spo-updating").sortable("enable")}}var sortable_post_table=jQuery(document.querySelector(".wp-list-table tbody"));sortable_post_table.sortable({items:"> tr",cursor:"move",axis:"y",containment:"table.widefat",scrollSensitivity:40,cancel:".inline-edit-row",distance:5,opacity:.85,forceHelperSize:true,update:function(e,t){sortable_post_table.sortable("disable").addClass("spo-updating");t.item.addClass("spo-updating-row");var n=t.item[0].id.substr(5);var r=false;var i=t.item.prev();if(i.length>0){r=i.attr("id").substr(5)}var s=false;var o=t.item.next();if(o.length>0){s=o.attr("id").substr(5)}jQuery.post(ajaxurl,{action:"simple_page_ordering",id:n,previd:r,nextid:s},update_simple_ordering_callback);var u=document.querySelectorAll("tr.iedit"),a=u.length;while(a--){if(a%2==0){jQuery(u[a]).addClass("alternate")}else{jQuery(u[a]).removeClass("alternate")}}}})
1
+ function update_simple_ordering_callback(e){if("children"===e){window.location.reload();return}var t=jQuery.parseJSON(e);var n=t.new_pos;for(var r in n){if("next"===r)continue;var i=document.getElementById("inline_"+r);if(null!==i&&n.hasOwnProperty(r)){if(undefined!==n[r]["menu_order"]){var s=i.querySelector(".menu_order");if(null!==s)s.innerHTML=n[r]["menu_order"];var o=i.querySelector(".post_parent");if(null!==o)o.innerHTML=n[r]["post_parent"];var u=i.querySelector(".post_title").innerHTML;var a=0;while(a<n[r]["depth"]){u="— "+u;a++}i.parentNode.querySelector(".row-title").innerHTML=u}else{i.querySelector(".menu_order").innerHTML=n[r]}}}if(t.next){jQuery.post(ajaxurl,{action:"simple_page_ordering",id:t.next["id"],previd:t.next["previd"],nextid:t.next["nextid"],start:t.next["start"],excluded:t.next["excluded"]},update_simple_ordering_callback)}else{jQuery(document.querySelector(".spo-updating-row")).removeClass("spo-updating-row");sortable_post_table.removeClass("spo-updating").sortable("enable")}}var sortable_post_table=jQuery(document.querySelector(".wp-list-table tbody"));sortable_post_table.sortable({items:"> tr",cursor:"move",axis:"y",containment:"table.widefat",scrollSensitivity:40,cancel:".inline-edit-row",distance:5,opacity:.85,forceHelperSize:true,update:function(e,t){sortable_post_table.sortable("disable").addClass("spo-updating");t.item.addClass("spo-updating-row");var n=t.item[0].id.substr(5);var r=false;var i=t.item.prev();if(i.length>0){r=i.attr("id").substr(5)}var s=false;var o=t.item.next();if(o.length>0){s=o.attr("id").substr(5)}jQuery.post(ajaxurl,{action:"simple_page_ordering",id:n,previd:r,nextid:s},update_simple_ordering_callback);var u=document.querySelectorAll("tr.iedit"),a=u.length;while(a--){if(a%2==0){jQuery(u[a]).addClass("alternate")}else{jQuery(u[a]).removeClass("alternate")}}}})
simple-page-ordering.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Simple Page Ordering
4
Plugin URI: http://10up.com/plugins/simple-page-ordering-wordpress/
5
Description: Order your pages and hierarchical post types using drag and drop on the built in page list. For further instructions, open the "Help" tab on the Pages screen.
6
- Version: 2.1
7
Author: Jake Goldman, 10up
8
Author URI: http://10up.com
9
License: GPLv2 or later
3
Plugin Name: Simple Page Ordering
4
Plugin URI: http://10up.com/plugins/simple-page-ordering-wordpress/
5
Description: Order your pages and hierarchical post types using drag and drop on the built in page list. For further instructions, open the "Help" tab on the Pages screen.
6
+ Version: 2.1.1
7
Author: Jake Goldman, 10up
8
Author URI: http://10up.com
9
License: GPLv2 or later