forked from LiveCarta/LiveCartaWP
Changed source root directory
This commit is contained in:
17
html/wp-content/plugins/taxonomy-terms-order/composer.json
Normal file
17
html/wp-content/plugins/taxonomy-terms-order/composer.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name" : "nsp-code/taxonomy-terms-order",
|
||||
"description" : "Order Categories and all custom taxonomies terms (hierarchically) and child terms using a Drag and Drop Sortable javascript capability.",
|
||||
"keywords" : ["category order","terms order", "taxonomy order", "admin 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",
|
||||
"require" : {
|
||||
"composer/installers": "~1.0"
|
||||
}
|
||||
}
|
||||
75
html/wp-content/plugins/taxonomy-terms-order/css/to.css
Normal file
75
html/wp-content/plugins/taxonomy-terms-order/css/to.css
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
h2.subtitle {font-size: 15px; font-weight: bold; padding: 20px 0 10px 0}
|
||||
|
||||
#order-terms {}
|
||||
#order-terms img {vertical-align: middle}
|
||||
#order-terms #tto_sortable { list-style-type: none; margin: 10px 0 0; padding: 0; width: 100%; }
|
||||
#order-terms ul {list-style: none;}
|
||||
#order-terms ul.children {margin-left: 25px}
|
||||
|
||||
#order-terms #tto_sortable li > .item { border: 1px solid #E6E6E6;height: auto;line-height: 27px; padding-left: 10px;position: relative; text-shadow: 0 1px 0 #FFFFFF;width: auto;word-wrap: break-word;cursor: move;background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF;-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;transition:All 0.5s ease;-webkit-transition:All 0.5s ease;-moz-transition:All 0.5s ease;-o-transition:All 0.5s ease;}
|
||||
#order-terms #tto_sortable li > .item span { display: inline-block; line-height: 20px; padding: 5px 0; white-space: nowrap; font-weight: bold; cursor: pointer;}
|
||||
#order-terms #tto_sortable li > .item .options {float: right; padding: 0 10px 0 10px; }
|
||||
#order-terms #tto_sortable li > .item .options a {text-decoration: none; color: #3c434a;}
|
||||
#order-terms #tto_sortable li > .item .options a:hover {color: #2271b1;}
|
||||
#order-terms #tto_sortable li > .item .options span {font-weight: normal}
|
||||
#order-terms ul.children {margin-left: 20px}
|
||||
#order-terms .term_type_li ul {margin-top: 6px}
|
||||
#order-terms #nav-menu-header {background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF; -moz-border-radius-topleft: 6px; -moz-border-radius-topright: 6px;border-width: 1px 1px 0;border-color: #CCCCCC;border-style: solid; margin-bottom: 0px}
|
||||
#order-terms #nav-menu-header .major-publishing-actions {clear: both;padding: 5px 0px;}
|
||||
#order-terms #nav-menu-header .actions, #order-terms #nav-menu-footer .actions {padding: 0px; margin: 2px 0px; position: relative}
|
||||
.actions .toggle_thumbnails {margin-right: 30px}
|
||||
#order-terms #nav-menu-header .img_spacer {width: 18px; height: 18px;}
|
||||
#order-terms #nav-menu-footer {background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF; -moz-border-radius-bottomleft: 6px; -moz-border-radius-bottomright: 6px;border-width: 0 1px 1px 1px;border-color: #CCCCCC;border-style: solid;}
|
||||
#order-terms #nav-menu-footer .major-publishing-actions {clear: both;padding: 5px 0px;}
|
||||
#order-terms #nav-menu-footer .submit {padding: 0px;}
|
||||
|
||||
#order-terms .ui-sortable-placeholder{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;}
|
||||
#order-terms .ui-sortable-helper{filter:alpha(opacity=75); /* for internet explorer */opacity: 0.75; /* CSS3 standard */-moz-opacity:0.75; /* for older gecko browsers */-khtml-opacity: 0.75; /* for older webkit browsers */}
|
||||
|
||||
#order-terms #post-body {background: none repeat scroll 0 0 #FFFFFF;border-width: 0 1px 0 1px;border-color: #CCCCCC;border-style: solid; padding: 10px;}
|
||||
|
||||
.wp-list-taxonomy {width: 100%}
|
||||
.wp-list-taxonomy thead tr th{padding: 10px 0; text-align: left;}
|
||||
.wp-list-taxonomy tr {background-color: #FCFCFC;}
|
||||
.wp-list-taxonomy tbody th.check-column { padding: 9px 0 22px;}
|
||||
.wp-list-taxonomy td { color: #555555;}
|
||||
.wp-list-taxonomy td, .wp-list-taxonomy th { border-bottom-color: #DFDFDF; border-top-color: #FFFFFF;}
|
||||
.wp-list-taxonomy th, .wp-list-taxonomy td { overflow: hidden;}
|
||||
.wp-list-taxonomy td { padding: 9px 7px 4px 7px; vertical-align: top;}
|
||||
.wp-list-taxonomy td, .wp-list-taxonomy th { border-style: solid; border-width: 1px 0;}
|
||||
.wp-list-taxonomy * { word-wrap: break-word;}
|
||||
|
||||
#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);}
|
||||
#cpt_info_box a {text-decoration: none}
|
||||
#cpt_info_box #donate_form {float: right; padding: 10px 0 17px; text-align: center; width: 100%;}
|
||||
#p_right {float: right; background-color:#f5f5f5; border: 1px dashed #6aadcc; padding: 0px 10px; margin-top: 10px}
|
||||
.p_s_item {float: right; padding: 0px 5px; margin-top: 10px; margin-bottom: 5px; }
|
||||
.p_s_item.s_gp {padding-top: 2px; margin-left: 5px}
|
||||
|
||||
.menu_tto {margin-right: 4px; display: inline; vertical-align: middle; margin-top: -1px;}
|
||||
|
||||
#form_data td {vertical-align: top; padding-top: 20px}
|
||||
#form_data .pt-list {display:flex; flex-wrap: wrap;}
|
||||
#form_data .pt-item {flex-basis: calc(25% - 10px); flex-grow: 0; margin: 5px;}
|
||||
#form_data .pt-list::after { content: ""; flex-basis: calc(25% - 10px); flex-grow: 1; margin: 5px;}
|
||||
@media screen and (max-width: 1350px) {
|
||||
#form_data .pt-item {flex-basis: calc(33% - 10px);}
|
||||
#form_data .pt-list::after { flex-basis: calc(33% - 10px);}
|
||||
}
|
||||
@media screen and (max-width: 1100px) {
|
||||
#form_data .pt-item {flex-basis: calc(50% - 10px);}
|
||||
#form_data .pt-list::after { flex-basis: calc(50% - 10px);}
|
||||
}
|
||||
@media screen and (max-width: 782px) {
|
||||
#form_data .pt-item {flex-basis: calc(100% - 10px);}
|
||||
#form_data .pt-list::after { flex-basis: calc(100% - 10px);}
|
||||
#form_data .form-table th {text-align: left !important}
|
||||
}
|
||||
|
||||
.clear {clear: both}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 213 B |
BIN
html/wp-content/plugins/taxonomy-terms-order/images/logo.png
Normal file
BIN
html/wp-content/plugins/taxonomy-terms-order/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 723 B |
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class TTO_addons
|
||||
{
|
||||
|
||||
function __construct()
|
||||
{
|
||||
add_action ('to/get_terms_orderby/ignore', array ( $this, 'to_get_terms_orderby_ignore_coauthors' ), 10, 3 );
|
||||
add_action ('to/get_terms_orderby/ignore', array ( $this, 'to_get_terms_orderby_ignore_polylang' ), 10, 3);
|
||||
add_action ('to/get_terms_orderby/ignore', array ( $this, 'to_get_terms_orderby_ignore_woocommerce' ), 10, 3);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Co-Authors Plus fix
|
||||
*
|
||||
* @param mixed $ignore
|
||||
* @param mixed $orderby
|
||||
* @param mixed $args
|
||||
*/
|
||||
function to_get_terms_orderby_ignore_coauthors( $ignore, $orderby, $args )
|
||||
{
|
||||
if( !function_exists('is_plugin_active') )
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
|
||||
if( ! is_plugin_active( 'co-authors-plus/co-authors-plus.php' ))
|
||||
return $ignore;
|
||||
|
||||
if ( ! isset($args['taxonomy']) || count($args['taxonomy']) !== 1 || array_search('author', $args['taxonomy']) === FALSE )
|
||||
return $ignore;
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Polylang fix
|
||||
*
|
||||
* @param mixed $ignore
|
||||
* @param mixed $orderby
|
||||
* @param mixed $args
|
||||
*/
|
||||
function to_get_terms_orderby_ignore_polylang( $ignore, $orderby, $args )
|
||||
{
|
||||
if( !function_exists('is_plugin_active') )
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
|
||||
if( ! is_plugin_active( 'polylang/polylang.php' ))
|
||||
return $ignore;
|
||||
|
||||
if ( ! isset( $args['taxonomy'] ) || count( $args['taxonomy'] ) < 1 )
|
||||
return $ignore;
|
||||
|
||||
if( in_array( 'language', $args['taxonomy'] ) )
|
||||
return TRUE;
|
||||
|
||||
return $ignore;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* WooCommerce Attribute order
|
||||
*
|
||||
* @param mixed $ignore
|
||||
* @param mixed $orderby
|
||||
* @param mixed $args
|
||||
*/
|
||||
function to_get_terms_orderby_ignore_woocommerce( $ignore, $orderby, $args )
|
||||
{
|
||||
if( !function_exists('is_plugin_active') )
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
|
||||
if( ! is_plugin_active( 'woocommerce/woocommerce.php' ))
|
||||
return $ignore;
|
||||
|
||||
if ( ! function_exists ( 'wc_get_attribute_taxonomies' ) )
|
||||
return $ignore;
|
||||
|
||||
//create a list of attribute taxonomies
|
||||
$attributes = wc_get_attribute_taxonomies();
|
||||
$found_attributex_tax = array();
|
||||
foreach ( $attributes as $attribute )
|
||||
{
|
||||
$found_attributex_tax[] = 'pa_' . $attribute->attribute_name;
|
||||
}
|
||||
|
||||
if ( ! isset($args['taxonomy']) || count($args['taxonomy']) !== 1 )
|
||||
return $ignore;
|
||||
|
||||
if ( count ( array_intersect( $found_attributex_tax, $args['taxonomy']) ) < 1 )
|
||||
return $ignore;
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
new TTO_addons();
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class TTO_functions
|
||||
{
|
||||
/**
|
||||
* Return default plugin options
|
||||
*
|
||||
*/
|
||||
static public function get_settings()
|
||||
{
|
||||
|
||||
$settings = get_option('tto_options');
|
||||
|
||||
$defaults = array (
|
||||
'show_reorder_interfaces' => array(),
|
||||
'capability' => 'manage_options',
|
||||
'autosort' => '1',
|
||||
'adminsort' => '1'
|
||||
);
|
||||
$settings = wp_parse_args( $settings, $defaults );
|
||||
|
||||
return $settings;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*
|
||||
* Return UserLevel
|
||||
*
|
||||
*/
|
||||
static public function userdata_get_user_level($return_as_numeric = FALSE)
|
||||
{
|
||||
global $userdata;
|
||||
|
||||
$user_level = '';
|
||||
for ($i=10; $i >= 0;$i--)
|
||||
{
|
||||
if (current_user_can('level_' . $i) === TRUE)
|
||||
{
|
||||
$user_level = $i;
|
||||
if ($return_as_numeric === FALSE)
|
||||
$user_level = 'level_'.$i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ($user_level);
|
||||
}
|
||||
|
||||
|
||||
static public function check_table_column()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
//check if the menu_order column exists;
|
||||
$query = "SHOW COLUMNS FROM $wpdb->terms
|
||||
LIKE 'term_order'";
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared WordPress.DB.DirectDatabaseQuery.DirectQuery
|
||||
$result = $wpdb->query( $query );
|
||||
|
||||
if ($result == 0)
|
||||
{
|
||||
$query = "ALTER TABLE $wpdb->terms ADD `term_order` INT( 4 ) NULL DEFAULT '0'";
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared WordPress.DB.DirectDatabaseQuery.DirectQuery
|
||||
$result = $wpdb->query($query);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static public function info_box()
|
||||
{
|
||||
?>
|
||||
<div id="cpt_info_box">
|
||||
<p><?php esc_html_e( "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", 'taxonomy-terms-order' ) ?> <strong><a target="_blank" href="https://www.nsp-code.com/">https://www.nsp-code.com/</a></strong></p>
|
||||
<h4><a href="https://www.nsp-code.com/premium-plugins/advanced-taxonomy-terms-order/" target="_blank"><img width="151" src="<?php echo esc_url ( TOURL . "/images/logo.png" ) ?>" class="attachment-large size-large wp-image-36927" alt=""></a> <?php esc_html_e( "Did you know there is an Advanced Version of this plug-in?", 'taxonomy-terms-order' ) ?> <a target="_blank" href="https://www.nsp-code.com/premium-plugins/advanced-taxonomy-terms-order/"><?php esc_html_e( "Read more", 'taxonomy-terms-order' ) ?></a></h4>
|
||||
<p><?php esc_html_e( "Check our", 'taxonomy-terms-order' ) ?> <a target="_blank" href="https://wordpress.org/plugins/post-types-order/">Post Types Order</a> <?php esc_html_e( "plugin which allows to custom sort all posts, pages, custom post types", 'taxonomy-terms-order' ) ?> </p>
|
||||
<p><?php esc_html_e('Check our', 'taxonomy-terms-order') ?> <a target="_blank" href="https://wordpress.org/plugins/post-terms-order/">Post Terms Order</a> <?php esc_html_e('plugin which allows to custom sort categories and custom taxonomies terms per post basis', 'taxonomy-terms-order') ?> </p>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
|
||||
class TTO_Interface
|
||||
{
|
||||
|
||||
function Interface()
|
||||
{
|
||||
global $wpdb, $wp_locale;
|
||||
|
||||
$taxonomy = isset($_GET['taxonomy']) ? sanitize_key($_GET['taxonomy']) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
$post_type = isset($_GET['post_type']) ? sanitize_key($_GET['post_type']) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
if(empty($post_type))
|
||||
{
|
||||
$screen = get_current_screen();
|
||||
|
||||
if(isset($screen->post_type) && !empty($screen->post_type))
|
||||
$post_type = $screen->post_type;
|
||||
else
|
||||
{
|
||||
switch($screen->parent_file)
|
||||
{
|
||||
case "upload.php" :
|
||||
$post_type = 'attachment';
|
||||
break;
|
||||
|
||||
default:
|
||||
$post_type = 'post';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$post_type_data = get_post_type_object($post_type);
|
||||
|
||||
if (!taxonomy_exists($taxonomy))
|
||||
$taxonomy = '';
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2><?php esc_html_e( "Taxonomy Order", 'taxonomy-terms-order' ) ?></h2>
|
||||
|
||||
<?php TTO_functions::info_box() ?>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<noscript>
|
||||
<div class="error message">
|
||||
<p><?php esc_html_e( "This plugin can't work without javascript, because it's use drag and drop and AJAX.", 'taxonomy-terms-order' ) ?></p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php
|
||||
|
||||
$current_section_parent_file = '';
|
||||
switch($post_type)
|
||||
{
|
||||
|
||||
case "attachment" :
|
||||
$current_section_parent_file = "upload.php";
|
||||
break;
|
||||
|
||||
default :
|
||||
$current_section_parent_file = "edit.php";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<form action="<?php echo esc_attr ( $current_section_parent_file ) ?>" method="get" id="to_form">
|
||||
<input type="hidden" name="page" value="to-interface-<?php echo esc_attr($post_type) ?>" />
|
||||
<?php
|
||||
|
||||
if (!in_array($post_type, array('post', 'attachment')))
|
||||
echo '<input type="hidden" name="post_type" value="'. esc_attr($post_type) .'" />';
|
||||
|
||||
//output all available taxonomies for this post type
|
||||
|
||||
$post_type_taxonomies = get_object_taxonomies($post_type);
|
||||
|
||||
foreach ($post_type_taxonomies as $key => $taxonomy_name)
|
||||
{
|
||||
$taxonomy_info = get_taxonomy($taxonomy_name);
|
||||
if ($taxonomy_info->hierarchical !== TRUE)
|
||||
unset($post_type_taxonomies[$key]);
|
||||
}
|
||||
|
||||
//use the first taxonomy if emtpy taxonomy
|
||||
if ($taxonomy == '' || !taxonomy_exists($taxonomy))
|
||||
{
|
||||
reset($post_type_taxonomies);
|
||||
$taxonomy = current($post_type_taxonomies);
|
||||
}
|
||||
|
||||
if (count($post_type_taxonomies) > 1)
|
||||
{
|
||||
|
||||
?>
|
||||
|
||||
<h2 class="subtitle"><?php echo esc_attr ( ucfirst($post_type_data->labels->name) ) ?> <?php esc_html_e( "Taxonomies", 'taxonomy-terms-order' ) ?></h2>
|
||||
<table cellspacing="0" class="wp-list-taxonomy">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="" class="column-cb check-column" id="cb" scope="col"> </th><th style="" class="" id="author" scope="col"><?php esc_html_e( "Taxonomy Title", 'taxonomy-terms-order' ) ?></th><th style="" class="manage-column" id="categories" scope="col"><?php esc_html_e( "Total Posts", 'taxonomy-terms-order' ) ?></th> </tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody id="the-list">
|
||||
<?php
|
||||
|
||||
$alternate = FALSE;
|
||||
foreach ($post_type_taxonomies as $post_type_taxonomy)
|
||||
{
|
||||
$taxonomy_info = get_taxonomy($post_type_taxonomy);
|
||||
|
||||
$alternate = $alternate === TRUE ? FALSE :TRUE;
|
||||
|
||||
$args = array(
|
||||
'hide_empty' => 0,
|
||||
'taxonomy' => $post_type_taxonomy
|
||||
);
|
||||
$taxonomy_terms = get_terms( $args );
|
||||
|
||||
?>
|
||||
<tr valign="top" class="<?php if ($alternate === TRUE) {echo 'alternate ';} ?>" id="taxonomy-<?php echo esc_attr($taxonomy) ?>">
|
||||
<th class="check-column" scope="row"><input type="radio" onclick="to_change_taxonomy(this)" value="<?php echo esc_attr ( $post_type_taxonomy ) ?>" <?php if ($post_type_taxonomy == $taxonomy) {echo 'checked="checked"';} ?> name="taxonomy"> </th>
|
||||
<td class="categories column-categories"><b><?php echo esc_attr ( $taxonomy_info->label ) ?></b> (<?php echo esc_attr ( $taxonomy_info->labels->singular_name ); ?>)</td>
|
||||
<td class="categories column-categories"><?php echo count($taxonomy_terms) ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="order-terms">
|
||||
|
||||
<div id="nav-menu-header">
|
||||
<div class="major-publishing-actions">
|
||||
|
||||
|
||||
<div class="alignright actions">
|
||||
<p class="actions">
|
||||
|
||||
<span class="img_spacer">
|
||||
<img alt="" src="<?php echo esc_url ( TOURL . "/images/wpspin_light.gif" ) ?>" class="waiting pto_ajax_loading" style="display: none;">
|
||||
</span>
|
||||
<a href="javascript:;" class="save-order button-primary"><?php esc_html_e('Update', 'taxonomy-terms-order') ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
</div><!-- END .major-publishing-actions -->
|
||||
</div><!-- END #nav-menu-header -->
|
||||
|
||||
<div id="post-body">
|
||||
|
||||
<ul class="sortable" id="tto_sortable">
|
||||
<?php
|
||||
$this->listTerms($taxonomy);
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="nav-menu-footer">
|
||||
<div class="major-publishing-actions">
|
||||
<div class="alignright actions">
|
||||
<img alt="" src="<?php echo esc_url ( TOURL . "/images/wpspin_light.gif" ) ?>" class="waiting pto_ajax_loading" style="display: none;">
|
||||
<a href="javascript:;" class="save-order button-primary"><?php esc_html_e('Update', 'taxonomy-terms-order') ?></a>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
</div><!-- END .major-publishing-actions -->
|
||||
</div><!-- END #nav-menu-header -->
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
jQuery("ul.sortable").sortable({
|
||||
'tolerance':'intersect',
|
||||
'cursor':'pointer',
|
||||
'items':'> li',
|
||||
'axi': 'y',
|
||||
'placeholder':'placeholder',
|
||||
'nested': 'ul'
|
||||
});
|
||||
|
||||
jQuery(".save-order").bind( "click", function() {
|
||||
|
||||
jQuery(this).parent().find('img').show();
|
||||
|
||||
var mySortable = new Array();
|
||||
jQuery(".sortable").each( function(){
|
||||
|
||||
var serialized = jQuery(this).sortable("serialize");
|
||||
|
||||
var parent_tag = jQuery(this).parent().get(0).tagName;
|
||||
parent_tag = parent_tag.toLowerCase()
|
||||
if (parent_tag == 'li')
|
||||
{
|
||||
//
|
||||
var tag_id = jQuery(this).parent().attr('id');
|
||||
mySortable[tag_id] = serialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
mySortable[0] = serialized;
|
||||
}
|
||||
});
|
||||
|
||||
//serialize the array
|
||||
var serialize_data = JSON.stringify( convArrToObj(mySortable));
|
||||
|
||||
jQuery.post( ajaxurl, { action:'update-taxonomy-order', order: serialize_data, nonce : '<?php echo esc_attr ( wp_create_nonce( 'update-taxonomy-order' ) ); ?>' }, function() {
|
||||
jQuery("#ajax-response").html('<div class="message updated fade"><p><?php esc_html_e ( "Items Order Updated", 'taxonomy-terms-order' ) ?></p></div>');
|
||||
jQuery("#ajax-response div").delay(3000).hide("slow");
|
||||
jQuery('img.pto_ajax_loading').hide();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function listTerms( $taxonomy )
|
||||
{
|
||||
|
||||
// Query pages.
|
||||
$args = array(
|
||||
'orderby' => 'term_order',
|
||||
'depth' => 0,
|
||||
'child_of' => 0,
|
||||
'hide_empty' => 0,
|
||||
|
||||
'taxonomy' => $taxonomy,
|
||||
);
|
||||
$taxonomy_terms = get_terms( $args );
|
||||
|
||||
$output = '';
|
||||
if (count($taxonomy_terms) > 0)
|
||||
{
|
||||
$output = $this->TOwalkTree($taxonomy_terms, $args['depth'], $args);
|
||||
}
|
||||
|
||||
echo $output; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
}
|
||||
|
||||
function TOwalkTree($taxonomy_terms, $depth, $r)
|
||||
{
|
||||
$walker = new TO_Terms_Walker;
|
||||
$args = array($taxonomy_terms, $depth, $r);
|
||||
return call_user_func_array(array(&$walker, 'walk'), $args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class TTO_plugin_options
|
||||
{
|
||||
|
||||
public function plugin_options()
|
||||
{
|
||||
$options = TTO_functions::get_settings();
|
||||
|
||||
if ( isset($_POST['to_form_submit']) && isset ( $_POST['to_form_nonce'] ) && wp_verify_nonce( sanitize_text_field ( wp_unslash ( $_POST['to_form_nonce'] ) ),'to_form_submit') )
|
||||
{
|
||||
$options['show_reorder_interfaces'] = isset ( $_POST['show_reorder_interfaces'] ) ? preg_replace( '/[^a-z]/', '', array_map( 'sanitize_text_field', wp_unslash ( $_POST['show_reorder_interfaces'] ) ) ) : "";
|
||||
$options['capability'] = isset ( $_POST['capability'] ) ? preg_replace( '/[^a-zA-Z0-9_\-]/', '', sanitize_text_field ( wp_unslash ( $_POST['capability'] ) ) ) : "";
|
||||
|
||||
$options['autosort'] = isset($_POST['autosort']) ? intval($_POST['autosort']) : '';
|
||||
$options['adminsort'] = isset($_POST['adminsort']) ? intval($_POST['adminsort']) : '';
|
||||
|
||||
?><div class="updated fade"><p><?php esc_html_e('Settings Saved', 'taxonomy-terms-order') ?></p></div><?php
|
||||
|
||||
update_option('tto_options', $options);
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
|
||||
<h2><?php esc_html_e( "General Settings", 'taxonomy-terms-order' ) ?></h2>
|
||||
|
||||
<?php TTO_functions::info_box() ?>
|
||||
|
||||
<form id="form_data" name="form" method="post">
|
||||
<br />
|
||||
<h2 class="subtitle"><?php esc_html_e( "General", 'taxonomy-terms-order' ) ?></h2>
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
|
||||
<tr valign="top">
|
||||
<th scope="row" style="text-align: right;"><label><?php esc_html_e('Show / Hide re-order interface', 'taxonomy-terms-order') ?></label></th>
|
||||
<td>
|
||||
<p><?php esc_html_e("Display the Taxonomy Order interface for the specified post types.", 'taxonomy-terms-order') ?></p>
|
||||
<br />
|
||||
<div class="pt-list">
|
||||
<?php
|
||||
|
||||
$post_types = get_post_types( array(), 'objects' );
|
||||
foreach( $post_types as $post_type )
|
||||
{
|
||||
|
||||
//check if there are any taxonomy for this post type
|
||||
$post_type_taxonomies = get_object_taxonomies( $post_type->name );
|
||||
|
||||
foreach ($post_type_taxonomies as $key => $taxonomy_name)
|
||||
{
|
||||
$taxonomy_info = get_taxonomy($taxonomy_name);
|
||||
if (empty($taxonomy_info->hierarchical) || $taxonomy_info->hierarchical !== TRUE)
|
||||
unset($post_type_taxonomies[$key]);
|
||||
}
|
||||
|
||||
if (count($post_type_taxonomies) == 0)
|
||||
continue;
|
||||
|
||||
|
||||
?>
|
||||
<p class="pt-item"><label>
|
||||
<select name="show_reorder_interfaces[<?php echo esc_attr ( $post_type->name ) ?>]">
|
||||
<option value="show" <?php if(isset($options['show_reorder_interfaces'][$post_type->name]) && $options['show_reorder_interfaces'][$post_type->name] == 'show') {echo ' selected="selected"';} ?>><?php esc_html_e( "Show", 'taxonomy-terms-order' ) ?></option>
|
||||
<option value="hide" <?php if(isset($options['show_reorder_interfaces'][$post_type->name]) && $options['show_reorder_interfaces'][$post_type->name] == 'hide') {echo ' selected="selected"';} ?>><?php esc_html_e( "Hide", 'taxonomy-terms-order' ) ?></option>
|
||||
</select> <?php echo esc_html ( $post_type->label ); ?>
|
||||
</label><br /> </p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<tr valign="top">
|
||||
<th scope="row" style="text-align: right;"><label><?php esc_html_e( "Minimum Level to use this plugin", 'taxonomy-terms-order' ) ?></label></th>
|
||||
<td>
|
||||
<select id="role" name="capability">
|
||||
<option value="read" <?php if (isset($options['capability']) && $options['capability'] == "read") echo 'selected="selected"'?>><?php esc_html_e('Subscriber', 'taxonomy-terms-order') ?></option>
|
||||
<option value="edit_posts" <?php if (isset($options['capability']) && $options['capability'] == "edit_posts") echo 'selected="selected"'?>><?php esc_html_e('Contributor', 'taxonomy-terms-order') ?></option>
|
||||
<option value="publish_posts" <?php if (isset($options['capability']) && $options['capability'] == "publish_posts") echo 'selected="selected"'?>><?php esc_html_e('Author', 'taxonomy-terms-order') ?></option>
|
||||
<option value="publish_pages" <?php if (isset($options['capability']) && $options['capability'] == "publish_pages") echo 'selected="selected"'?>><?php esc_html_e('Editor', 'taxonomy-terms-order') ?></option>
|
||||
<option value="manage_options" <?php if (!isset($options['capability']) || empty($options['capability']) || (isset($options['capability']) && $options['capability'] == "manage_options")) echo 'selected="selected"'?>><?php esc_html_e('Administrator', 'taxonomy-terms-order') ?></option>
|
||||
<?php do_action('tto/admin/plugin_options/capability') ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr valign="top">
|
||||
<th scope="row" style="text-align: right;"><label><?php esc_html_e( "Auto Sort", 'taxonomy-terms-order' ) ?></label></th>
|
||||
<td>
|
||||
<select id="autosort" name="autosort">
|
||||
<option value="0" <?php if ($options['autosort'] == "0") echo 'selected="selected"'?>><?php esc_html_e('OFF', 'taxonomy-terms-order') ?></option>
|
||||
<option value="1" <?php if ($options['autosort'] == "1") echo 'selected="selected"'?>><?php esc_html_e('ON', 'taxonomy-terms-order') ?></option>
|
||||
</select>
|
||||
<label for="autosort"> *(<?php esc_html_e( "global setting", 'taxonomy-terms-order' ) ?>) <?php esc_html_e( "Additional description and details at ", 'taxonomy-terms-order' ) ?><a target="_blank" href="https://www.nsp-code.com/taxonomy-terms-order-and-auto-sort-admin-sort-description-an-usage/"><?php esc_html_e( "Auto Sort Description", 'taxonomy-terms-order' ) ?></a></label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<th scope="row" style="text-align: right;"><label><?php esc_html_e( "Admin Sort", 'taxonomy-terms-order' ) ?></label></th>
|
||||
<td>
|
||||
<select id="adminsort" name="adminsort">
|
||||
<option value="0" <?php if ($options['adminsort'] == "0") echo 'selected="selected"'?>><?php esc_html_e('OFF', 'taxonomy-terms-order') ?></option>
|
||||
<option value="1" <?php if ($options['adminsort'] == "1") echo 'selected="selected"'?>><?php esc_html_e('ON', 'taxonomy-terms-order') ?></option>
|
||||
</select>
|
||||
<label for="adminsort"><?php esc_html_e("This will change the order of terms within the admin interface", 'taxonomy-terms-order') ?>. <?php esc_html_e( "Additional description and details at ", 'taxonomy-terms-order' ) ?><a target="_blank" href="https://www.nsp-code.com/taxonomy-terms-order-and-auto-sort-admin-sort-description-an-usage/"><?php esc_html_e( "Auto Sort Description", 'taxonomy-terms-order' ) ?></a></label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<p class="submit">
|
||||
<input type="submit" name="Submit" class="button-primary" value="<?php esc_html_e('Save Settings', 'taxonomy-terms-order') ?>">
|
||||
</p>
|
||||
|
||||
<?php wp_nonce_field('to_form_submit','to_form_nonce'); ?>
|
||||
<input type="hidden" name="to_form_submit" value="true" />
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
echo '</div>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class TO_Terms_Walker extends Walker
|
||||
{
|
||||
|
||||
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
|
||||
|
||||
|
||||
function start_lvl(&$output, $depth = 0, $args = array() )
|
||||
{
|
||||
extract($args, EXTR_SKIP);
|
||||
|
||||
$indent = str_repeat("\t", $depth);
|
||||
$output .= "\n$indent<ul class='children sortable'>\n";
|
||||
}
|
||||
|
||||
|
||||
function end_lvl(&$output, $depth = 0, $args = array())
|
||||
{
|
||||
extract($args, EXTR_SKIP);
|
||||
|
||||
$indent = str_repeat("\t", $depth);
|
||||
$output .= "$indent</ul>\n";
|
||||
}
|
||||
|
||||
|
||||
function start_el(&$output, $term, $depth = 0, $args = array(), $current_object_id = 0)
|
||||
{
|
||||
if ( $depth )
|
||||
$indent = str_repeat("\t", $depth);
|
||||
else
|
||||
$indent = '';
|
||||
|
||||
$currentScreen = get_current_screen();
|
||||
|
||||
$term_link = isset ( $currentScreen->post_type ) ? get_edit_term_link( $term, $term->taxonomy, $currentScreen->post_type ) : get_edit_term_link( $term );
|
||||
|
||||
$output .= $indent . '<li class="term_type_li" id="item_'.$term->term_id.'"><div class="item"><span class="title">'.apply_filters( 'to/term_title', $term->name, $term ).' </span> <span class="options ui-sortable-handle"><a href="' . $term_link .'"><span class="dashicons dashicons-edit"></span></a></span></div>';
|
||||
}
|
||||
|
||||
|
||||
function end_el(&$output, $object, $depth = 0, $args = array())
|
||||
{
|
||||
$output .= "</li>\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class TTO
|
||||
{
|
||||
var $functions;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
add_action('admin_print_scripts', array ( $this, 'admin_print_scripts' ) );
|
||||
add_action('admin_print_styles', array ( $this, 'admin_print_styles' ) );
|
||||
add_action('admin_menu', array ( $this, 'admin_menu' ), 99);
|
||||
add_filter('terms_clauses', array ( $this, 'apply_order_filter' ), 10, 3);
|
||||
add_filter('get_terms_orderby', array ( $this, 'get_terms_orderby' ), 1, 2);
|
||||
|
||||
add_action( 'wp_ajax_update-taxonomy-order', array ( $this, 'saveAjaxOrder' ) );
|
||||
|
||||
if ( is_admin() )
|
||||
TTO_functions::check_table_column();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Admin Scripts
|
||||
*
|
||||
*/
|
||||
function admin_print_scripts()
|
||||
{
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_script('jquery-ui-sortable');
|
||||
wp_register_script('to-javascript', TOURL . '/js/to-javascript.js', array(), TTO_VERSION, FALSE );
|
||||
wp_enqueue_script( 'to-javascript');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Admin styles
|
||||
*
|
||||
*/
|
||||
function admin_print_styles()
|
||||
{
|
||||
wp_register_style('to.css', TOURL . '/css/to.css', array(), TTO_VERSION );
|
||||
wp_enqueue_style( 'to.css');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Plugin menus
|
||||
*
|
||||
*/
|
||||
function admin_menu()
|
||||
{
|
||||
include (TOPATH . '/include/class.interface.php');
|
||||
include (TOPATH . '/include/class.terms_walker.php');
|
||||
include (TOPATH . '/include/class.options.php');
|
||||
|
||||
$TTO_plugin_options = new TTO_plugin_options();
|
||||
add_options_page('Taxonomy Terms Order', '<img class="menu_tto" src="'. TOURL .'/images/menu-icon.png" alt="" />' . __('Taxonomy Terms Order', 'taxonomy-terms-order'), 'manage_options', 'to-options', array ( $TTO_plugin_options, 'plugin_options' ) );
|
||||
|
||||
$options = TTO_functions::get_settings();
|
||||
|
||||
if(isset($options['capability']) && !empty($options['capability']))
|
||||
$capability = $options['capability'];
|
||||
else if (is_numeric($options['level']))
|
||||
{
|
||||
//maintain the old user level compatibility
|
||||
$capability = TTO_functions::userdata_get_user_level();
|
||||
}
|
||||
else
|
||||
{
|
||||
$capability = 'manage_options';
|
||||
}
|
||||
|
||||
//put a menu within all custom types if apply
|
||||
$post_types = get_post_types();
|
||||
foreach( $post_types as $post_type)
|
||||
{
|
||||
|
||||
//check if there are any taxonomy for this post type
|
||||
$post_type_taxonomies = get_object_taxonomies($post_type);
|
||||
|
||||
foreach ($post_type_taxonomies as $key => $taxonomy_name)
|
||||
{
|
||||
$taxonomy_info = get_taxonomy($taxonomy_name);
|
||||
if (empty($taxonomy_info->hierarchical) || $taxonomy_info->hierarchical !== TRUE)
|
||||
unset($post_type_taxonomies[$key]);
|
||||
}
|
||||
|
||||
if (count($post_type_taxonomies) == 0)
|
||||
continue;
|
||||
|
||||
if ( isset ( $options['show_reorder_interfaces'][ $post_type ]) && $options['show_reorder_interfaces'][ $post_type ] == 'hide' )
|
||||
continue;
|
||||
|
||||
$TTO_Interface = new TTO_Interface();
|
||||
|
||||
if ($post_type == 'post')
|
||||
add_submenu_page('edit.php', __('Taxonomy Order', 'taxonomy-terms-order'), __('Taxonomy Order', 'taxonomy-terms-order'), $capability, 'to-interface-'.$post_type, array ( $TTO_Interface, 'Interface' ) );
|
||||
elseif ($post_type == 'attachment')
|
||||
add_submenu_page('upload.php', __('Taxonomy Order', 'taxonomy-terms-order'), __('Taxonomy Order', 'taxonomy-terms-order'), $capability, 'to-interface-'.$post_type, array ( $TTO_Interface, 'Interface' ) );
|
||||
else
|
||||
add_submenu_page('edit.php?post_type='.$post_type, __('Taxonomy Order', 'taxonomy-terms-order'), __('Taxonomy Order', 'taxonomy-terms-order'), $capability, 'to-interface-'.$post_type, array ( $TTO_Interface, 'Interface' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Apply order filter
|
||||
*
|
||||
* @param mixed $clauses
|
||||
* @param mixed $taxonomies
|
||||
* @param mixed $args
|
||||
*/
|
||||
function apply_order_filter( $clauses, $taxonomies, $args)
|
||||
{
|
||||
if ( apply_filters('to/get_terms_orderby/ignore', FALSE, $clauses['orderby'], $args) )
|
||||
return $clauses;
|
||||
|
||||
$options = TTO_functions::get_settings();
|
||||
|
||||
//if admin make sure use the admin setting
|
||||
if (is_admin())
|
||||
{
|
||||
|
||||
//return if use orderby columns
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
if (isset($_GET['orderby']) && sanitize_text_field( wp_unslash( $_GET['orderby'] ) ) !== 'term_order')
|
||||
return $clauses;
|
||||
|
||||
if ( $options['adminsort'] == "1" && (!isset($args['ignore_term_order']) || (isset($args['ignore_term_order']) && $args['ignore_term_order'] !== TRUE) ) )
|
||||
{
|
||||
if ( $clauses['orderby'] == 'ORDER BY t.name' )
|
||||
$clauses['orderby'] = 'ORDER BY t.term_order '. $clauses['order'] .', t.name';
|
||||
else
|
||||
$clauses['orderby'] = 'ORDER BY t.term_order';
|
||||
|
||||
}
|
||||
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
//if autosort, then force the menu_order
|
||||
if ($options['autosort'] == "1" && (!isset($args['ignore_term_order']) || (isset($args['ignore_term_order']) && $args['ignore_term_order'] !== TRUE) ) )
|
||||
{
|
||||
$clauses['orderby'] = 'ORDER BY t.term_order';
|
||||
}
|
||||
|
||||
if ( $options['adminsort'] == "1" && defined( 'REST_REQUEST' ) && REST_REQUEST )
|
||||
{
|
||||
$clauses['orderby'] = 'ORDER BY t.term_order';
|
||||
}
|
||||
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get terms orderby
|
||||
*
|
||||
* @param mixed $orderby
|
||||
* @param mixed $args
|
||||
* @return mixed
|
||||
*/
|
||||
function get_terms_orderby($orderby, $args)
|
||||
{
|
||||
if ( apply_filters('to/get_terms_orderby/ignore', FALSE, $orderby, $args) )
|
||||
return $orderby;
|
||||
|
||||
if (isset($args['orderby']) && $args['orderby'] == "term_order" && $orderby != "term_order")
|
||||
return "t.term_order";
|
||||
|
||||
return $orderby;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save the AJAX order update
|
||||
*
|
||||
*/
|
||||
function saveAjaxOrder()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
if ( ! isset ( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field ( wp_unslash ( $_POST['nonce'] ) ), 'update-taxonomy-order' ) )
|
||||
die();
|
||||
|
||||
$data = isset ( $_POST['order'] ) ? stripslashes( sanitize_text_field ( wp_unslash ( $_POST['order'] ) ) ) : "";
|
||||
$unserialised_data = json_decode($data, TRUE);
|
||||
|
||||
if (is_array($unserialised_data))
|
||||
foreach($unserialised_data as $key => $values )
|
||||
{
|
||||
//$key_parent = str_replace("item_", "", $key);
|
||||
$items = explode("&", $values);
|
||||
unset($item);
|
||||
foreach ($items as $item_key => $item_)
|
||||
{
|
||||
$items[$item_key] = trim(str_replace("item[]=", "",$item_));
|
||||
}
|
||||
|
||||
if (is_array($items) && count($items) > 0)
|
||||
{
|
||||
foreach( $items as $item_key => $term_id )
|
||||
{
|
||||
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
|
||||
$wpdb->update( $wpdb->terms, array('term_order' => ($item_key + 1)), array('term_id' => $term_id) );
|
||||
}
|
||||
clean_term_cache($items);
|
||||
}
|
||||
}
|
||||
|
||||
do_action('tto/update-order');
|
||||
|
||||
wp_cache_flush();
|
||||
|
||||
die();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
function to_change_taxonomy(element)
|
||||
{
|
||||
//select the default category (0)
|
||||
jQuery('#to_form #cat').val(jQuery("#to_form #cat option:first").val());
|
||||
jQuery('#to_form').submit();
|
||||
}
|
||||
|
||||
var convArrToObj = function(array){
|
||||
var thisEleObj = new Object();
|
||||
if(typeof array == "object"){
|
||||
for(var i in array){
|
||||
var thisEle = convArrToObj(array[i]);
|
||||
thisEleObj[i] = thisEle;
|
||||
}
|
||||
}else {
|
||||
thisEleObj = array;
|
||||
}
|
||||
return thisEleObj;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,149 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Category Order and Taxonomy Terms Order\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-09-04 16:42+0300\n"
|
||||
"PO-Revision-Date: 2024-09-04 16:42+0300\n"
|
||||
"Last-Translator: NspCode <contact@nsp-code.com>\n"
|
||||
"Language-Team: nsp-code <electronice_delphi@yahoo.com>\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-Poedit-KeywordsList: _;gettext;__;_e\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Generator: Poedit 3.5\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
#: include/class.functions.php:74
|
||||
msgid ""
|
||||
"Did you find this plugin useful? Please support our work with a donation or "
|
||||
"write an article about this plugin in your blog with a link to our site"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.functions.php:75
|
||||
msgid "Did you know there is an Advanced Version of this plug-in?"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.functions.php:75
|
||||
msgid "Read more"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.functions.php:76 include/class.functions.php:77
|
||||
msgid "Check our"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.functions.php:76
|
||||
msgid "plugin which allows to custom sort all posts, pages, custom post types"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.functions.php:77
|
||||
msgid ""
|
||||
"plugin which allows to custom sort categories and custom taxonomies terms "
|
||||
"per post basis"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.interface.php:42 include/class.to.php:107
|
||||
#: include/class.to.php:109 include/class.to.php:111
|
||||
msgid "Taxonomy Order"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.interface.php:50
|
||||
msgid ""
|
||||
"This plugin can't work without javascript, because it's use drag and drop "
|
||||
"and AJAX."
|
||||
msgstr ""
|
||||
|
||||
#: include/class.interface.php:104
|
||||
msgid "Taxonomies"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.interface.php:108
|
||||
msgid "Taxonomy Title"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.interface.php:108
|
||||
msgid "Total Posts"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.interface.php:160
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:20
|
||||
msgid "Settings Saved"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:28
|
||||
msgid "General Settings"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:34
|
||||
msgid "General"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:39
|
||||
msgid "Minimum Level to use this plugin"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:42
|
||||
msgid "Subscriber"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:43
|
||||
msgid "Contributor"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:44
|
||||
msgid "Author"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:45
|
||||
msgid "Editor"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:46
|
||||
msgid "Administrator"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:54
|
||||
msgid "Auto Sort"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:57 include/class.options.php:68
|
||||
msgid "OFF"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:58 include/class.options.php:69
|
||||
msgid "ON"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:60
|
||||
msgid "global setting"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:60 include/class.options.php:71
|
||||
msgid "Additional description and details at "
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:60 include/class.options.php:71
|
||||
msgid "Auto Sort Description"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:65
|
||||
msgid "Admin Sort"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:71
|
||||
msgid "This will change the order of terms within the admin interface"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.options.php:82
|
||||
msgid "Save Settings"
|
||||
msgstr ""
|
||||
|
||||
#: include/class.to.php:70
|
||||
msgid "Taxonomy Terms Order"
|
||||
msgstr ""
|
||||
309
html/wp-content/plugins/taxonomy-terms-order/readme.txt
Normal file
309
html/wp-content/plugins/taxonomy-terms-order/readme.txt
Normal file
@@ -0,0 +1,309 @@
|
||||
=== Category Order and Taxonomy Terms Order ===
|
||||
Contributors: nsp-code
|
||||
Donate link: http://www.nsp-code.com/donate.php
|
||||
Tags: category order,terms order, taxonomy order, categories sort
|
||||
Requires at least: 2.8
|
||||
Tested up to: 6.9
|
||||
Stable tag: 1.9.4
|
||||
|
||||
Drag-and-drop ordering for Categories & any taxonomy (hierarchically) using a Drag and Drop Sortable JavaScript capability.
|
||||
|
||||
== Description ==
|
||||
|
||||
Easily control the order of Categories and any hierarchical taxonomy with a simple drag-and-drop interface. Reorder parent and child terms visually in the admin and choose whether the plugin automatically applies your custom term order to front-end queries.
|
||||
|
||||
<h3>Key features</h3>
|
||||
<ul>
|
||||
<li>Intuitive drag-and-drop reordering for Categories and all hierarchical taxonomies. </li>
|
||||
|
||||
<li>Option to auto-apply the custom term order to front-end queries (no theme/plugin edits required). </li>
|
||||
|
||||
<li>Keep the admin term lists in your new order (makes management and editorial workflows consistent). </li>
|
||||
|
||||
<li>Works with multiple taxonomies per post type — switch between taxonomies from the same interface. </li>
|
||||
|
||||
<li>Multisite aware and regularly updated for modern WordPress and PHP versions (see changelog for compatibility notes).</li>
|
||||
</ul>
|
||||
|
||||
<h3>How it works</h3>
|
||||
After activating the plugin, a new Taxonomy Order page becomes available under the custom post type menu. Simply open it and drag terms into the exact order you want — including parent/child hierarchy.
|
||||
Use the plugin’s Taxonomy Order screen to drag terms into the order you want. To apply the custom order automatically across your site, enable the Autosort option — the plugin will adjust term queries on the fly so your chosen order shows without template changes. If you prefer to control ordering in code, include orderby => 'term_order' when calling get_terms() to use the plugin’s order programmatically.
|
||||
|
||||
<br />This plugin is developed by <a target="_blank" href="http://www.nsp-code.com">Nsp-Code</a>
|
||||
|
||||
<br />See the <a target="_blank" href="https://www.nsp-code.com/premium-plugins/wordpress-plugins/advanced-taxonomy-terms-order/">Advanced Taxonomy Terms Order</a> for advanced features.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload `taxonomy-terms-order` folder to your `/wp-content/plugins/` directory.
|
||||
2. Activate the plugin from Admin > Plugins menu.
|
||||
3. Once activated you should check with Settings > Taxonomy Terms Order
|
||||
4. Use Taxonomy Order link which appears into each post type section to make your sort.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Category Order Interface.
|
||||
2. Multiple Taxonomies Interface.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
Feel free to contact me at electronice_delphi@yahoo.com
|
||||
|
||||
= Since I have no PHP knowledge at all, is this plugin for me? =
|
||||
|
||||
Absolutely, you can!
|
||||
Unlike many other plugins, you don't have to do any code changes to make your post order to apply, accordingly to custom-defined order. There is an option to auto-update the WordPress queries so the posts will be returned in customised order. This can be turned off (Autosort) to allow customized code usage.
|
||||
|
||||
= I prefer to apply the sort through code, how can be done? =
|
||||
|
||||
Include a 'orderby' => 'term_order' within your get_terms() arguments.
|
||||
|
||||
= What taxonomies will allow me to sort? =
|
||||
|
||||
You can sort ALL taxonomies ( hierarhically active ), including the default Categories.
|
||||
|
||||
= Is there any way i can get my admin interface to use the custom terms order? =
|
||||
|
||||
Absolutely, the plugin can do that. In fact you can configure so only the admin will update and the front side template will display the terms as before.
|
||||
|
||||
= There is a feature that i want it implemented, can you do something about it? =
|
||||
|
||||
All ideas are welcome and i put them on my list to be implemented into the new versions. Anyway this may take time, but if you are in a rush, please consider a small donation and we can arrange something.
|
||||
|
||||
= I still need more features =
|
||||
|
||||
Consider upgrading to our advanced version of this plugin at a very resonable price <a target="_blank" href="http://www.nsp-code.com/premium-plugins/wordpress-plugins/advanced-taxonomy-terms-order/">Advanced Taxonomy Terms Order Order</a>
|
||||
|
||||
== Change Log ==
|
||||
|
||||
= 1.9.4 =
|
||||
- On Rest Request, evaluate the admin sort settings to apply or not the customized order.
|
||||
|
||||
= 1.9.3 =
|
||||
- Improved plugin page description
|
||||
- Use sanitize_text_field and wp_unslash for the options form
|
||||
- Include FALSE argument in the wp_register_script
|
||||
- WordPress 6.9 compatibility check
|
||||
- WordPress 6.9 tag update
|
||||
|
||||
= 1.9.1 =
|
||||
- Replace all _e with escaping function esc_html_e
|
||||
- Use esc_url when output an image url
|
||||
- Use esc_attr when output html attribute value
|
||||
- Use isset before using an array argument.
|
||||
- Minor CSS enhancements
|
||||
- Other Minor code changes
|
||||
|
||||
= 1.9 =
|
||||
- Style and layout updates for the re-order interface.
|
||||
- Add version to the CSS/JavaScript files to ensure latest data is loaded instead cached.
|
||||
- WordPress 6.8.2 compatibility tag
|
||||
|
||||
= 1.8.8 =
|
||||
- PHP 8.3.4 compatibility check
|
||||
- Slight CSS and layout adjustments.
|
||||
- WordPress 6.8 compatibility tag
|
||||
|
||||
= 1.8.7 =
|
||||
- CSS adjustments for span action section.
|
||||
- Option for term edit link.
|
||||
- Include the term edit link on the ReOrder interface.
|
||||
- Wordpress 6.7 compatibility check and tag update.
|
||||
|
||||
= 1.8.6 =
|
||||
- Fix: TTO_addons class not loaded which makes the compatibility routines not triggering.
|
||||
|
||||
= 1.8.5 =
|
||||
- Temporary placeholder function to prevent fatal errors when using the Uncode theme.
|
||||
|
||||
= 1.8.4 =
|
||||
- Code structure improvements.
|
||||
- New option "Show / Hide re-order interface" - Display the Taxonomy Order interface for the specified post types
|
||||
- WordPress 6.6.1 compatibility check and tag update
|
||||
|
||||
= 1.8.2 =
|
||||
- Polylang fix - Ignore the 'language' to avoid unnecessarily sorting.
|
||||
- Set-up the Live Preview for the plugin.
|
||||
- WordPress 6.5.4 compatibility check and tag update
|
||||
|
||||
= 1.8.1 =
|
||||
- WordPress 6.5 compatibility check and tag update
|
||||
|
||||
= 1.8 =
|
||||
- Check if the terms table still includ the custom column, to avoid errors ( mainly when upgrading WordPress )
|
||||
- Code improvements
|
||||
- WordPress 6.4.2 compatibility check and tag update
|
||||
|
||||
= 1.7.9 =
|
||||
- Trigger wp_cache_flush when saving the order to clear the internal caches
|
||||
- WordPress 6.3 compatibility tag
|
||||
|
||||
= 1.7.7 =
|
||||
- Use term name for admin queries, when the admin sort is active, to avoid "random" returns on certain servers, when term order are empty.
|
||||
- WordPress 6.2.2 compatibility tag
|
||||
|
||||
= 1.7.5 =
|
||||
- New filter tto/admin/plugin_options/capability to add custom roles and capabilities.
|
||||
- Compatibility tag update for WordPress 6.2
|
||||
|
||||
= 1.7.4 =
|
||||
- Compatibility tag update for WordPress 6.1.1
|
||||
|
||||
= 1.7.3 =
|
||||
- Use esc_html to escape the ajax response message, to avoid single quotes which will break the code.
|
||||
|
||||
= 1.7.1 =
|
||||
- Add the required column when create a new site, when running under MultiSite environment.
|
||||
|
||||
= 1.7 =
|
||||
- Create the required columns for all sites, when running under MultiSite environment.
|
||||
- Compatibility tag update for WordPress 6.0.1
|
||||
|
||||
= 1.6.1 =
|
||||
- Compatibility tag update for WordPress 6.0
|
||||
|
||||
= 1.6 =
|
||||
- Readme file updates, typos fixes.
|
||||
- Compatibility tag update for WordPress 5.9.1
|
||||
|
||||
= 1.5.9 =
|
||||
- Remove Twitter button
|
||||
- Compatibility tag update for WordPress 5.8.2
|
||||
|
||||
= 1.5.7.7 =
|
||||
- Minor code updates
|
||||
- Code cleanup
|
||||
- Compatibility tag update for WordPress 5.8.1
|
||||
|
||||
= 1.5.7.6 =
|
||||
- Clear the term cache to ensure the updated order reflect for certain caches
|
||||
|
||||
= 1.5.7.5 =
|
||||
- Apply the order within admin if ignore_term_order argument is set and not true
|
||||
- Compatibility tag update for WordPress 5.7
|
||||
|
||||
= 1.5.7.4 =
|
||||
- Fix: Call to undefined function wc_get_attribute_taxonomies()
|
||||
- Compatibility tag update for WordPress 5.6
|
||||
|
||||
= 1.5.7.3 =
|
||||
- Compatibility tag update for WordPress 5.5
|
||||
|
||||
= 1.5.7.2 =
|
||||
- Compatibility tag update for WordPress 5.4
|
||||
|
||||
= 1.5.7.1 =
|
||||
- Compatibility tag update for WordPress 5.3
|
||||
|
||||
= 1.5.7 =
|
||||
- Ignore WooCOmmerce Attributes order as being changed through default interface
|
||||
|
||||
= 1.5.6 =
|
||||
- Rely on 'terms_clauses' filter than 'get_terms_orderby' as producing issues with the $maybe_orderby_meta backward compatibility.
|
||||
- Fix WooCommerce category order apply
|
||||
|
||||
= 1.5.5 =
|
||||
- Ignore admin sort when using columns order within Taxonomy interface
|
||||
|
||||
= 1.5.4 =
|
||||
- Replaced serialize with JSON when saving terms order
|
||||
- New filter to/get_terms_orderby/ignore to allow sort ignore when Autosort is turned On
|
||||
- Addon code to ignore term_order sorting when Co-Authors plugin term query
|
||||
|
||||
= 1.5.3.2 =
|
||||
- Add nonce field for AJAX sort update
|
||||
|
||||
= 1.5.3.1 =
|
||||
- Removed Google Plus share button which triggered some JavaScript errors
|
||||
|
||||
= 1.5.3 =
|
||||
- Use JSON instead serialize method when sending order through AJAX
|
||||
- Updated PO language file
|
||||
|
||||
= 1.5.2.2 =
|
||||
- Default admin capability changed from install_plugins to manage_options to prevent DISALLOW_FILE_MODS issue. https://wordpress.org/support/topic/plugin-breaks-when-disallow_file_mods-is-set-to-true/
|
||||
- Prepare plugin for Composer package
|
||||
- Interface table th elements titles left align
|
||||
- Interface Taxonomy terms count fix
|
||||
|
||||
= 1.5 =
|
||||
- Included 'ignore_term_order' to force menu_order ignore when autosort active.
|
||||
- Translations issues update
|
||||
|
||||
= 1.4.9 =
|
||||
- Remove translations from the package
|
||||
- Removed donate banner
|
||||
- PHP 7 fix
|
||||
- Unused action remove
|
||||
|
||||
= 1.4.8 =
|
||||
- textdomain folder fix
|
||||
- Translation fix for user roles
|
||||
- the_title filter replaced with terms_walker
|
||||
- Add Nonce for admin settings
|
||||
|
||||
= 1.4.7 =
|
||||
- Texdomain change to taxonomy-terms-order to allow translations through translate.wordpress.org
|
||||
- WordPress 4.4 compatibility update
|
||||
- Css updates
|
||||
|
||||
= 1.4.6.1 =
|
||||
- Security bug fix
|
||||
|
||||
= 1.4.5 =
|
||||
- Translation textdomain fix - thanks to Pedro Mendonça
|
||||
- Portuguese localization update - Pedro Mendonça
|
||||
|
||||
= 1.4.4 =
|
||||
- User role switch from deprecated user_level to capabilities
|
||||
- Taxonomy sort for media
|
||||
- Admin Options update
|
||||
|
||||
= 1.4.2 =
|
||||
- Iranian Language (eydaaad@gmail.com)
|
||||
- Admin css updates.
|
||||
|
||||
= 1.4.1 =
|
||||
- Polish Language(Pozdrawiam - www.difreo.pl/ ; Mateusz - www.czar-net.com )
|
||||
|
||||
= 1.4.0 =
|
||||
- Hungarian Language(Adam Laki - http://codeguide.hu/)
|
||||
- Ukrainian translation (Michael Yunat - http://getvoip.com)
|
||||
- Czech translation
|
||||
|
||||
= 1.3.7 =
|
||||
- Brazilian Portuguese Language (Rafael Forcadell - www.rafaelforcadell.com.br)
|
||||
|
||||
= 1.3.6 =
|
||||
- Traditional Chinese Language (Danny - http://sofree.cc)
|
||||
- Minor admin styling
|
||||
|
||||
= 1.3.4 =
|
||||
- Menu walker update
|
||||
- Translations load fix
|
||||
- Japanese language
|
||||
|
||||
= 1.3.0 =
|
||||
- Headers already sent bug fix
|
||||
- Slovak Language (Branco Slovak http://webhostinggeeks.com/user-reviews/)
|
||||
|
||||
= 1.2.9 =
|
||||
- Small updates
|
||||
- German and French languages.
|
||||
|
||||
= 1.2.7 =
|
||||
- Localization implement, Dutch and Romanian.
|
||||
- Many thanks to Anja Fokker http://www.werkgroepen.net/
|
||||
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
Make sure you get the latest version
|
||||
|
||||
|
||||
== Localization ==
|
||||
|
||||
Available in Catalan, Chinese (China), Chinese (Taiwan), Czech, Dutch, Dutch (Belgium), English (Australia), English (Canada), English (New Zealand), English (UK), English (US), French (France), Galician, German, Italian, Japanese, Norwegian (Bokmål), Polish, Portuguese (Portugal), Russian, Spanish (Chile), Spanish (Spain), Spanish (Venezuela), Swedish, and Turkish.
|
||||
Whant to contribute with a translation to your language? Please check at https://translate.wordpress.org/projects/wp-plugins/taxonomy-terms-order
|
||||
|
||||
There isn't any Editors for your native language on plugin Contributors? You can help to moderate! https://translate.wordpress.org/projects/wp-plugins/taxonomy-terms-order/contributors
|
||||
BIN
html/wp-content/plugins/taxonomy-terms-order/screenshot-1.png
Normal file
BIN
html/wp-content/plugins/taxonomy-terms-order/screenshot-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
BIN
html/wp-content/plugins/taxonomy-terms-order/screenshot-2.png
Normal file
BIN
html/wp-content/plugins/taxonomy-terms-order/screenshot-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/*
|
||||
* Plugin Name: Category Order and Taxonomy Terms Order
|
||||
* Plugin URI: http://www.nsp-code.com
|
||||
* Description: Order Categories and all custom taxonomies terms (hierarchically) and child terms using a Drag and Drop Sortable javascript capability.
|
||||
* Version: 1.9.4
|
||||
* Author: Nsp-Code
|
||||
* Author URI: https://www.nsp-code.com
|
||||
* Author Email: contact@nsp-code.com
|
||||
* Text Domain: taxonomy-terms-order
|
||||
* Domain Path: /languages/
|
||||
*/
|
||||
|
||||
|
||||
define('TOPATH', plugin_dir_path(__FILE__));
|
||||
define('TOURL', plugins_url('', __FILE__));
|
||||
|
||||
define('TTO_VERSION', '1.9.4');
|
||||
|
||||
include_once ( TOPATH . '/include/class.tto.php' );
|
||||
include_once ( TOPATH . '/include/class.functions.php' );
|
||||
include_once ( TOPATH . '/include/class.addons.php' );
|
||||
|
||||
register_activation_hook(__FILE__, 'TTO_activated');
|
||||
function TTO_activated( $network_wide )
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
// check if it is a network activation
|
||||
if ( $network_wide )
|
||||
{
|
||||
// Get all blog ids
|
||||
$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
|
||||
foreach ( $blogids as $blog_id )
|
||||
{
|
||||
switch_to_blog( $blog_id );
|
||||
TTO_functions::check_table_column();
|
||||
restore_current_blog();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
TTO_functions::check_table_column();
|
||||
}
|
||||
|
||||
|
||||
add_action( 'wp_initialize_site', 'TTO_wp_initialize_site', 99, 2 );
|
||||
function TTO_wp_initialize_site( $blog_data, $args )
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
if ( is_plugin_active_for_network('taxonomy-terms-order/taxonomy-terms-order.php') )
|
||||
{
|
||||
switch_to_blog( $blog_data->blog_id );
|
||||
TTO_functions::check_table_column();
|
||||
restore_current_blog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load the textdomain
|
||||
*/
|
||||
add_action( 'plugins_loaded', 'TTO_load_textdomain');
|
||||
function TTO_load_textdomain()
|
||||
{
|
||||
load_plugin_textdomain('taxonomy-terms-order', false, dirname( plugin_basename( __FILE__ ) ) . '/languages');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the main class
|
||||
*
|
||||
*/
|
||||
function TTO_class_load()
|
||||
{
|
||||
new TTO();
|
||||
}
|
||||
add_action( 'plugins_loaded', 'TTO_class_load');
|
||||
|
||||
|
||||
/**
|
||||
* Temporary placeholder function to prevent fatal errors when using the Uncode theme.
|
||||
*
|
||||
* @param mixed $clauses
|
||||
* @param mixed $taxonomies
|
||||
* @param mixed $args
|
||||
*/
|
||||
function TO_apply_order_filter( $clauses, $taxonomies, $args )
|
||||
{
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user