Looking into how order_by_field_number
works, internally it’s converted into a parameter for WP_Query
called meta_value_num
, which in turn uses WP_Meta_Query
with meta_type
set to NUMERIC
to construct an SQL statement to query the database and sort by field value.
So, the way it handles empty fields with value NULL
is dependent on WordPress internals and the resulting MySQL query, which is impossible (or very tricky/difficult) to modify from the L&L plugin.
As Ben suggested above, using sort_field
with sort_type=number
can be more flexible, because it runs after the database query is performed. Looking into its code, it seems that an empty field value is treated as 0
(zero) - but if not, we can improve its behavior to control how it works.
As for hide_empty
, I found that it’s only implemented in the taxonomy term loop type, and it works by filtering out terms that have no associated posts.