Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created December 9, 2018 16:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
<?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