The plugin now works as I would like, with a little alteration. Instead of setting submitter_id to a random value, it is now set to the logged in user’s id. This will allow displaying other users’ answers. The + indicates new lines of code in the output_quiz.php file:
function wpss_getQuiz($quiz_id){
global $wpdb;
+ global $current_user; get_currentuserinfo();
<input type="hidden" name="quiz_id" value="'.$quiz['id'].'" />
+ <input type="hidden" name="submitter_id" value="'.$current_user->ID.'" />';
Thanks to Johannes Pille for the suggestion.
Related Posts:
- How to properly insert data into custom table via plugin
- How does WordPress handle MySQL row lock errors?
- How to write one comment and publish on every post using database or plugin?
- Help With MySQL to WPDB Query Conversion
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- WordPress Backend HA (Automatic failover)
- Issue running db create table query from static method
- How to create plugin/ page that reads from database
- DB Query not working in Plugin
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Way to send multiple values for column to MySQL?
- WordPress plugin: efficient way to store large data
- Integrating Custom Database with WordPress
- add_action for publish_post doesn’t work
- How to get the custom field value using SQL query
- Cant create table on plugin activation
- Moving a few select DB tables to a new WP instance
- how to search through plugin in wordpress cimy-user-extra-fields?
- How can I delete the options from DB when the plugin is deleted?
- plugin doesn’t retrieve data from database
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- category_name not working (not showing up in sql query debug)
- How can I make my custom shortcode work in a Custom HTML Widget?
- Searching users with WP_List_Table plugin
- Update Multiple Post Meta for the Same Post In One call?
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- WordPress widget / plugin….fields not appearing in my widget
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- Changing BIGINT to INT
- WordPress register_activation_hook table creation not working
- Custom Shipping method not showing in checkout
- greatest() function returns undefined property
- Get total number of comment of the posts written by an author
- Write to / remove from default .htaccess file from plugin?
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- How can I get WordPress to save comments in markdown format?
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Programatically download a plugin
- Display data on Word Press site posts and pages from mysql table
- Plugin Options Not Saving to Database in WP 4.5
- How to create custom tables in WordPress using my own plugin?
- How would I go about creating a user ranked post popularity page?
- Redirection of users away from wp-admin (but not administrators)
- code is working properly in Core PHP but writing coding in WordPress
- How can I perform high-level database merging for WordPress within continues delivery?
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- Multiple instance of data in plugin custom database table on plugin activation
- Perform internal redirect in WordPress?
- How to prevent plugins from loading jQuery
- Class variables not correct on page
- Why is one phpunit test throwing an error on one class when all other classes are similar without error?
- Duplicate results are displayed in a custom plugin [closed]
- Notice: Uninitialized string offset: 0 in social sharing mu-plugin
- WPDB: Update table
- Why is my custom post type not being activated on plug-in activation?
- Best/Correct way to add an option to a category
- How to redirect to same page after form submission
- I receive taxonomy id
- output html on post or page from custom plugin [closed]
- Loop in elementor custom widget not working
- Built a second plugin but it overwrote the first one
- Creating a functionality plugin to edit seriously simple podcasting
- Asynchronous request in wordpress
- Make plugin php file called directly aware of WordPress?
- Next Previous Post in wordpress with previous / next link with title?
- Different registration form for different roles
- Apply html elements in php statement
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Getting current user data with MySQL statement
- Conditional delete metadata does not works
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Why is my shortcode not working?
- Rename a folder via HTML POST request
- Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin
- working code, not working – Plugin Dev
- WordPress plugin blog creation
- implement checkbox or toggle switch in plugin code
- Create a form and have custom menu display based on user answers?
- submit form data to wordpress existing database table using my plugin
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- Problem with conditional woocommerce custom checkout field
- My plugin can’t see my files
- Resetting AUTO_INCREMENT primary key
- How can I insert a record into a custom table from my custom form in my custom admin page?
- How to save information related to post in database?
- Plugin Breaking WordPress Login
- How to fix ‘Call to undefined function do_settings()’ error?
- What is the source outline for a basic word press plugin?
- Submit posts in two different post types with the same form
- How to trigger plugin migration code when plugin updates?
- How to Save Category and Delete Category in same Function
- Accessing Correct Database to Create REST API Endpoint
- add_action() not working for admin
- Read page- or post-content across different builder-plugins
- How to make WordPress Plugin run on single specific Admin Page
- Error 400 Invalid “products[1].productId” Kinguin [closed]
- Custom page template from plugin does not work with pre-installed themes in WordPress 6.6.1