Tag Info

Hot answers tagged

2

If you just want to check if a meta value exists before outputting markup, then if( get_post_meta( $post->ID, '_cmb_linkCheckbox', true ) ){ ?> <section id="footerLinks"> <?php // your markup... ?> </section> <?php } or if the value is "on": if( 'on' == get_post_meta( $post->ID, '_cmb_linkCheckbox', ...


1

EDIT You should be using date_create_from_format or its alias DateTime::createFromFormat() to convert on format to another. You can try the following $date = DateTime::createFromFormat('m-d-Y', '03-09-2015'); echo $date->format('d-m-Y'); This will convert 03-09-2015 to 09-03-2015 ORIGINAL ANSWER This is more a PHP question than Wordpress question. ...


1

The problem here is a slight error in the origianl code. Near the bottom of the save_sticky_metabox() callback, change the line - if(isset($_POST['was_checked'])) : To this - if($_POST['was_checked'] != 0) : The was_checked value is derived from a hidden field, not a checkbox, so regardless of the value it will always be set. Therefore we need to ...



Only top voted, non community-wiki answers of a minimum length are eligible