Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created December 9, 2018 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/21ff280fb26c3b98120044d53f4e1b61 to your computer and use it in GitHub Desktop.
Save billerickson/21ff280fb26c3b98120044d53f4e1b61 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: 18408 test metabox
* Plugin URI: https://core.trac.wordpress.org/ticket/18408
*/
add_action( 'add_meta_boxes', 'myplugin_add_custom_box' );
function myplugin_add_custom_box() {
add_meta_box(
'myplugin_sectionid',
__( 'My Post Section Title', 'myplugin_textdomain' ),
'myplugin_inner_custom_box',
'post',
'side'
);
}
function myplugin_inner_custom_box() {
global $post;
$a = new WP_Query('post_type=page');
while($a->have_posts() ) : $a->the_post();
endwhile;
wp_reset_postdata();
the_title();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment