Ticket #3454: 3454.patch
File 3454.patch, 1.7 KB (added by , 13 years ago) |
---|
-
bp-core/deprecated/1.5.php
61 61 * @since 1.1 62 62 */ 63 63 function bp_core_add_admin_menu_page( $args = '' ) { 64 global $menu, $admin_page_hooks, $_registered_pages; 65 64 66 $defaults = array( 65 67 'page_title' => '', 66 68 'menu_title' => '', 67 ' capability' => 'manage_options',68 'file' => '',69 'function' => '',70 'icon_url' => '',69 'access_level' => 2, 70 'file' => false, 71 'function' => false, 72 'icon_url' => false, 71 73 'position' => 100 72 74 ); 73 75 74 76 $r = wp_parse_args( $args, $defaults ); 75 77 extract( $r, EXTR_SKIP ); 76 78 79 $file = plugin_basename( $file ); 80 $hookname = get_plugin_page_hookname( $file, '' ); 81 82 $admin_page_hooks[$file] = sanitize_title( $menu_title ); 83 84 if ( !empty( $function ) && !empty ( $hookname ) ) { 85 add_action( $hookname, $function ); 86 } 87 88 if ( empty($icon_url) ) { 89 $icon_url = 'images/generic.png'; 90 } elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) { 91 $icon_url = 'https://' . substr($icon_url, 7); 92 } 93 94 do { 95 $position++; 96 } while ( !empty( $menu[$position] ) ); 97 98 $menu[$position] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 99 100 $_registered_pages[$hookname] = true; 101 77 102 _deprecated_function( __FUNCTION__, '1.5', 'Use add_menu_page()' ); 78 return add_menu_page( $page_title, $menu_title, $capability, $file, $function, $icon_url, $position );79 }80 103 104 return $hookname; 105 } 81 106 /** Activity ******************************************************************/ 82 107 83 108 function bp_is_activity_permalink() {