User Submitted Posts - Version 20210212

Version Description

To upgrade User Submitted Posts, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.

Important! The /custom/ directory is deprecated. If you are using a custom form template, please move it to /wp-content/your-theme/usp/. For more information, check out the "Custom Submission Form" section under Installation.

Note: uninstalling the plugin from the WP Plugins screen results in the removal of all settings from the WP database. Submitted posts are NOT removed if you deactivate the plugin, reset default options, or uninstall the plugins; that is, all submitted posts (and any attached meta data) must be removed manually.

Download this release

Release Info

Developer specialk
Plugin Icon 128x128 User Submitted Posts
Version 20210212
Comparing to
See all releases

Code changes from version 20201120 to 20210212

library/enqueue-scripts.php CHANGED
@@ -111,13 +111,19 @@ function usp_enqueue_recaptcha() {
111
  $recaptcha = isset($usp_options['recaptcha_public']) ? $usp_options['recaptcha_public'] : '';
112
  $version = isset($usp_options['recaptcha_version']) ? $usp_options['recaptcha_version'] : 2;
113
 
 
 
114
  if ($version == 3) {
115
 
116
- wp_enqueue_script('usp_recaptcha', 'https://www.google.com/recaptcha/api.js?render='. $recaptcha, array(), null);
 
 
117
 
118
  } else {
119
 
120
- wp_enqueue_script('usp_recaptcha', 'https://www.google.com/recaptcha/api.js', array(), USP_VERSION);
 
 
121
 
122
  }
123
 
111
  $recaptcha = isset($usp_options['recaptcha_public']) ? $usp_options['recaptcha_public'] : '';
112
  $version = isset($usp_options['recaptcha_version']) ? $usp_options['recaptcha_version'] : 2;
113
 
114
+ $query = apply_filters('usp_recaptcha_querystring', '');
115
+
116
  if ($version == 3) {
117
 
118
+ $query = !empty($query) ? '&hl='. $query : '';
119
+
120
+ wp_enqueue_script('usp_recaptcha', 'https://www.google.com/recaptcha/api.js?render='. $recaptcha . $query, array(), null);
121
 
122
  } else {
123
 
124
+ $query = !empty($query) ? '?hl='. $query : '';
125
+
126
+ wp_enqueue_script('usp_recaptcha', 'https://www.google.com/recaptcha/api.js'. $query, array(), USP_VERSION);
127
 
128
  }
129
 
library/plugin-settings.php CHANGED
@@ -1569,7 +1569,7 @@ function usp_render_form() {
1569
  <tr>
1570
  <th scope="row"><label class="description" for="usp_options[usp_add_another]"><?php esc_html_e('&ldquo;Add another image&rdquo; link', 'usp'); ?></label></th>
1571
  <td><textarea class="textarea" rows="3" cols="50" name="usp_options[usp_add_another]"><?php if (isset($usp_options['usp_add_another'])) echo esc_textarea($usp_options['usp_add_another']); ?></textarea>
1572
- <div class="mm-item-caption"><?php esc_html_e('Custom markup for the &ldquo;Add another image&rdquo; link. Leave blank to use the default markup (recommended).', 'usp'); ?></div></td>
1573
  </tr>
1574
  <tr>
1575
  <th scope="row"><label class="description" for="usp_options[min-images]"><?php esc_html_e('Minimum number of images', 'usp'); ?></label></th>
@@ -1717,7 +1717,7 @@ function usp_render_form() {
1717
  <p><span class="code mm-code">[usp_display_posts]</span></p>
1718
 
1719
  <p><?php esc_html_e('Or, use the template tag to display a list of submitted posts anywhere in your theme template:', 'usp'); ?></p>
1720
- <p><span class="code mm-code">&lt;?php if (function_exists('usp_display_posts')) echo usp_display_posts(); ?&gt;</span></p>
1721
 
1722
  <p><?php esc_html_e('Here are some examples showing how to configure this shortcode:', 'usp'); ?></p>
1723
  <pre>[usp_display_posts] : default displays all submitted posts by all authors
1569
  <tr>
1570
  <th scope="row"><label class="description" for="usp_options[usp_add_another]"><?php esc_html_e('&ldquo;Add another image&rdquo; link', 'usp'); ?></label></th>
1571
  <td><textarea class="textarea" rows="3" cols="50" name="usp_options[usp_add_another]"><?php if (isset($usp_options['usp_add_another'])) echo esc_textarea($usp_options['usp_add_another']); ?></textarea>
1572
+ <div class="mm-item-caption"><?php esc_html_e('Custom HTML/markup for the &ldquo;Add another image&rdquo; link. Leave blank to use the default markup (recommended).', 'usp'); ?></div></td>
1573
  </tr>
1574
  <tr>
1575
  <th scope="row"><label class="description" for="usp_options[min-images]"><?php esc_html_e('Minimum number of images', 'usp'); ?></label></th>
1717
  <p><span class="code mm-code">[usp_display_posts]</span></p>
1718
 
1719
  <p><?php esc_html_e('Or, use the template tag to display a list of submitted posts anywhere in your theme template:', 'usp'); ?></p>
1720
+ <p><span class="code mm-code">&lt;?php if (function_exists('usp_display_posts')) echo usp_display_posts(array('userid' => 'all', 'numposts' => -1)); ?&gt;</span></p>
1721
 
1722
  <p><?php esc_html_e('Here are some examples showing how to configure this shortcode:', 'usp'); ?></p>
1723
  <pre>[usp_display_posts] : default displays all submitted posts by all authors
readme.txt CHANGED
@@ -3,15 +3,15 @@
3
  Plugin Name: User Submitted Posts
4
  Plugin URI: https://perishablepress.com/user-submitted-posts/
5
  Description: Enables your visitors to submit posts and images from anywhere on your site.
6
- Tags: guest post, user post, anonymous post, frontend post, guest author, frontend content, frontend post, frontend upload, generated content, guest blog, guest blogging, guest publish, guest upload, post sharing, post submission, public post, share posts, submit post, user generated, user submit, user submitted post, visitor post
7
  Author: Jeff Starr
8
  Author URI: https://plugin-planet.com/
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
- Tested up to: 5.6
13
- Stable tag: 20201120
14
- Version: 20201120
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
@@ -437,7 +437,7 @@ User Submitted Posts provides a set of useful template tags:
437
 
438
  /*
439
  Display a configurable list of submitted posts
440
- Usage: <?php if (function_exists('usp_display_posts')) echo usp_display_posts(); ?>
441
  */
442
 
443
  usp_display_posts()
@@ -708,6 +708,16 @@ If you want to disable the fancy Chosen script for these fields, you can do so b
708
  Save changes and done.
709
 
710
 
 
 
 
 
 
 
 
 
 
 
711
  **More FAQs**
712
 
713
  Want to read some more FAQs? Check out the [USP FAQs at Perishable Press](https://perishablepress.com/faqs-user-submitted-posts/)
@@ -747,6 +757,16 @@ Links, tweets and likes also appreciated. Thanks! :)
747
  If you like USP, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
748
 
749
 
 
 
 
 
 
 
 
 
 
 
750
  **20201120**
751
 
752
  * Adds support for disabling comments
3
  Plugin Name: User Submitted Posts
4
  Plugin URI: https://perishablepress.com/user-submitted-posts/
5
  Description: Enables your visitors to submit posts and images from anywhere on your site.
6
+ Tags: guest post, user post, anonymous post, frontend post, public post, share post, submit post, visitor post, user submitted post, upload
7
  Author: Jeff Starr
8
  Author URI: https://plugin-planet.com/
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
+ Tested up to: 5.7
13
+ Stable tag: 20210212
14
+ Version: 20210212
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
437
 
438
  /*
439
  Display a configurable list of submitted posts
440
+ Usage: <?php if (function_exists('usp_display_posts')) echo usp_display_posts(array('userid' => 'all', 'numposts' => -1)); ?>
441
  */
442
 
443
  usp_display_posts()
708
  Save changes and done.
709
 
710
 
711
+ **How to change the language for Google reCaptcha?**
712
+
713
+ By default, the Google reCaptcha field is displayed in English. To change that to some other language, first locate the two-digit abbreviation for your language [here](https://developers.google.com/recaptcha/docs/language). Then add the following code to your theme (or child theme) functions.php, or add via simple custom plugin:
714
+
715
+ `function usp_recaptcha_querystring($query) { return 'en'; }
716
+ add_filter('usp_recaptcha_querystring', 'usp_recaptcha_querystring');`
717
+
718
+ Notice where it says `en`, that is the two-character language code you want to replace with your own. Then save changes and done.
719
+
720
+
721
  **More FAQs**
722
 
723
  Want to read some more FAQs? Check out the [USP FAQs at Perishable Press](https://perishablepress.com/faqs-user-submitted-posts/)
757
  If you like USP, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
758
 
759
 
760
+ **20210212**
761
+
762
+ * Adds support to change reCaptcha language
763
+ * Adds filter hook `usp_recaptcha_querystring`
764
+ * Updates deprecated functions for newer versions of jQuery
765
+ * Fixes bug where "Please select" could be chosen as category/tag
766
+ * Improves description/label for "Add another image" setting
767
+ * Improves documentation on settings page and readme.txt
768
+ * Tests on WordPress 5.7
769
+
770
  **20201120**
771
 
772
  * Adds support for disabling comments
resources/jquery.usp.admin.js CHANGED
@@ -7,37 +7,37 @@ jQuery(document).ready(function($){
7
 
8
  // toggle panels
9
  $('.default-hidden').hide();
10
- $('#mm-panel-toggle a').click(function(){
11
  $('.toggle').slideToggle(300);
12
  return false;
13
  });
14
- $('h2').click(function(){
15
  $(this).next().slideToggle(300);
16
  return false;
17
  });
18
 
19
  // jump toggle panels
20
- $('#mm-panel-primary-link').click(function(){
21
  $('.toggle').hide();
22
  $('#mm-panel-primary .toggle').slideToggle(300);
23
  return true;
24
  });
25
- $('#mm-panel-secondary-link').click(function(){
26
  $('.toggle').hide();
27
  $('#mm-panel-secondary .toggle').slideToggle(300);
28
  return true;
29
  });
30
 
31
  // toggle form info
32
- $('.usp-custom-form').click(function(){
33
  $('.usp-custom-form-info').slideDown(300);
34
  });
35
- $('.usp-form').click(function(){
36
  $('.usp-custom-form-info').slideUp(300);
37
  });
38
 
39
  // toggle categories
40
- $('.usp-cat-toggle-link').click(function(){
41
  $('.usp-cat-toggle-div').toggle(300);
42
  return false;
43
  });
7
 
8
  // toggle panels
9
  $('.default-hidden').hide();
10
+ $('#mm-panel-toggle a').on('click', function(){
11
  $('.toggle').slideToggle(300);
12
  return false;
13
  });
14
+ $('h2').on('click', function(){
15
  $(this).next().slideToggle(300);
16
  return false;
17
  });
18
 
19
  // jump toggle panels
20
+ $('#mm-panel-primary-link').on('click', function(){
21
  $('.toggle').hide();
22
  $('#mm-panel-primary .toggle').slideToggle(300);
23
  return true;
24
  });
25
+ $('#mm-panel-secondary-link').on('click', function(){
26
  $('.toggle').hide();
27
  $('#mm-panel-secondary .toggle').slideToggle(300);
28
  return true;
29
  });
30
 
31
  // toggle form info
32
+ $('.usp-custom-form').on('click', function(){
33
  $('.usp-custom-form-info').slideDown(300);
34
  });
35
+ $('.usp-form').on('click', function(){
36
  $('.usp-custom-form-info').slideUp(300);
37
  });
38
 
39
  // toggle categories
40
+ $('.usp-cat-toggle-link').on('click', function(){
41
  $('.usp-cat-toggle-div').toggle(300);
42
  return false;
43
  });
resources/jquery.usp.core.js CHANGED
@@ -39,7 +39,7 @@ jQuery(document).ready(function($) {
39
  return false;
40
  }
41
  };
42
- $('#usp_form').submit(function(e) {
43
  usp_captcha_check(e);
44
  if ($(this).parsley().isValid()) {
45
  $('.usp-submit').css('cursor', 'wait');
@@ -47,7 +47,7 @@ jQuery(document).ready(function($) {
47
  }
48
  usp_remember();
49
  });
50
- $('.usp-captcha .usp-input').change(function(e) {
51
  usp_captcha_check(e);
52
  });
53
  function usp_captcha_check(e) {
@@ -166,7 +166,8 @@ jQuery(document).ready(function($) {
166
  var y = parseInt($('#usp-max-images').val());
167
  if (x === 0) x = 1;
168
  if (x >= y) $('#usp_add-another').hide();
169
- $('#usp_add-another').click(function(e) {
 
170
  e.preventDefault();
171
  x++;
172
  var link = $(this);
39
  return false;
40
  }
41
  };
42
+ $('#usp_form').on('submit', function(e) {
43
  usp_captcha_check(e);
44
  if ($(this).parsley().isValid()) {
45
  $('.usp-submit').css('cursor', 'wait');
47
  }
48
  usp_remember();
49
  });
50
+ $('.usp-captcha .usp-input').on('change', function(e) {
51
  usp_captcha_check(e);
52
  });
53
  function usp_captcha_check(e) {
166
  var y = parseInt($('#usp-max-images').val());
167
  if (x === 0) x = 1;
168
  if (x >= y) $('#usp_add-another').hide();
169
+
170
+ $('#usp_add-another').on('click', function(e) {
171
  e.preventDefault();
172
  x++;
173
  var link = $(this);
user-submitted-posts.php CHANGED
@@ -3,15 +3,15 @@
3
  Plugin Name: User Submitted Posts
4
  Plugin URI: https://perishablepress.com/user-submitted-posts/
5
  Description: Enables your visitors to submit posts and images from anywhere on your site.
6
- Tags: guest post, user post, anonymous post, frontend post, guest author, frontend content, frontend post, frontend upload, generated content, guest blog, guest blogging, guest publish, guest upload, post sharing, post submission, public post, share posts, submit post, user generated, user submit, user submitted post, visitor post
7
  Author: Jeff Starr
8
  Author URI: https://plugin-planet.com/
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
- Tested up to: 5.6
13
- Stable tag: 20201120
14
- Version: 20201120
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
@@ -32,7 +32,7 @@
32
  You should have received a copy of the GNU General Public License
33
  with this program. If not, visit: https://www.gnu.org/licenses/
34
 
35
- Copyright 2020 Monzilla Media. All rights reserved.
36
  */
37
 
38
  if (!defined('ABSPATH')) die();
@@ -40,7 +40,7 @@ if (!defined('ABSPATH')) die();
40
 
41
 
42
  define('USP_WP_VERSION', '4.1');
43
- define('USP_VERSION', '20201120');
44
  define('USP_PLUGIN', esc_html__('User Submitted Posts', 'usp'));
45
  define('USP_PATH', plugin_basename(__FILE__));
46
 
3
  Plugin Name: User Submitted Posts
4
  Plugin URI: https://perishablepress.com/user-submitted-posts/
5
  Description: Enables your visitors to submit posts and images from anywhere on your site.
6
+ Tags: guest post, user post, anonymous post, frontend post, public post, share post, submit post, visitor post, user submitted post, upload
7
  Author: Jeff Starr
8
  Author URI: https://plugin-planet.com/
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
+ Tested up to: 5.7
13
+ Stable tag: 20210212
14
+ Version: 20210212
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
32
  You should have received a copy of the GNU General Public License
33
  with this program. If not, visit: https://www.gnu.org/licenses/
34
 
35
+ Copyright 2021 Monzilla Media. All rights reserved.
36
  */
37
 
38
  if (!defined('ABSPATH')) die();
40
 
41
 
42
  define('USP_WP_VERSION', '4.1');
43
+ define('USP_VERSION', '20210212');
44
  define('USP_PLUGIN', esc_html__('User Submitted Posts', 'usp'));
45
  define('USP_PATH', plugin_basename(__FILE__));
46
 
views/submission-form-alt.php CHANGED
@@ -70,7 +70,7 @@ else :
70
  <fieldset class="usp-tags">
71
  <label for="user-submitted-tags"><?php esc_html_e('Post Tags', 'usp'); ?></label>
72
  <select id="user-submitted-tags" name="user-submitted-tags[]"<?php if (usp_check_required('usp_tags')) echo $usp_required; ?> class="usp-select usp-multiple" multiple="multiple">
73
- <option value=""><?php esc_attr_e('Please select some tags..', 'usp'); ?></option>
74
  <?php echo usp_get_tag_options(); ?>
75
  </select>
76
  </fieldset>
@@ -98,7 +98,7 @@ else :
98
  <fieldset class="usp-category">
99
  <label for="user-submitted-category"><?php esc_html_e('Post Category', 'usp'); ?></label>
100
  <select id="user-submitted-category"<?php if (usp_check_required('usp_category')) echo $usp_required; echo $multiple_cats . $category_class; ?> name="user-submitted-category[]">
101
- <option value=""><?php esc_html_e('Please select a category..', 'usp'); ?></option>
102
  <?php echo usp_get_cat_options(); ?>
103
  </select>
104
  </fieldset>
70
  <fieldset class="usp-tags">
71
  <label for="user-submitted-tags"><?php esc_html_e('Post Tags', 'usp'); ?></label>
72
  <select id="user-submitted-tags" name="user-submitted-tags[]"<?php if (usp_check_required('usp_tags')) echo $usp_required; ?> class="usp-select usp-multiple" multiple="multiple">
73
+ <option value="" disabled><?php esc_attr_e('Please select some tags..', 'usp'); ?></option>
74
  <?php echo usp_get_tag_options(); ?>
75
  </select>
76
  </fieldset>
98
  <fieldset class="usp-category">
99
  <label for="user-submitted-category"><?php esc_html_e('Post Category', 'usp'); ?></label>
100
  <select id="user-submitted-category"<?php if (usp_check_required('usp_category')) echo $usp_required; echo $multiple_cats . $category_class; ?> name="user-submitted-category[]">
101
+ <option value="" disabled><?php esc_html_e('Please select a category..', 'usp'); ?></option>
102
  <?php echo usp_get_cat_options(); ?>
103
  </select>
104
  </fieldset>
views/submission-form.php CHANGED
@@ -55,7 +55,7 @@ else :
55
  <fieldset class="usp-tags">
56
  <label for="user-submitted-tags"><?php esc_html_e('Post Tags', 'usp'); ?></label>
57
  <select id="user-submitted-tags" name="user-submitted-tags[]"<?php if (usp_check_required('usp_tags')) echo $usp_required; ?> class="usp-select usp-multiple" multiple="multiple">
58
- <option value=""><?php esc_attr_e('Please select some tags..', 'usp'); ?></option>
59
  <?php echo usp_get_tag_options(); ?>
60
  </select>
61
  </fieldset>
@@ -83,7 +83,7 @@ else :
83
  <fieldset class="usp-category">
84
  <label for="user-submitted-category"><?php esc_html_e('Post Category', 'usp'); ?></label>
85
  <select id="user-submitted-category"<?php if (usp_check_required('usp_category')) echo $usp_required; echo $multiple_cats . $category_class; ?> name="user-submitted-category[]">
86
- <option value=""><?php esc_html_e('Please select a category..', 'usp'); ?></option>
87
  <?php echo usp_get_cat_options(); ?>
88
  </select>
89
  </fieldset>
55
  <fieldset class="usp-tags">
56
  <label for="user-submitted-tags"><?php esc_html_e('Post Tags', 'usp'); ?></label>
57
  <select id="user-submitted-tags" name="user-submitted-tags[]"<?php if (usp_check_required('usp_tags')) echo $usp_required; ?> class="usp-select usp-multiple" multiple="multiple">
58
+ <option value="" disabled><?php esc_attr_e('Please select some tags..', 'usp'); ?></option>
59
  <?php echo usp_get_tag_options(); ?>
60
  </select>
61
  </fieldset>
83
  <fieldset class="usp-category">
84
  <label for="user-submitted-category"><?php esc_html_e('Post Category', 'usp'); ?></label>
85
  <select id="user-submitted-category"<?php if (usp_check_required('usp_category')) echo $usp_required; echo $multiple_cats . $category_class; ?> name="user-submitted-category[]">
86
+ <option value="" disabled><?php esc_html_e('Please select a category..', 'usp'); ?></option>
87
  <?php echo usp_get_cat_options(); ?>
88
  </select>
89
  </fieldset>