Working code for adding widget to wp dashboard with information from custom DB:
/**
* Add application widget to the dashboard.
*/
function addApplicationWidget() {
wp_add_dashboard_widget(
'submitted_applications',
'Submitted Applications',
'showApplicants'
);
}
add_action( 'wp_dashboard_setup', 'addApplicationWidget' );
function showApplicants() {
global $wpdb;
$appTable = $wpdb->prefix . "applications";
$query = $wpdb->prepare("SELECT * FROM $appTable WHERE %d >= '0'", RID);
$applications = $wpdb->get_results($query);
foreach ( $applications as $application ) {
echo $application->title . " " . $application->app_firstName . " " . $application->app_surName . "<br/>";
}
}
Related Posts:
- How to find if a post with custom_field == X exists?
- Custom search page and search by title, content and tag
- $wpdb->replace: WHERE?
- How to remove admin menu pages inserted by plugins?
- WordPress Paginate $wpdb->get_results
- Backup the Database and Restore from the Backup?
- Custom Search Query
- Modify custom Users Manage page
- Can I use $wpdb for my custom tables in the WordPress database?
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- How to get value from custom backend menu
- What Is The Difference Between suppress_errors() And hide_errors() in $wpdb?
- Prevent WordPress from loading comments
- Suggestions for WPMU Migration (advanced)
- Modifying loop on a custom page, strange behaviour
- How to add another page in appearance tab of admin panel?
- What’s the proper way to use a custom table? [closed]
- How to retrieve the value stored in a multi-dimensional array and SUM the entries?
- $wp_customize->remove_section for customizer setting?
- Adding a Table to the wordpress database
- Creating user relationships
- Admin Panel – Custom Menu Sub-Item LINK
- WP Northwind for Theme Development?
- How I display post of the post type group by year of post?
- Load more posts with multiple queries
- Fastest way to get the comment and ping total count for a post
- Hi, I wanted to make custom search with multiple fields
- wp_query get post custom taxonomy in search.php
- Order posts with a custom field but also without
- How to use default WP form elements to interact with custom DB table?
- Save title as custom field on custom post type
- Your thoughts on the interaction with one custom database table from WP?
- Add content in between of foreach
- Custom Loop Query For Search Page
- Custom SELECT Query With Multiple Meta Values (Ordering Problem)
- Applying WP-cli Search & Replace to Static SQL Dump File
- Setup database structure with books, authors, languages etc. for publishing house [closed]
- Query for specific custom field
- add an option to the read page
- Add table to WordPress database
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- Display posts by combining multiple meta key
- Custom select query two tables by a meta key
- Custom Same Page Search
- Fatal error Call to a member function insert() on a non-object [closed]
- custom user meta query
- Usage of custom post types in a custom admin menu
- Recent activity query WordPress
- How to query term_id of a Custom Taxonomy by name
- Custom Database Table and foreach
- How Can I Always Display A Particular Post First Using WP_Query?
- Mimicking admin panel menu from wordpress 3.0.1
- WP Search Form Query: Add Author’s posts into search query
- query variables for custom taxonomies
- optimal taxonomy or custom post types
- display text generated via custom get query string
- Custom admin menu items
- What is my error trying to create a new table in the database?
- Add helper text in custom-header section in admin
- Migrating my site to a new domain does not keep any changes made in customizer
- New Page/Post Screen Opens an Existing Post
- Advice on how to structure a custom plugin
- Custom query pagination with php parameter as arg problem
- How to have differents sites share the same tables of DB?
- Add a menu item to admin dashboard which isn’t a link? [duplicate]
- How to fix custom add menu page preventing media library from loading
- admin aoolbar add_node() and pulling in my post slug
- How to automatically pull an information from a form field onto an other page?
- Query Posts to display all posts with category “custom field value”
- Custom Form Input not saving to Database
- My connecting URL form in html to PHP does not work
- Accountless password generation
- Query 1 custom post type, each day, alphabetically
- Add several fields from different tables to post, fields per post are in same row of table
- Where should I put this custom data?
- Show WP content on different PHP Sites
- Database custom table issues – incorrect result displayed
- Check if values exists DB
- Multiple Taxonomies Using Custom SQL Query
- Changing starting number of User ID
- Search a meta field for a value in all posts
- Custom WordPress SQL Query 4 posts per custom taxonomy
- Accessing + retrieving custom database in WordPress
- Custom MySQL query to list post
- Custom Query Arguments
- Custom Query for Taxonomy
- Include plugin´s table in custom query
- Advice how to connect custom database with WordPress, change data in WordPress and finaly use this data
- Changes to code not displaying
- User Query Multiple Orderby Clause
- Can I log the searches that are returning 404 in the DB?
- Import bootstrap 5 and bootstrap icons in wp-admin backend
- Advanced Custom Fields in WP_Query: Href Returning Empty
- How to create a page /1 using ?
- Is there a straight-forward way to provide a meta description tag via Yoast SEO, programmatically, without relying on the admin panel?
- Taking over my late husbands wordpress blog that we shared
- SQL query to set posts in bulk based on the post content
- How to customize the WordPress 2014 theme, to have page using less horizontal margin?
- WordPress Child Theme Stylesheet being loaded before Parent’s minified .css
- How to create custom search page