• This plugin throws this error because of a check against an argument that may not be set – this fix should overcome that:

    // By default, the array is sorted ASC; sort DESC if needed
    if (
        (
            isset( $args['order'] )
            && isset( $args['orderby'] )
            && $args['orderby'] == $this->orderby_parameter
            && $args['order'] == 'DESC'
         ) || (
            isset( $args['orderby'] )
            && $args['orderby'] != $this->orderby_parameter
            && $this->get_sort_order() == 'DESC'
         )
    ) {
        krsort( $ordered_terms );
    }

    https://www.ads-software.com/plugins/custom-taxonomy-sort/

Viewing 1 replies (of 1 total)
  • @qstudio is correct. You should change this twice in the plugin.

    Line 295 should become:

    if ( isset($args['orderby']) && $this->get_control_type() == 'off' && $args['orderby'] != $this->orderby_parameter ) return $terms;

    Lines 328-331 should become:

    if (
        (
            isset( $args['order'] )
            && isset( $args['orderby'] )
            && $args['orderby'] == $this->orderby_parameter
            && $args['order'] == 'DESC'
         ) || (
            isset( $args['orderby'] )
            && $args['orderby'] != $this->orderby_parameter
            && $this->get_sort_order() == 'DESC'
         )
    ) {
        krsort( $ordered_terms );
    }

    But even then, things seem wonky at best. There are several other post sorting plugins and I would suggest avoiding this one. It hasn’t been updated in four years.

    One alternative we’ve been okay with that comes with a nagging donation screen: https://www.ads-software.com/plugins/post-types-order/

Viewing 1 replies (of 1 total)
  • The topic ‘Illegal string offset 'orderby'’ is closed to new replies.