ColorlibHQ / simple-custom-post-order

Order posts(posts, any custom post types) using a Drag and Drop Sortable JavaScript. Configuration is unnecessary.

Home Page:http://wordpress.org/plugins/simple-custom-post-order/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with sorting taxonomies

mplusb opened this issue · comments

This cause me disapear all taxonomy queries. Roll back to previus version

This fix also broke things for us as well.
Line 520 -> $taxonomy = $args['taxonomy'][0]; produces an undefined offset
Needs more testing before release.

Editing in a possible solution:

changing your function to this could solve the issue:

public function scporder_get_terms_orderby($orderby, $args) {
        if (is_admin())
            return $orderby;

        $tags = $this->get_scporder_options_tags();

        if (!isset($args['taxonomy']))
            return $orderby;

        $taxonomy = $args['taxonomy'];
        if(is_array($taxonomy) && isset( $taxonomy[0] )  ) { // new addition
            $taxonomy = $taxonomy[0];
        }

        if (!in_array($taxonomy, $tags))
            return $orderby;

        $orderby = 't.term_order';
        return $orderby;
    }