سلام علیکم
وقتی متغییر جدول را Var_dum میکنم اطلاعات جدول رو در صفحه بصورت String دریافت میکنم ولی داخل حلقه اررور میده! کدها خدتان ارسال میشود
//action
add_action('admin_menu','wp_apis_register_menu');
//function
function wp_apis_register_menu()
{
add_menu_page(
'پلاگین سفارشی',
'پلاگین سفارشی',
'manage_options',
'wp_apis_admin',
'wp_apis_mans_main_handler'
);
add_submenu_page(
'wp_apis_admin',
'تنظیمات',
'تنظیمات',
'manage_options',
'wp_apis_general',
'wp_apis_general_page'
);
}
function wp_apis_mans_main_handler()
{
global $wpdb;
$users = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}users");
include WP_APIS_TPL.'admin/menus/main.php';
}
function wp_apis_general_page()
{
if (isset($_POST['saveSettings']))
{
//$is_checkbox_active = isset($_POST['is_checkbox_active']) ? 1 : 0;
//add_option('wp_apis_plugin_active',$is_checkbox_active);
if(isset($_POST['is_checkbox_active'])){
update_option('wp_apis_plugin_active',1);
}else{
delete_option('wp_apis_plugin_active');
}
$current_plugin_status = get_option('wp_apis_plugin_active');
}
include WP_APIS_TPL.'admin/menus/general.php';
}
<div class="wrap">
<h1>لیست اطلاعات h1>
<table class="widefat">
<thead>
<tr>
<th>شناسهth>
<th>نام کاربریth>
<th>رمز عبورth>
<th>نامth>
<th>ایمیلth>
<th>ای پی کاربرth>
<th>تاریخ ورودth>
<th>فعالیتth>
<th>وضعیتth>
tr>
thead>
<tbody>
foreach($users as $user): ?>
<tr>
<td> echo $users->ID; ?>td>
<td> echo $users->user_login; ?>td>
<td> echo $users->user_pass; ?>td>
<td> echo $users->user_nicename; ?>td>
<td> echo $users->user_email; ?>td>
<td> echo $users->user_url; ?>td>
<td> echo $users->user_registered; ?>td>
<td> echo $users->user_activation_key; ?>td>
<td> echo $users->user_status; ?>td>
tr>
endforeach; ?>
tbody>
table>
div>