Opened 17 years ago
Closed 16 years ago
#6857 closed defect (bug) (invalid)
ob_start on 'admin_head' action broke in 2.5.1
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
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?)) {
ob_start('hide_cats_start');
}
}
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.
Maybe due to [7805]