wp rest api orderby field in a custom table
This is the solution in the mentioned link if we want to use meta value to order the rest API content: // Add meta your meta field to the allowed values of the REST API orderby parameter add_filter( ‘rest_’ . $post_type . ‘_collection_params’, function( $params ) { $params[‘orderby’][‘enum’][] = ‘YOUR_META_KEY’; return $params; }, 10, 1 … Read more