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 Add an Index to Plugin Database table
- Making plugin unique to not conflict with plugins with the same name
- How to find out if option exists but is empty?
- How to store ACF custom fields data in a custom table
- How to pass JavaScript variable to PHP in wordpress widget?
- Unable to add admin notice on plugin activation
- How To Ignore a Filter On Applying Filter the Content In a Function
- Saving Plugin settings to the database
- Bad Request (Invalid Hostname) on working server, database problem
- Add CSS animation as Preloader to WordPress
- Errors while using ajax from external wordpress page
- shortcode doesn’t work
- $wpdb->get_results() does not fetch results with unicode ‘WHERE’ clause
- WordPress plugin installation
- Default Plugin Settings Not Writing to Database
- How to determine what is generating large amount of database queries?
- Building an email signup form. Where should the information be saved in the DB?
- Where should I save an API key of my user when installing my plugin?
- Custom form action to handle data inside a plugin
- Self deactivate plugins after an action occurs
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- WP Post Template – Templates in own folder
- Is it possible to create Custom Post plug-in?
- Using a custom plugin to capture input data via Ajax and PHP
- Image upload and download from front-end
- Ajax call returning 0
- How to deal with WordPress and Pocket API to automate content curation on my hosted wordpress blog? [closed]
- Conditional attributes and logic per product category
- How can I change the meta_key for a particular piece of information?
- WordPress get_avatar function not correct working
- Can I create a table on my DB without creating a plugin?
- Creating a CSV with PHP inside the plugin directory
- pagination on data fetched using SQL query
- dbDelta not adding additional columns in plugin database update
- Include a php file from another plugin
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- Add User Role: Pre-saved in User-Meta [SOLVED]
- How can I fetch data from another website to my wordpress website with mysql database
- Save user total active time after login in wordpress [closed]
- How WordPress core manage the plugin installation
- Switch from wp-cron to a server cron job
- Calling a save function from a “submit” button
- Wp Debug Enabled True Notices and Warning
- Plugin generating unexpected output – on WP mysql dump import
- select a single val though a table in wordpress
- Is this plugin safe to run?
- WordPress Cache delete on plugin uninstall
- How to make a Product page without ordering and database
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- How to create admin setting for this small plugin
- Allow a particular user to access a particular plugin?
- WP Function does not trigger on Webhook API Call
- Cookie value changes back to previous value after changing
- Problem with checked box on wp car manager plugin
- Performing CRUD operations on front end in wordpress
- How to use WordPress header function and footer function and not load word press database
- How to securely controlling data without keeping it in postmeta?
- $wpdb->insert not working inside save_post tag
- update_post_meta is not working for me when I use e.preventDefault for update button
- Store GravityForm data in phpmyadmin (mysql)
- Woocommerce list variations that are added already to cart in Single Product
- WordPress Admin sub-level menu issue
- Plugin communication between sites that use it?
- Passing ajax variable to more than one wordpress plugin function
- HyperDB failover Delay
- Displaying friend’s posts only
- Theme editor removes backslashes
- Create Database Tables on Plugin Activation hook
- Plugin Hook: Get posts
- Undefined variable _POST
- How use Dynamic hyperlink on each wordpress post?
- How to edit the default database of WordPress [closed]
- How to display blog posts only authored by the administrator
- What can I do to customize a widget provided with this plugin? from where have I to start?
- On the same site, how do I send data from a plugin file to a theme file?
- How to add custom html to the Media > Attachment Details modal?
- How to override plugin function in code snippets WordPress
- How to create a “Most Popular” & “Latest” TAB in WordPress
- Use inline callable for hooks and filters
- Error in using ‘admin_enqueue_scripts’ action through a class