Best performance for use Custom Field in WP

Neither will be faster because the root of the performance problem is the WP table design, not the plugin. The post meta table is optimised for finding values when you already know the post ID/keys, it’s not designed for searches, though there are mitigations. Searches/grouping/finding is what the taxonomy tables were created for. Finding all … Read more

Display custom post type attached media file sizes

From your array, you should get the Media ID of the videos. If you have the media ID, it will be as listed below: // Let’s say you have the media ID $meta = filesize( get_attached_file( $attachment_id ) ); By using the size format function you can list the size echo size_format($meta); Update according to … Read more

Custom Sort Order for Custom Post Type Taxonomy

Use usort with a custom callback, like this: function compare_term_order_numbers( \WP_Term $a, \WP_Term $b ) : int { $order_number_a = get_field( ‘order_number’, $a ); $order_number_b = get_field( ‘order_number’, $b ); return strcmp( $order_number_a, $order_number_b ); } usort($terms, ‘compare_terms’ ); Note that this assumes get_field returns a plain string, not an object, that each term has … Read more