- Timestamp:
- Feb 24, 2011, 6:58:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/include/xpress_block_header.php
r655 r683 69 69 $header_str = ob_get_contents(); 70 70 ob_end_clean(); 71 72 if(function_exists('_admin_bar_bump_cb')){ 73 //remove admin_bar_bump_cb 74 ob_start(); 75 _admin_bar_bump_cb(); 76 $admin_bar_bump_cb_str = ob_get_contents(); 77 ob_end_clean(); 78 $header_str = str_replace_ex($admin_bar_bump_cb_str,'',$header_str); 79 } 80 81 if(function_exists('wp_admin_bar_header')){ 82 //remove wp_adminbar_header 83 ob_start(); 84 wp_admin_bar_header(); 85 $wp_admin_bar_header_str = ob_get_contents(); 86 ob_end_clean(); 87 $header_str = str_replace_ex($wp_admin_bar_header_str,'',$header_str); 88 } 89 71 90 $pattern = '<\s*link\s+rel\s*=[^>]*?>'; 72 91 $header_str = preg_replace("/".$pattern."/s" , '' , $header_str); … … 79 98 $pattern = "^"; 80 99 $header_str = preg_replace("/".$pattern."/m" , "\t" , $header_str); 81 ob_start(); 100 101 ob_start(); 102 global $show_admin_bar; 103 $show_admin_bar = false; //remove adminbar 82 104 wp_footer(); 83 105 $footer_str = ob_get_contents(); … … 99 121 xpress_block_header_cash_write($mydirname,$data); 100 122 } 123 124 function str_replace_ex($regx,$replace,$str){ 125 126 if (empty($regx)) return $str; 127 $pattern = preg_quote($regx,'/'); 128 if (preg_match('/\r/',$pattern)){ 129 $pattern=preg_replace('/\r/','\\r',$pattern); 130 } 131 if (preg_match('/\n/',$pattern)){ 132 $pattern=preg_replace('/\n/','\\n',$pattern); 133 } 134 if (preg_match('/\t/',$pattern)){ 135 $pattern=preg_replace('/\t/','\\t',$pattern); 136 } 137 $pattern = '/'. $pattern . '/'; 138 if (preg_match($pattern,$str)){ 139 $str=preg_replace($pattern,$replace,$str); 140 } 141 return $str; 142 } 101 143 102 144 }
Note: See TracChangeset
for help on using the changeset viewer.