Dynamically adding WYSIWYG to metaboxes

I am not sure if this is what you want: (Source: https://stackoverflow.com/questions/3493313/how-to-add-wysiwyg-editor-in-wordpress-meta-box) add_action( ‘add_meta_boxes’, ‘adding_new_metaabox’ ); function adding_new_metaabox() { add_meta_box(‘html_myid_61_section’, ‘TITLEE Helloo’, ‘my_output_function’); } function my_output_function( $post ) { //so, dont ned to use esc_attr in front of get_post_meta $valueeee2= get_post_meta($_GET[‘post’], ‘SMTH_METANAME_VALUE’ , true ) ; wp_editor( htmlspecialchars_decode($valueeee2), ‘mettaabox_ID_stylee’, $settings = array(‘textarea_name’=>’MyInputNAME’) ); } function … Read more

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

Hide meta box based on post format

Try this one: jQuery( document ).ready( function($) { // Starts by hiding the “Video Options” meta box $( “#video-options” ).addClass( “hidden” ); if( $( “input#post-format-video” ).is(‘:checked’) ){ $( “#video-options” ).removeClass( “hidden” ); } // If “Video” post format is selected, show the “Video Options” meta box $( “input#post-format-video” ).change( function() { if( $(this).is(‘:checked’) ){ $( … Read more

Are there any standard HTML markup for metabox?

WordPress.org UI Style Guide site has some reference materials, including those on Box Formats and Forms. As far as I remember it’s not consistently maintained or considered especially canonical source. In practice elements are often done after studying current state of actual admin markup.