Thursday, January 26, 2023
HomeWordPress Developmentphp - Methods to type customized sortable column by customized desk worth

php – Methods to type customized sortable column by customized desk worth


I’ve a customized desk with information in it that I’m exhibiting in a column. I want to make this column sortable.

Let’s imagine that the customized desk has three values for the sake of simplicity.

row_id, post_id, worth

The place, post_id is the id of a submit somwhere on the location.

Now in that submit sorts customized column I present the worth of the brand new desk, and I want to type the the column by that worth.

The way in which I’ve been attempting to do it’s to do a LEFT OUTER JOIN on the ‘be a part of’ of the WP_query. (I’ve tried on pre_get_posts motion and the post_clauses motion.)

Nevertheless I’ve been caught on this downside for fairly some time.

How would you go about sorting the column by the information discovered on this customized desk? (With out resorting to meta values)

Let me know if that is sensible.

Thanks.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments