Skip to content

Commit

Permalink
Fix for PHP warning caused by missing DB table.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Vicenik authored and Martin Vicenik committed Nov 16, 2018
1 parent 5e70276 commit 0969392
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function __construct() {

function admin_menu(){
global $wpdb;
if( current_user_can('edit_posts') && $wpdb->get_var("SELECT count(*) FROM {$wpdb->prefix}fv_player_players") ) {
if( current_user_can('edit_posts') && $wpdb->get_var("SHOW TABLES LIKE '{$wpdb->prefix}fv_player_players'") == $wpdb->prefix.'fv_player_players' && $wpdb->get_var("SELECT count(*) FROM {$wpdb->prefix}fv_player_players") ) {
add_menu_page( 'FV Player', 'FV Player', 'edit_posts', 'fv_player', '', 'dashicons-welcome-widgets-menus', 30 );
add_submenu_page( 'fv_player', 'FV Player', 'FV Player', 'edit_posts', 'fv_player', array($this, 'tools_panel') );
}
Expand Down

0 comments on commit 0969392

Please sign in to comment.