WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#31750 closed defect (bug) (wontfix)

add_meta_box() ignores calls with invalid $priority parameter

Reported by: bobbingwide Owned by:
Milestone: Priority: normal
Severity: trivial Version: 2.5
Component: Posts, Post Types Keywords: dev-feedback
Focuses: Cc:

Description

I incorrectly changed a call to add_meta_box() to adjust the $priority - I used a valid value for the $context parameter.

Actual result:
The meta box callback was not invoked at all

Expected result:
Some form of validation, which would produce one or more of the following

  • Doing it wrong
  • WP_Error returned from the call
  • return( false );


Change History (4)

#1 @bobbingwide
6 years ago

  • Severity changed from normal to trivial

#2 @DrewAPicture
6 years ago

  • Keywords dev-feedback added
  • Version changed from trunk to 2.5

Hi @bobbingwide, could you please provide some sample code to reproduce this issue?

#3 @bobbingwide
6 years ago

This is what I should have had

add_meta_box( 'oik_clone', __( "Clone on update", "oik"), 'oik_clone_box', null, 'side', 'default'  );

This is what had by mistake

add_meta_box( 'oik_clone', __( "Clone on update", "oik"), 'oik_clone_box', null, null, 'side'  );

#4 @wonderboymusic
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

add_meta_box() is low-level enough, the code is pretty clear with what it supports for priority ('high', 'core', 'default', 'low') - not inclined to add extra debugging logic here.

Note: See TracTickets for help on using tickets.