' . __('Configure how community suggestions work on your site.', 'pc-community-suggestions-7d3f') . '
';
}
public function render_sort_field() {
$default_sort = get_option('pc_community_suggestions_default_sort', 'popular');
?>
render_suggestions_table($sort); ?>
prefix . 'pc_community_suggestions';
$order_by = $sort === 'newest' ? 'created_at DESC' : 'upvotes DESC, created_at DESC';
$suggestions = $wpdb->get_results(
"SELECT s.*, u.user_login, u.display_name
FROM $table_name s
LEFT JOIN {$wpdb->users} u ON s.user_id = u.ID
ORDER BY $order_by"
);
?>
|
|
|
|
|
|
|
title); ?>
|
display_name ?: $suggestion->user_login); ?> |
upvotes); ?> |
created_at)); ?> |
|
0) {
PC_Community_Suggestions_Database::delete_suggestion($suggestion_id);
wp_redirect(admin_url('admin.php?page=pc_community_suggestions&deleted=1'));
exit;
}
wp_redirect(admin_url('admin.php?page=pc_community_suggestions&error=1'));
exit;
}
}
' . esc_html__('No comments yet.', 'pc-community-suggestions-7d3f') . '
'; } else { foreach ($comments as $comment) { echo '