cmb2 select option output [closed]

If you need to display select options value rather then key then you have to use an options callback function for this. like this, add_action( ‘cmb2_admin_init’, ‘your_function_name’ ); function your_function_name() { $prefix = ‘your_prifix_’; /** * Sample metabox to demonstrate each field type included */ $cmb = new_cmb2_box( array( ‘id’ => $prefix . ‘metabox’, ‘title’ … Read more

Send email notification when meet the condition

You can use this code to automatically send an email whenever a post of the type one is published. This goes into your theme’s functions.php : <?php function post_published_notification( $ID, $post ) { $type = get_post_type($ID); if ($type == ‘post-type-one’){ $author = $post->post_author; /* Post author ID. */ $name = get_the_author_meta( ‘display_name’, $author ); $email … Read more

Add country flags

Best solution is to import data from 3rd party API into your database. By this you do not need to rely on any API. Your page performance will also be increased as it will reduce external request. So you need to do one time job to fetch all the data from API, stores it into … Read more

Generate all urls with https

This sounds like a bug in the plugin, and they should fix it. But if they don’t, you can always add a filter to home_url and change all http:// to https:// like so: add_filter( ‘home_url’, ‘wpse_259675_home_url’, 1000, 4 ); function wpse_259675_home_url( $url, $path, $orig_scheme, $blog_id ) { return str_replace( ‘http://’, ‘https://’, $url ); }