Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7 from tollmanz/master

Adds support for "context" and "priority" (issue #5)
  • Loading branch information...
commit 662ad155fd867d003b8897bf4a2d2534c0b7d56a 2 parents ff1ac7d + 3b24750
@kovshenin authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 post-options-api.php
View
8 post-options-api.php
@@ -267,7 +267,7 @@ function _admin_init() {
// Adds the metabox for each post type
foreach ( $this->post_types as $post_type => $sections )
foreach ( $sections as $section_id )
- add_meta_box( 'post-options-' . $section_id, $this->sections[$section_id]['title'], array( &$this, '_meta_box_post_options' ), $post_type, 'normal', 'default', array( 'section_id' => $section_id ) );
+ add_meta_box( 'post-options-' . $section_id, $this->sections[$section_id]['title'], array( &$this, '_meta_box_post_options' ), $post_type, $this->sections[$section_id]['context'], $this->sections[$section_id]['priority'], array( 'section_id' => $section_id ) );
// Register the save_post action (for all post types)
add_action( 'save_post', array( &$this, '_save_post' ), 10, 2 );
@@ -426,10 +426,12 @@ function _meta_box_post_options( $post, $metabox ) {
}
// Register a post options section
- public function register_post_options_section( $id, $title ) {
+ public function register_post_options_section( $id, $title, $context = 'advanced', $priority = 'default' ) {
if ( ! isset( $this->sections[$id] ) ) {
$this->sections[$id] = array(
- 'title' => $title
+ 'title' => $title,
+ 'context' => $context,
+ 'priority' => $priority
);
return true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.