$arr ){ $count+= count( $arr ); } update_option( 'ubermenu-post-var-count' , $count ); } else{ $count = get_option( 'ubermenu-post-var-count' , 0 ); } return $count; } function ubermenu_item_limit_notice(){ $screen = get_current_screen(); if( $screen->id != 'nav-menus' ) return; $var_count = ubermenu_count_menu_post_vars(); //$var_count = 4900; $r = array(); //restrictors $r['suhosin_post_maxvars'] = ini_get( 'suhosin.post.max_vars' ); $r['suhosin_request_maxvars'] = ini_get( 'suhosin.request.max_vars' ); $r['max_input_vars'] = ini_get( 'max_input_vars' ); //$r['max_input_vars'] = 1355; if( $r['suhosin_post_maxvars'] != '' || $r['suhosin_request_maxvars'] != '' || $r['max_input_vars'] != '' ){ $message = array(); if( ( $r['suhosin_post_maxvars'] != '' && $r['suhosin_post_maxvars'] != 0 && $r['suhosin_post_maxvars'] < 1000 ) || ( $r['suhosin_request_maxvars']!= '' && $r['suhosin_request_maxvars']!= 0 && $r['suhosin_request_maxvars'] < 1000 ) ){ $message[] = __( "Your server is running Suhosin, and your current maxvars settings may limit the number of menu items you can save." , 'ubermenu' ); } //150 ~ 10 left foreach( $r as $key => $val ){ if( $val > 0 ){ if( $val - $var_count < 150 ){ $message[] = __( "You are approaching the post variable limit imposed by your server configuration. Exceeding this limit may automatically delete menu items when you save. Please increase your $key directive in php.ini. More information" , 'ubermenu' ); } } } if( !empty( $message ) ): ?>