ba4770c9 by Jeff Balicki

post order

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 404e4df6
<?php
/**
* Compatibility : LiteSpeed Cache
* Introduced at :
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class PTO_LiteSpeed_Cache
{
function __construct()
{
if( ! $this->is_plugin_active())
return FALSE;
add_action( 'PTO/order_update_complete', array( $this, 'order_update_complete') );
}
function is_plugin_active()
{
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( is_plugin_active( 'litespeed-cache/litespeed-cache.php' ) )
return TRUE;
else
return FALSE;
}
function order_update_complete()
{
if( method_exists( 'LiteSpeed_Cache_API', 'purge_all' ) )
{
LiteSpeed_Cache_API::purge_all() ;
}
}
}
new PTO_LiteSpeed_Cache();
?>
\ No newline at end of file
<?php
/**
* Compatibility : Events Calendar
* Introduced at :
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class PTO_Events_calendar
{
function __construct()
{
add_filter( 'pto/posts_orderby/ignore', array ( $this, 'ignore_post_types_order_sort' ), 10, 3 );
}
function ignore_post_types_order_sort( $ignore, $orderBy, $query )
{
if ( isset($query->query_vars) && !empty( $query->query_vars['post_type'] ))
{
$query_post_types = array();
foreach ( (array)$query->query_vars['post_type'] as $_post_type )
{
$query_post_types[] = $_post_type;
}
if ( in_array("tribe_events", $query_post_types ) )
$ignore = TRUE;
}
return $ignore;
}
}
new PTO_Events_calendar();
?>
\ No newline at end of file
<?php
/**
* Compatibility : Endfold
* Introduced at : 5.6.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class PTO_Enfold
{
function __construct()
{
add_filter( 'pto/posts_orderby/ignore', array ( $this, 'ignore_post_types_order_sort' ), 10, 3 );
}
function ignore_post_types_order_sort( $ignore, $orderBy, $query )
{
if ( isset($query->query_vars) && !empty( $query->query_vars['post_type'] ))
{
$query_post_types = array();
foreach ( (array)$query->query_vars['post_type'] as $_post_type )
{
$query_post_types[] = $_post_type;
}
if ( in_array("avia_framework_post", $query_post_types ) )
$ignore = TRUE;
}
return $ignore;
}
}
new PTO_Enfold();
?>
\ No newline at end of file
{
"name" : "nsp-code/post-types-order",
"description" : "Posts Order and Post Types Objects Order using a Drag and Drop Sortable javascript capability",
"keywords" : ["post order" , "posts order", "sort", "post sort", "posts sort", "post type order", "custom order", "admin posts order"],
"homepage" : "http://www.nsp-code.com/",
"authors" : [
{
"name": "Nsp Code",
"email": "contact@nsp-code.com",
"homepage": "http://www.nsp-code.com/"
}
],
"type" : "wordpress-plugin",
"repositories" :[
{
"type":"composer",
"url":"https://wpackagist.org",
"only": [
"wpackagist-plugin/*",
"wpackagist-theme/*"
]
}
],
"require" : {
"composer/installers": "~1.0"
}
}
#the-list.ui-sortable tr .check-column:hover { cursor: move;}
#the-list.ui-sortable tr.alternate { background-color: #F9F9F9; }
#the-list.ui-sortable tr.ui-sortable-helper { background-color: #ffffff; outline: 1px solid #dfdfdf;}
#the-list.ui-sortable .ui-sortable-placeholder td{border-color:#bbb;background-color:#FCFCFC; height:32px; background-image: none; -moz-border-radius: 6px 6px 6px 6px; border: 3px dashed #E6E6E6; -webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px; box-sizing: border-box;}
#the-list.ui-sortable > tr > th:first-child:after {position: absolute; color: #959595; content: "\f475"; transform: rotate(-90deg); margin: 4px 0 0 6px; display: block; font-family: dashicons;
line-height: 1;
font-weight: 400;
font-style: normal;
text-transform: none;
text-rendering: auto;
font-size: 20px;
text-align: center;}
\ No newline at end of file
#form_data td {vertical-align: top; padding-top: 20px}
#cpto #cpt_info_box {padding: 0 10px; border: 1px dashed #6aadcc; background-color: #FFF; margin-top: 10px;-webkit-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);-moz-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);}
#cpto #cpt_info_box a {text-decoration: none}
#cpto #cpt_info_box #donate_form { padding: 20px 0 17px; text-align: center; width: 100%;}
\ No newline at end of file
#order-post-type #sortable { list-style-type: none; margin: 10px 0 0; padding: 0; width: 100%; }
#order-post-type #sortable ul { margin-left:20px; list-style: none; }
#order-post-type #sortable li { padding: 10px; margin: 3px 0px; border-bottom: 1px solid #f4f4f4;border-left: 4px solid #ccd0d4; cursor: move; background-color: #FFF}
#order-post-type #sortable li:nth-child(2n+1) { background-color: #f9f9f9 !important;}
#order-post-type #sortable li span { display: block; font-size:14px;}
#order-post-type #sortable li.placeholder{border: dashed 2px #ccc;height:18px; background-color: #FFF;}
#cpto h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold; padding-left: 0px}
.wrap .example { color: #666666; font-size: 11px; font-weight: bold}
#cpto #cpt_info_box {padding: 0 10px; border: 1px dashed #6aadcc; background-color: #FFF; margin-top: 10px;-webkit-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);-moz-box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);box-shadow: 1px 1px 7px rgba(50, 50, 50, 0.17);}
#cpto #cpt_info_box a {text-decoration: none}
#cpto #cpt_info_box #donate_form { padding: 20px 0 17px; text-align: center; width: 100%;}
.menu_pto {margin-right: 4px; display: inline; vertical-align: middle; margin-top: -1px;}
#cpto #p_right {float: right; background-color:#f5f5f5; border: 1px dashed #6aadcc; padding: 0px 10px; margin-top: 10px}
#cpto .p_s_item {float: right; padding: 0px 5px; margin-top: 10px; margin-bottom: 5px; }
.clear {clear: both}
\ No newline at end of file
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="11.000000pt" height="29.000000pt" viewBox="0 0 11.000000 29.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,29.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M17 272 c-14 -15 -17 -40 -17 -129 0 -129 10 -147 77 -140 l38 4 -41
1 c-22 1 -45 7 -52 14 -17 17 -17 232 1 246 7 6 30 12 52 15 l40 4 -41 1 c-29
1 -46 -4 -57 -16z"/>
<path d="M30 245 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M70 245 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M30 195 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M70 195 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M30 145 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M70 145 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M30 95 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
-7 -15 -15z"/>
<path d="M70 95 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
-7 -15 -15z"/>
<path d="M30 45 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
-7 -15 -15z"/>
<path d="M70 45 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
-7 -15 -15z"/>
</g>
</svg>
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class CPT_Compatibility
{
function __construct()
{
$this->init();
}
function init()
{
$CompatibilityFiles = array(
'the-events-calendar.php',
'LiteSpeed_Cache.php',
);
foreach( $CompatibilityFiles as $CompatibilityFile )
{
if ( is_file( CPTPATH . 'compatibility/' . $CompatibilityFile ) )
include_once( CPTPATH . 'compatibility/' . $CompatibilityFile );
}
/**
* Themes
*/
$theme = wp_get_theme();
if( ! $theme instanceof WP_Theme )
return FALSE;
$compatibility_themes = array(
'enfold' => 'enfold.php',
);
if (isset( $theme->template ) )
{
foreach ( $compatibility_themes as $theme_slug => $compatibility_file )
{
if ( strtolower( $theme->template ) == $theme_slug || strtolower( $theme->name ) == $theme_slug )
{
include_once( CPTPATH . 'compatibility/themes/' . $compatibility_file );
}
}
}
do_action('cpt/compatibility/init');
}
}
new CPT_Compatibility();
?>
\ No newline at end of file
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Post_Types_Order_Walker extends Walker
{
var $db_fields = array (
'parent' => 'post_parent',
'id' => 'ID'
);
function start_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class='children'>\n";
}
function end_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n";
}
function start_el(&$output, $page, $depth = 0, $args = array(), $id = 0)
{
if ( $depth )
$indent = str_repeat("\t", $depth);
else
$indent = '';
extract($args, EXTR_SKIP);
$item_details = apply_filters( 'the_title', $page->post_title, $page->ID );
//Deprecated, rely on pto/interface_itme_data
$item_details = apply_filters('cpto/interface_itme_data', $item_details, $page);
$item_details = apply_filters('pto/interface_item_data', $item_details, $page);
$output .= $indent . '<li id="item_'.$page->ID.'"><span>'. $item_details .'</span>';
}
function end_el(&$output, $page, $depth = 0, $args = array())
{
$output .= "</li>\n";
}
}
?>
\ No newline at end of file
var getUrlParameter = function getUrlParameter(sParam)
{
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
jQuery(document).ready(function()
{
jQuery('table.wp-list-table #the-list').sortable({
placeholder: {
element: function(currentItem) {
var cols = jQuery(currentItem).children('td:visible').length + 1;
return jQuery('<tr class="ui-sortable-placeholder"><td colspan="' + cols + '">&nbsp;</td></tr>')[0];
},
update: function(container, p) {
return;
}
},
'items': 'tr',
'handle': ".check-column",
'axis': 'y',
'update' : function(e, ui) {
var post_type = CPTO.post_type;
var order = jQuery('#the-list').sortable('serialize');
var paged = getUrlParameter('paged');
if(typeof paged === 'undefined')
paged = 1;
var queryString = { "action": "update-custom-type-order-archive", "post_type" : post_type, "order" : order ,"paged": paged, "archive_sort_nonce" : CPTO.archive_sort_nonce};
//send the data through ajax
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: queryString,
cache: false,
dataType: "html",
success: function(data){
},
error: function(html){
}
});
}
});
});
msgid ""
msgstr ""
"Project-Id-Version: Post Types Order\n"
"POT-Creation-Date: 2017-07-17 16:03+0200\n"
"PO-Revision-Date: 2023-02-23 15:43+0200\n"
"Last-Translator: NspCode <contact@nsp-code.com>\n"
"Language-Team: \n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.2\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-SearchPath-0: .\n"
#: include/class.cpto.php:207
msgid "Post Types Order must be configured. Please go to"
msgstr ""
#: include/class.cpto.php:207
msgid "Settings Page"
msgstr ""
#: include/class.cpto.php:207
msgid "make the configuration and save"
msgstr ""
#: include/class.cpto.php:485 include/class.cpto.php:487
#: include/class.cpto.php:490 include/class.cpto.php:501
msgid "Re-Order"
msgstr ""
#: include/class.cpto.php:509
msgid ""
"This plugin can't work without javascript, because it's use drag and drop "
"and AJAX."
msgstr ""
#: include/class.cpto.php:522
msgid "Update"
msgstr ""
#: include/class.cpto.php:543
msgid "Items Order Updated"
msgstr ""
#: include/class.functions.php:104
msgid ""
"Did you find this plugin useful? Please support our work by purchasing the "
"advanced version or write an article about this plugin in your blog with a "
"link to our site"
msgstr ""
#: include/class.functions.php:105
msgid "Did you know there is available an Advanced version of this plug-in?"
msgstr ""
#: include/class.functions.php:105
msgid "Read more"
msgstr ""
#: include/class.functions.php:106
msgid "Check our"
msgstr ""
#: include/class.functions.php:106
msgid ""
"plugin which allow to custom sort categories and custom taxonomies terms"
msgstr ""
#: include/class.functions.php:107
msgid "Check out"
msgstr ""
#: include/class.functions.php:107
msgid ""
"the easy way to completely hide your WordPress core files, theme and plugins"
msgstr ""
#: include/class.functions.php:142 include/class.functions.php:221
#, php-format
msgid "Use commas instead of %s to separate excluded terms."
msgstr ""
#: include/class.options.php:40
msgid "Settings Saved"
msgstr ""
#: include/class.options.php:57
msgid "General Settings"
msgstr ""
#: include/class.options.php:63
msgid "General"
msgstr ""
#: include/class.options.php:67
msgid "Show / Hide re-order interface"
msgstr ""
#: include/class.options.php:94
msgid "Show"
msgstr ""
#: include/class.options.php:95
msgid "Hide"
msgstr ""
#: include/class.options.php:102
msgid "Minimum Level to use this plugin"
msgstr ""
#: include/class.options.php:105
msgid "Subscriber"
msgstr ""
#: include/class.options.php:106
msgid "Contributor"
msgstr ""
#: include/class.options.php:107
msgid "Author"
msgstr ""
#: include/class.options.php:108
msgid "Editor"
msgstr ""
#: include/class.options.php:109
msgid "Administrator"
msgstr ""
#: include/class.options.php:116
msgid "Auto Sort"
msgstr ""
#: include/class.options.php:118
msgid ""
"If checked, the plug-in automatically update the WordPress queries to use "
"the new order (<b>No code update is necessarily</b>)"
msgstr ""
#: include/class.options.php:119
msgid ""
"If only certain queries need to use the custom sort, keep this unchecked and "
"include 'orderby' => 'menu_order' into query parameters"
msgstr ""
#: include/class.options.php:121
msgid "Additional Description and Examples"
msgstr ""
#: include/class.options.php:128
msgid "Admin Sort"
msgstr ""
#: include/class.options.php:132
msgid ""
"To affect the admin interface, to see the post types per your new sort, this "
"need to be checked"
msgstr ""
#: include/class.options.php:137
msgid "Use query ASC / DESC parameter "
msgstr ""
#: include/class.options.php:141
msgid ""
"If the query include an Ascending or Descending order paramether, use that. "
"If query order is set to DESC the order will be reversed."
msgstr ""
#: include/class.options.php:146
msgid "Archive Drag&Drop "
msgstr ""
#: include/class.options.php:150
msgid ""
"Allow sortable drag & drop functionality within default WordPress post type "
"archive. Admin Sort need to be active."
msgstr ""
#: include/class.options.php:155
msgid "Next / Previous Apply"
msgstr ""
#: include/class.options.php:159
msgid "Apply the sort on Next / Previous site-wide navigation."
msgstr ""
#: include/class.options.php:159
msgid "This can also be controlled through"
msgstr ""
#: include/class.options.php:159
msgid "code"
msgstr ""
#: include/class.options.php:167
msgid "Save Settings"
msgstr ""
<?php
/*
Plugin Name: Post Types Order
Plugin URI: http://www.nsp-code.com
Description: Posts Order and Post Types Objects Order using a Drag and Drop Sortable javascript capability
Author: Nsp Code
Author URI: http://www.nsp-code.com
Version: 2.1
Text Domain: post-types-order
Domain Path: /languages/
*/
define('CPTPATH', plugin_dir_path(__FILE__));
define('CPTURL', plugins_url('', __FILE__));
include_once(CPTPATH . '/include/class.cpto.php');
include_once(CPTPATH . '/include/class.functions.php');
add_action( 'plugins_loaded', 'cpto_class_load');
function cpto_class_load()
{
global $CPTO;
$CPTO = new CPTO();
}
add_action( 'plugins_loaded', 'cpto_load_textdomain');
function cpto_load_textdomain()
{
load_plugin_textdomain('post-types-order', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages');
}
add_action('wp_loaded', 'initCPTO' );
function initCPTO()
{
global $CPTO;
$options = $CPTO->functions->get_options();
if (is_admin())
{
if(isset($options['capability']) && !empty($options['capability']))
{
if( current_user_can($options['capability']) )
$CPTO->init();
}
else if (is_numeric($options['level']))
{
if ( $CPTO->functions->userdata_get_user_level(true) >= $options['level'] )
$CPTO->init();
}
else
{
$CPTO->init();
}
}
}
?>
\ No newline at end of file