├── assets ├── logo.jpg ├── taxonomy_order.min.js ├── scporder.min.js ├── taxonomy_order.js └── scporder.js ├── screenshot-1.png ├── screenshot-2.png ├── screenshot-3.png ├── .gitignore ├── languages ├── simple-custom-post-order.mo └── simple-custom-post-order.po ├── package.json ├── Gruntfile.js ├── class-simple-review.php ├── readme.txt ├── settings.php ├── simple-custom-post-order.php └── LICENSE.txt /assets/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/simple-custom-post-order/HEAD/assets/logo.jpg -------------------------------------------------------------------------------- /screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/simple-custom-post-order/HEAD/screenshot-1.png -------------------------------------------------------------------------------- /screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/simple-custom-post-order/HEAD/screenshot-2.png -------------------------------------------------------------------------------- /screenshot-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/simple-custom-post-order/HEAD/screenshot-3.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | node_modules/* 3 | .idea/* 4 | simple-custom-post-order.zip 5 | .DS_Store 6 | package-lock.json 7 | .standard.json 8 | -------------------------------------------------------------------------------- /languages/simple-custom-post-order.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/simple-custom-post-order/HEAD/languages/simple-custom-post-order.mo -------------------------------------------------------------------------------- /assets/taxonomy_order.min.js: -------------------------------------------------------------------------------- 1 | jQuery(function(e){function s(n){var t=e(".tablenav .actions");0===t.find(".spinner").length&&!0===n?t.prepend('
'):!0===n?t.find(".spinner").show():t.find(".spinner").hide()}"edit-tags-php"==adminpage&&e(".wp-list-table.tags tbody").sortable({items:"tr:not(.inline-edit-row)",cursor:"move",axis:"y",containment:"table.widefat",scrollSensitivity:40,stop:function(n,t){var i=new Array([]);s(!0),e(".wp-list-table.tags tbody tr:not(.inline-edit-row)").each(function(n,t){t=parseInt(e(t).attr("id").substr(4));i[n]=t}),e.post(ajaxurl,{rows:i,action:"get_inline_boxes"},function(n){s(!1)})}})}); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-custom-post-order", 3 | "main": "Gruntfile.js", 4 | "version": "1.2.0", 5 | "homepage": "https://www.colorlib.com", 6 | "author": "Colorlib", 7 | "license": "GPL v3", 8 | "repository": "https://github.com/puikinsh/simple-custom-post-order", 9 | "devDependencies": { 10 | "grunt": "^1.0.4", 11 | "grunt-checktextdomain": "^1.0.1", 12 | "grunt-cli": "~1.3.2", 13 | "grunt-contrib-clean": "^2.0.0", 14 | "grunt-contrib-compress": "^1.5.0", 15 | "grunt-contrib-concat": "^1.0.1", 16 | "grunt-contrib-copy": "^1.0.0", 17 | "grunt-contrib-cssmin": "^3.0.0", 18 | "grunt-contrib-uglify": "^4.0.1", 19 | "grunt-wp-i18n": "^1.0.3", 20 | "load-grunt-tasks": "^4.0.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /assets/scporder.min.js: -------------------------------------------------------------------------------- 1 | (i=>{var t;i("table.posts #the-list, table.pages #the-list").sortable({items:"tr",axis:"y",helper:t,update:function(t,e){i.post(scporder_vars.ajax_url,{action:"update-menu-order",order:i("#the-list").sortable("serialize"),nonce:scporder_vars.nonce})}}),i("table.tags #the-list").sortable({items:"tr",axis:"y",helper:t,update:function(t,e){i.post(scporder_vars.ajax_url,{action:"update-menu-order-tags",order:i("#the-list").sortable("serialize"),nonce:scporder_vars.nonce})}}),jQuery(window).on("load",function(){var e,r=new Array,t=0,s=(jQuery("#the-list tr:first-child").find("td").each(function(){r[t]=i(this).outerWidth(),t+=1}),jQuery("#the-list").find("tr").each(function(){var e=0;i(this).find("td").each(function(){var t=parseInt(i(this).css("padding-left").replace("px",""))+parseInt(i(this).css("padding-right").replace("px",""));i(this).width(r[e]-t),e+=1})}),0);0==jQuery("#the-list > tr.no-items").length&&(jQuery("#the-list").parent().find("thead").find("th").each(function(){var t=parseInt(i(this).css("padding-left").replace("px",""))+parseInt(i(this).css("padding-right").replace("px",""));i(this).width(r[s]-t),s+=1}),e=0,jQuery("#the-list").parent().find("tfoot").find("th").each(function(){var t=parseInt(i(this).css("padding-left").replace("px",""))+parseInt(i(this).css("padding-right").replace("px",""));i(this).width(r[e]-t),e+=1}))})})(jQuery); -------------------------------------------------------------------------------- /assets/taxonomy_order.js: -------------------------------------------------------------------------------- 1 | jQuery(function( $ ) 2 | { 3 | // if it is taxonomy page 4 | if( adminpage == 'edit-tags-php' ) 5 | { 6 | // make table rows sortable 7 | $( '.wp-list-table.tags tbody' ).sortable({ 8 | items: 'tr:not(.inline-edit-row)', 9 | cursor: 'move', 10 | axis: 'y', 11 | containment: 'table.widefat', 12 | scrollSensitivity: 40, 13 | stop: function( event, ui ) { 14 | // array for the ids and positions 15 | var rows = new Array([]); 16 | 17 | // show "activity" with spinner 18 | hsam_taxonomy_sort_activity_spinner( true ); 19 | 20 | $( '.wp-list-table.tags tbody tr:not(.inline-edit-row)' ).each( function( i, e ) { 21 | var rowID = parseInt( $( e ).attr( 'id' ).substr( 4 ) ); 22 | rows[i] = rowID; 23 | } ); 24 | 25 | // post rows for sorting 26 | $.post( ajaxurl, { 'rows' : rows, 'action' : 'get_inline_boxes' }, function(response) { 27 | // stop activity spinner 28 | hsam_taxonomy_sort_activity_spinner( false ); 29 | }); 30 | } 31 | }); 32 | } 33 | 34 | /** 35 | * Adds, shows or hides the activity status spinner 36 | 37 | */ 38 | function hsam_taxonomy_sort_activity_spinner( status ) { 39 | var actions_table = $( '.tablenav .actions' ); 40 | 41 | if( actions_table.find( '.spinner' ).length === 0 && status === true ) { 42 | // add spinner 43 | actions_table.prepend( '' ); 44 | } 45 | else if ( status === true ) { 46 | // show spinner 47 | actions_table.find( '.spinner' ).show(); 48 | } 49 | else { 50 | // hide spinner 51 | actions_table.find( '.spinner' ).hide(); 52 | } 53 | } 54 | } ); -------------------------------------------------------------------------------- /assets/scporder.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | $('table.posts #the-list, table.pages #the-list').sortable({ 3 | 'items': 'tr', 4 | 'axis': 'y', 5 | 'helper': fixHelper, 6 | 'update': function (e, ui) { 7 | $.post( scporder_vars.ajax_url, { 8 | action: 'update-menu-order', 9 | order: $('#the-list').sortable('serialize'), 10 | nonce: scporder_vars.nonce 11 | }); 12 | } 13 | }); 14 | $('table.tags #the-list').sortable({ 15 | 'items': 'tr', 16 | 'axis': 'y', 17 | 'helper': fixHelper, 18 | 'update': function (e, ui) { 19 | $.post( scporder_vars.ajax_url, { 20 | action: 'update-menu-order-tags', 21 | order: $('#the-list').sortable('serialize'), 22 | nonce: scporder_vars.nonce 23 | }); 24 | } 25 | }); 26 | var fixHelper = function (e, ui) { 27 | ui.children().children().each(function () { 28 | $(this).width($(this).width()); 29 | }); 30 | return ui; 31 | }; 32 | 33 | /**** 34 | * Fix for table breaking 35 | */ 36 | jQuery(window).on( 'load', function () { 37 | 38 | // make the array for the sizes 39 | var td_array = new Array(); 40 | var i = 0; 41 | 42 | jQuery('#the-list tr:first-child').find('td').each(function () { 43 | 44 | td_array[i] = $(this).outerWidth(); 45 | 46 | i += 1; 47 | }); 48 | 49 | jQuery('#the-list').find('tr').each(function () { 50 | var j = 0; 51 | $(this).find('td').each(function () { 52 | 53 | var paddingx = parseInt($(this).css('padding-left').replace('px', '')) + parseInt($(this).css('padding-right').replace('px', '')); 54 | $(this).width(td_array[j] - paddingx); 55 | 56 | j += 1; 57 | }); 58 | }); 59 | 60 | var y = 0; 61 | 62 | // check if there are items in the table 63 | if(jQuery('#the-list > tr.no-items').length == 0){ 64 | jQuery('#the-list').parent().find('thead').find('th').each(function () { 65 | 66 | var paddingx = parseInt($(this).css('padding-left').replace('px', '')) + parseInt($(this).css('padding-right').replace('px', '')); 67 | $(this).width(td_array[y] - paddingx); 68 | 69 | y += 1; 70 | }); 71 | 72 | var z = 0; 73 | jQuery('#the-list').parent().find('tfoot').find('th').each(function () { 74 | 75 | var paddingx = parseInt($(this).css('padding-left').replace('px', '')) + parseInt($(this).css('padding-right').replace('px', '')); 76 | $(this).width(td_array[z] - paddingx); 77 | 78 | z += 1; 79 | }); 80 | } 81 | 82 | }); 83 | 84 | /***** 85 | * End table breaking fix 86 | */ 87 | 88 | })(jQuery) 89 | -------------------------------------------------------------------------------- /languages/simple-custom-post-order.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Colorlib 2 | # This file is distributed under the GPLv3 or later. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Simple Custom Post Order 2.4.7\n" 6 | "Report-Msgid-Bugs-To: " 7 | "https://wordpress.org/support/plugin/simple-custom-post-order\n" 8 | "POT-Creation-Date: 2019-10-09 08:57:28+00:00\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=utf-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAMEmessages['notice'] ), $this->value ) ; ?>
76 |77 | 78 | messages['rate'] ); ?> 79 | 80 | messages['rated'] ); ?> 81 | messages['no_rate'] ); ?> 82 |
83 || 323 | |
324 | name == 'attachment' ) {
327 | continue;
328 | }
329 | ?>
330 | 348 | 351 | |
352 |
|---|
Make sure to rate it and visit us at Colorlib.com
365 | 366 | 367 |