Skip to content


Subversion checkout URL

You can clone with
Download ZIP


slt_cf_get_posts_by_custom_first() is broken #10

gyrus opened this Issue · 2 comments

2 participants


This function is certainly broken, returning the query object instead of just the posts.

It may even be fundamentally broken - the usort() seems to just override the sorting by custom field.

Not sure whether to fix it or remove it?

@gyrus gyrus was assigned

I was just trying use this, came here to file a bug report. Obviously I vote to fix ;)


I've had a quick look at this and I think it needs re-doing to make it work. There was one obvious error in that the $slt_cf_second_orderby and $slt_cf_second_order vars weren't declared as global in the slt_cf_order_posts() helper function.

But I think the approach is flawed. Doing it the current way, the usort() will simply erase the meta sorting. I think we need something that gets the ordering parameters right into the SQL. Almost certainly doable, but it's not something that's urgent for me. I imagine it could be easily done "alongside" the plugin by hooking in the query.

I'm putting the code on GitHub now, so maybe someone else can contribute a working version of the function?

@gyrus gyrus added this to the 1.0 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.