Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#6857 closed defect (bug) (invalid)

ob_start on 'admin_head' action broke in 2.5.1

Reported by: rainwater Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.5.1
Component: General Keywords:
Focuses: Cc:


We currently use a 'admin_head' filter in our theme to hide specific categories on the post-new.php page for specific user roles. However, in 2.5.1, there is some type of change that results in the output dying and not getting past the html head code. Here is an example of the code:

function hide_cats_shell() {

$out = '<div></div>'; real code would output only specific categories return $out;


function hide_cats_start($c) {

return preg_replace('|<div id="categories-all" class="ui-tabs-panel">.*?</div>|sie', hide_cats_shell(), $c);


function hide_cats($unused) {

if(preg_match('|/wp-admin/post-new.php|', $_SERVERREQUEST_URI?)) {



} add_action('admin_head', 'hide_cats');

The above code now results in the only the head html being output to the browser. Because of this we have had to downgrade our site to 2.5.0 in order to continue using it.

Change History (4)

#1 @ryan
10 years ago

Maybe due to [7805]

#2 @rainwater
10 years ago

I tried commenting that out, but the issue still occurs. It does appear it could cause problems by dropping the buffer there though. Unfortunately, there must of been another change causing this particular issue.

#3 @ryan
10 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

#4 @DD32
9 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Given that this has been broken for 2 major releases aparantly, I'm closing as invalid, on the thought that this is most likely invalid under todays trunk, Re-open if necessary

Note: See TracTickets for help on using tickets.