Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22923 closed defect (bug) (invalid)

add_meta_box() ignores $context='side' if $post_type = 'page' & $id is exactly 'myplugin_sectionid'

Reported by: savesenergy's profile SavesEnergy Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.5
Component: Administration Keywords:
Focuses: Cc:


This one's so strange I can hardly believe it -- but it reproduces every time. Running latest public version of WP (3.5), fresh install (no added plugins) downloaded yesterday from, on a WAMP Server running Windows XP [though I don't see how that could be relevant here].

Steps to reproduce:

  1. Start with WP install of (version from yesterday, not today, if any changes made)
  1. Create a new plugin. Fill in the code from, first code sample under "Example".
  1. Change
        __( 'My Post Section Title', 'myplugin_textdomain' ), 


        __( 'My Post Section Title', 'myplugin_textdomain' ), 
  1. Load a new page. Dashboard > Pages > Add New.

Expected results: "My Post Section" appears to the side.
Actual results: "My Post Section" appears below the editing area (as if 'side' was not supplied).

The very strange particular is if I change 'myplugin_sectionid' to ANYTHING else -- say 'myplugin2_sectionid', it works correctly.

Also, if I make the same change to the 'post' example instead of the 'page' one, it works correctly. How bizarro is that?

Change History (3)

#1 @helenyhou
10 years ago

  • Keywords reporter-feedback added

Starting with the second snippet (which is missing a comma after 'page') puts the metabox in the side as expected. I suspect that this is happening because you previously moved the metabox on the screen, which is saved as a setting and overrides where the code tells it to go. Can you reproduce either on a clean install or with a different user (since the metabox position settings are a user preference)? You can also delete the preference (meta-box-order_page for that user in the usermeta table) if you like.

#2 @SavesEnergy
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Concerning the code, yes, you're right -- my mistake. And deleting the preference and re-running the code it consistently places it correctly, so this is definitely closed. I didn't think I moved it, but I had copied the code first as given and executed it that way, before changing it -- and maybe I had and just didn't remember. Apologies for the unnecessary ticket: great response time though! :D

#3 @helenyhou
10 years ago

  • Component changed from General to Administration
  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution changed from fixed to invalid
Note: See TracTickets for help on using tickets.