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
- can not serialize and insert data from custom form
- What are the differences between WPINC and ABSPATH?
- How to Add an Index to Plugin Database table
- Creating two database tables via plugin
- Problems with autoloading classes via sp_autoload_register / maybe interfering WP-specific autoloader
- WordPress plugin installation
- I would like to use create a function in my custom plugin to tell WP to use a different header
- How to edit/delete single row items in a table on my own menu page
- Getting media library popup in custom plugin admin page
- Create or Update thousands of woocommerce products via PHP
- send_headers don’t work on wordpress multisite
- jQuery function didn’t work in my plugin
- greatest() function returns undefined property
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Get total number of comment of the posts written by an author
- Escape when echoed
- Scope for PHP Variables Assigned in functions.php or a plugin
- Plugin exceeds memory limit
- Default Plugin Settings Not Writing to Database
- Make id column as AUTO INCREMENT on plugin activation
- Write to / remove from default .htaccess file from plugin?
- Update Option Error: Notice: Undefined index
- How to get number of Affected rows from wordpress dbDelta() function
- Plugin Development sqlite or WordPress’ database
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- How to determine what is generating large amount of database queries?
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- How to trigger $_GET request within admin plugin page?
- Building an email signup form. Where should the information be saved in the DB?
- How to generate video out of images via WordPress plugin
- How can I get WordPress to save comments in markdown format?
- WooCommerce get_price returning wrong price when used via ajax
- How to ‘clone’ a wp plugin to make small changes
- Open Post Thumbnail in New Child Theme File in WordPress
- Where should I save an API key of my user when installing my plugin?
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Programatically download a plugin
- Redirecting to home page after login as custom role WordPress
- Add keywords meta to index.php page
- Custom form action to handle data inside a plugin
- Self deactivate plugins after an action occurs
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Display data on Word Press site posts and pages from mysql table
- Plugin Options Not Saving to Database in WP 4.5
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- WP Post Template – Templates in own folder
- Avoid class name collision when using third party libraries in plugins?
- How to create custom tables in WordPress using my own plugin?
- wordpress plugin is not activating from widget
- How to access data in wordpress database externally using php
- Is it possible to create Custom Post plug-in?
- Edit Yoast SEO breadcrumbs output [closed]
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- How would I go about creating a user ranked post popularity page?
- Creating mySQL procedure with $wpdb
- Redirection of users away from wp-admin (but not administrators)
- Using a custom plugin to capture input data via Ajax and PHP
- code is working properly in Core PHP but writing coding in WordPress
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- Prevent duplicate records in plugin table
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- WpDataTables – View Image Directory
- Image upload and download from front-end
- wp_remote_get() returns 403 while file_get_contents() does not
- How can I perform high-level database merging for WordPress within continues delivery?
- How to output CMB2 select options from repeated groups select elements?
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- Update results, Before deleting the related category [closed]
- WordPress plugin creation how to execute .sql in order to insert multiple rows at activation of plugin
- Plugin: register_deactivation_hook works perfectly well, while register_activation_hook suddenly stopped working
- What are the specifics of WordPress development I need to know? [closed]
- Insert data from .sql file in wordpress plugin
- Ajax call returning 0
- How to deal with WordPress and Pocket API to automate content curation on my hosted wordpress blog? [closed]
- WP All Import – Execute Imports
- How to replace WordPress Media Upload Window with user’s device window?
- Conditional attributes and logic per product category
- Automatic switch to backup database on fail
- How can I change the meta_key for a particular piece of information?
- Migrating to WordPress Recipe Plugin and Some SQL Issues