Display custom taxonomy as dropdown list

Below is the easiest solution I use for displaying custom taxonomy as the dropdown instead of checkboxes. 1/ Use third party WordPress plugin ‘ACF’ to create the taxonomy ‘Relational’ field type and display it as dropdown as shown in below screenshot. https://wordpress.org/plugins/advanced-custom-fields/ For displaying taxonomy selected you can refer documentation of ACF for relational taxonomy … Read more

ElasticPress how to Include Meta to the mapping?

Solution 1 I haven’t tested the plugin, but based on this code from the link in your question: apply_filters( ‘ep_prepare_meta_whitelist_key’, false, $key, $post ) You can do something like this to explicitly allow a protected/private meta key: add_filter( ‘ep_prepare_meta_whitelist_key’, function( $allow, $meta_key ){ $meta_keys = [‘_one’, ‘_two’, ‘_etc’]; // meta keys you want to allow … Read more

Changing BIGINT to INT

There should not be any downside. The user ID is cast to int in many places in the WP PHP files anyway. But I don’t think this is a real performance problem. If your queries are slow, it might be more useful to inspect each of them and look for opportunities to improve the queries … Read more

Taking WordPress table prefixes into account

You can rewrite the code like this: // setting posts with current date or older to draft if (!wp_next_scheduled(‘sfn_expire_hook’)){ wp_schedule_event( time(), ‘hourly’, ‘sfn_expire_hook’); } add_action( ‘sfn_expire_hook’, ‘sfn_show_expire’); function sfn_show_expire(){ global $wpdb; $server_time = date(‘mdy’); $result = $wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_type=”show” AND post_status=”publish””); if( !empty($result)) foreach ($result as $a){ $show_time = get_the_time(‘mdy’, $a->ID); if … Read more