Support » Plugin: Simple Page Ordering » Sorting anything other than 'All' bug

  • Resolved RichieAHB

    (@richieahb)


    If you select “published” or “draft” and then select “sort by order” the & html entity #038 is used in the URL rather than an ampersand for the query string which results in no posts being loaded. E.g. myurl.com/wp-admin/edit.php?post_status=publish&orderby=menu_order+title&order=asc#038;post_type=promotion

    I guess this would be a relatively simple bug fix?

    Apart from that I’ve never had a problem with this plugin, it should be in core!

    https://wordpress.org/plugins/simple-page-ordering/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jake Goldman

    (@jakemgold)

    10up Engineer

    This is fixed in 2.2.4

    I’m experiencing the same issue in 2.2.4 It looks like the ampersand encoding is being done by https://codex.wordpress.org/Function_Reference/esc_url

    I moved the escape_url call to sprintf function and it’s working again for me:

    public static function sort_by_order_link( $views ) {
        $class = ( get_query_var('orderby') == 'menu_order title' ) ? 'current' : '';
        $query_string = remove_query_arg( array( 'orderby', 'order' ) );
        if ( ! is_post_type_hierarchical( get_post_type() ) ) {
        	$query_string = add_query_arg( 'orderby', 'menu_order title', $query_string );
        	$query_string = add_query_arg( 'order', 'asc', $query_string );
        }
    
        $views['byorder'] = sprintf('<a href="%s" class="%s">%s</a>', esc_url( $query_string ), $class, __("Sort by Order", 'simple-page-ordering'));
    
        return $views;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sorting anything other than 'All' bug’ is closed to new replies.