Widgets added and PHP error fixed for version < 5.2

This commit is contained in:
Brian Miyaji
2014-02-05 19:51:28 +11:00
parent d1df5b757a
commit 1c0bc6a468
19 changed files with 359 additions and 143 deletions

View File

@@ -1,20 +1,17 @@
<?php
function sportspress_admin_menu( $position ) {
if ( ! current_user_can( 'manage_options' ) )
return;
global $menu, $submenu;
// Find where our placeholder is in the menu
foreach( $menu as $key => $data ) {
foreach( $menu as $key => $data ):
if ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' )
$position = $key;
}
$seperator_position = $key;
endforeach;
// Swap our placeholder post type with a menu separator
if ( $position ):
$menu[ $position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
if ( $seperator_position ):
$menu[ $seperator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
endif;
// Remove "Venues" and "Positions" links from Media submenu
@@ -66,4 +63,4 @@ if ( ! function_exists( 'sportspress_admin_menu_remove_venues' ) ) {
function sportspress_admin_menu_remove_venues( $arr = array() ) {
return $arr[0] != __( 'Venues', 'sportspress' );
}
}
}