Title: ventatto's Replies | WordPress.org

---

# ventatto

  [  ](https://wordpress.org/support/users/ventatto/)

 *   [Profile](https://wordpress.org/support/users/ventatto/)
 *   [Topics Started](https://wordpress.org/support/users/ventatto/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ventatto/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ventatto/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ventatto/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ventatto/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ventatto/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 67 total)

1 [2](https://wordpress.org/support/users/ventatto/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/ventatto/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/ventatto/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/ventatto/replies/page/5/?output_format=md)
[→](https://wordpress.org/support/users/ventatto/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Age column not displayed in player list with current season](https://wordpress.org/support/topic/age-column-not-displayed-in-player-list-with-current-season/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/age-column-not-displayed-in-player-list-with-current-season/#post-18025223)
 * Surprisingly, without doing anything, ‘Age’ column came back in the meantime…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Age column not displayed in player list with current season](https://wordpress.org/support/topic/age-column-not-displayed-in-player-list-with-current-season/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/age-column-not-displayed-in-player-list-with-current-season/#post-17980249)
 * First player list:
 * ![](https://i0.wp.com/www.saintlouisbasket.be/wp-content/uploads/2021/07/PL_1A.
   png?ssl=1)
 * ![](https://i0.wp.com/www.saintlouisbasket.be/wp-content/uploads/2021/07/PL_1B.
   png?ssl=1)
 * ![](https://i0.wp.com/www.saintlouisbasket.be/wp-content/uploads/2021/07/PL_1C.
   png?ssl=1)
 * Second player list:
 * ![](https://i0.wp.com/www.saintlouisbasket.be/wp-content/uploads/2021/07/PL_2A.
   png?ssl=1)
 * ![](https://i0.wp.com/www.saintlouisbasket.be/wp-content/uploads/2021/07/PL_2B.
   png?ssl=1)
 * ![](https://i0.wp.com/www.saintlouisbasket.be/wp-content/uploads/2021/07/PL_2C.
   png?ssl=1)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Player list columns selection inactive](https://wordpress.org/support/topic/player-list-columns-selection-inactive/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/player-list-columns-selection-inactive/#post-16026247)
 * Do you have an idea of a potential solution ?
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Player list columns selection inactive](https://wordpress.org/support/topic/player-list-columns-selection-inactive/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/player-list-columns-selection-inactive/#post-16008229)
 * Hi,
 * I added the desired screenshots [on the same page as before](https://www.saintlouisbasket.be/non-classe/player-list-bug-screenshots/)
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Player list columns selection inactive](https://wordpress.org/support/topic/player-list-columns-selection-inactive/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/player-list-columns-selection-inactive/#post-16005794)
 * Just did it (troubleshooting with only SportsPress enabled and cleared cache)
   with three themes but still the same issue…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Player list columns selection inactive](https://wordpress.org/support/topic/player-list-columns-selection-inactive/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/player-list-columns-selection-inactive/#post-16005200)
 * Hi,
 * I have just given a try with `Rookie` and `TwentyTwenty` but still the same problem.
 * Indeed in your examples it works as it should be but in several of my player 
   lists as well. The issue only occurs for few player lists, like the one in the
   provided link.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Player list columns selection inactive](https://wordpress.org/support/topic/player-list-columns-selection-inactive/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/player-list-columns-selection-inactive/#post-15994708)
 * It is the case, I have the same result using shortcode or not, which is problematic.
   What I said initially is that two different player lists with the same column
   properties do not display the same outcome format (the one I refer to with the
   screenshots seems to not take the columns selection into account)…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] Player list columns selection inactive](https://wordpress.org/support/topic/player-list-columns-selection-inactive/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/player-list-columns-selection-inactive/#post-15994415)
 * Hi,
 * Here is the shortcode : `[player_list 16599]` (but the same problem occurs when
   displaying directly the player list without shortcode).
 * [And here are some screenshots](https://www.saintlouisbasket.be/non-classe/player-list-bug-screenshots/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SportsPress - Sports Club & League Manager] How to get in touch with the Slack workspace administrator](https://wordpress.org/support/topic/how-to-get-in-touch-with-the-slack-workspace-administrator/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/how-to-get-in-touch-with-the-slack-workspace-administrator/#post-14205962)
 * Great it works and I could do my first message 🙂
 * Thanks a lot !
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [parse_query() orderby date ignoring year](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/page/2/#post-14183835)
 * I tried again several times differently but still the same issue…
 * I eventually looked for another way to address the problem and found a reordering
   after doing `get_posts($posts)`. Here it is :
 *     ```
       function cmp_birthday($a, $b)
       {
           $month1 = date('m', strtotime($a->post_date));
           $month2 = date('m', strtotime($b->post_date));
           $cmp = strcasecmp($month1, $month2);
           if ($cmp == 0)
           {
               $day1 = date('d', strtotime($a->post_date));
               $day2 = date('d', strtotime($b->post_date));
               return strcasecmp($day1, $day2);
           }
           else
               return $cmp;
       }
       usort($posts, "cmp_birthday");
       ```
   
 * I really want to thank you for the time you spent trying to find a solution for
   me.
 * Best regards.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [parse_query() orderby date ignoring year](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/#post-14176744)
 * Just did it (at the end of `functions.php` only because I don’t find a suitable
   main plugin file). Still the same issue with the function which is well entered
   and returned but after the players having been displayed in the wrong default
   order…
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [parse_query() orderby date ignoring year](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/#post-14168209)
 * Ok I understand, that was absolutely not how I was seeing it. Thanks for it.
 * Therefore I tried to add my filter before. I did a `debug_print_backtrace()` 
   to see the callers until the query creation and tried to add my filter but unfortunately,
   no one worked (I did the tries in the calling function of two of the plugin files
   as well as in `class-wp-widget.php` and `widgets.php`)
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [parse_query() orderby date ignoring year](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/#post-14166336)
 * The problem is that the associated query is created just before the call to `
   add_filter()` in my code. So if I move my `add_filter()` in the caller for example,
   there’s no query to pass imo…
 * I tried another way with a closure (to ensure that the query was the one I wanted)
   but it was not more successful…
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [parse_query() orderby date ignoring year](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/#post-14155921)
 * I verified and it correctly enters in the condition. When I `echo` the value 
   of `$orderby` before the `return` in `birthday_sort()`, it contains what is expected.
   But these birthdays are displayed in a widget and while debugging, I noticed 
   that it was entering the function (and so executing `add_filter()`) in the widget
   following the “Birthdays” one (my `echo` were displayed in the following widget)…
   I don’t know if it can help getting the solution
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [parse_query() orderby date ignoring year](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/)
 *  Thread Starter [ventatto](https://wordpress.org/support/users/ventatto/)
 * (@ventatto)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/parse_query-orderby-date-ignoring-year/#post-14149489)
 * Alright I removed `pre_get_posts`. However, I don’t only want the month number
   as criteria since I want them to be ordered by anniversary. If I have someone
   who’s anniversary is on 12/03 and another one on 14/03, I want to be sure that
   the 14/03 appears after the 12/03, which would be random by only looking at the
   month number.
 * However, I tried your solution as well as an adaptation of it with `DAY` instead
   of `MONTH` but the order remains unchanged when `get_posts( $args )` is called
   afterwards.
 *     ```
       add_filter( 'posts_orderby', 'birthday_sort', 10, 2 );
       function birthday_sort( $orderby, $args ) {
           if ( ! is_admin() && 'post_date' === $args->get( 'orderby' ) ) {
               global $wpdb;
   
               $order = ( 'ASC' === strtoupper( $args->get( 'order' ) ) ) ? 'ASC': 'DESC';
   
               $orderby = 'DAY( post_date ) ASC';
           }
   
           return $orderby;
       }
       ```
   

Viewing 15 replies - 1 through 15 (of 67 total)

1 [2](https://wordpress.org/support/users/ventatto/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/ventatto/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/ventatto/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/ventatto/replies/page/5/?output_format=md)
[→](https://wordpress.org/support/users/ventatto/replies/page/2/?output_format=md)