How to verify meta box is registered in Unit Testing?

Here is what i have did as a workaround, i realized we cant do that in TDD way.so its better to write the code first instead of writing the test when you face this problem. So in my code i have added this add_meta_box( ‘meta-box-id’, __( ‘My Meta Box’, ‘textdomain’ ), ‘wpdocs_my_display_callback’, ‘post’ ); and … Read more

validate a metabox based on the category that is selected

Apologies for the delay – what I did was basically created a .js file and places it within my theme folder – for example themes/nameoftheme/custom/checkcode.js Then using jquery – I created my code – here’s a snippet: jQuery(‘#in-category-6’).click(function(){ jQuery(‘#metabox_one’).toggle(this.checked); jQuery(‘#metabox_two’).hide(); jQuery(‘#metabox_three’).hide(); jQuery(‘#in-category-3’).attr(‘checked’, this.checked); jQuery(‘#in-category-1’).attr(‘checked’, false); jQuery(‘#in-category-4’).attr(‘checked’, false); jQuery(‘#in-category-5’).attr(‘checked’, false); jQuery(‘#in-category-7’).attr(‘checked’, false); jQuery(‘#in-category-8’).attr(‘checked’, false); jQuery(‘#in-category-9’).attr(‘checked’, false) … Read more

How to construct multiple meta boxes

You can create as many metaboxes as you want. Use a function to create them then hook into init. The first line should be $meta_boxes = array(); then start each new metabox with $meta_boxes[] = array( add_action( ‘init’, ‘prefix_create_metaboxes’ ); function prefix_create_metaboxes() { $meta_boxes = array(); $meta_boxes[] = array( ‘id’ => ‘venue_location’, ‘title’ => ‘Venue/Location’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)