PluginProbe
User Submitted Posts – Enable Users to Submit Posts from the Front End / 20260916
User Submitted Posts – Enable Users to Submit Posts from the Front End v20260916
20260916 20260810 20260608 20230806 20230809 20230811 20230901 20230902 20230914 20231102 20240319 20240516 20240703 20241026 20250327 20250329 20251121 20251210 20260110 20260113 20260207 20260217 20260407 20260422 trunk All 59 releases
← All changes | library/plugin-display.php +71 -24 2023081120260916 View file →
@@ -26,8 +26,32 @@
26 26
27 27 <div class="metabox-holder">
28 28 <div class="meta-box-sortables ui-sortable">
29 29
30 + <div id="mm-panel-alert"<?php echo $display_alert; ?> class="postbox">
31 + <h2><?php esc_html_e('We need your support!', 'usp'); ?></h2>
32 + <div class="toggle">
33 + <div class="mm-panel-alert">
34 + <p class="alert-intro">
35 + <?php esc_html_e('Please', 'usp'); ?> <a target="_blank" rel="noopener noreferrer" href="https://monzillamedia.com/donate.html" title="<?php esc_attr_e('Make a donation via PayPal', 'usp'); ?>"><?php esc_html_e('make a donation', 'usp'); ?></a> <?php esc_html_e('and/or', 'usp'); ?>
36 + <a target="_blank" rel="noopener noreferrer" href="https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post" title="<?php esc_attr_e('Rate and review at the Plugin Directory', 'usp'); ?>">
37 + <?php esc_html_e('give this plugin a 5-star rating', 'usp'); ?>&nbsp;&raquo;
38 + </a>
39 + </p>
40 + <p>
41 + <?php esc_html_e('Your generous support enables continued development of this free plugin. Thank you!', 'usp'); ?>
42 + </p>
43 + <div class="dismiss-alert">
44 + <div class="dismiss-alert-wrap">
45 + <input id="version_alert" name="usp_options[version_alert]" type="checkbox" value="1" <?php if (isset($usp_options['version_alert'])) checked('1', $usp_options['version_alert']); ?> />
46 + <label for="version_alert"><?php esc_html_e('Check this box if you have shown support', 'usp') ?></label>
47 + <input type="hidden" name="usp_options[usp_version]" value="<?php echo $version_previous; ?>" />
48 + </div>
49 + </div>
50 + </div>
51 + </div>
52 + </div>
53 +
30 54 <div id="mm-panel-overview" class="postbox">
31 55 <h2><?php esc_html_e('Overview', 'usp'); ?></h2>
32 56 <div class="toggle<?php if (isset($_GET['settings-updated'])) echo ' default-hidden'; ?>">
33 57 <div class="mm-panel-overview">
@@ -73,8 +97,9 @@
73 97 echo usp_form_field_options_custom('1');
74 98 echo usp_form_field_options_custom('2');
75 99 echo usp_form_field_options_captcha();
76 100 echo usp_form_field_options_recaptcha();
101 + echo usp_form_field_options_turnstile();
77 102 echo usp_form_field_options_images();
78 103
79 104 ?>
80 105 <tr>
@@ -275,9 +300,9 @@
275 300 <tr>
276 301 <th scope="row"><label class="description" for="usp_options[email_alert_subject]"><?php esc_html_e('Email Alert Subject', 'usp'); ?></label></th>
277 302 <td><input type="text" size="45" name="usp_options[email_alert_subject]" value="<?php if (isset($usp_options['email_alert_subject'])) echo esc_attr($usp_options['email_alert_subject']); ?>" />
278 303 <div class="mm-item-caption"><?php esc_html_e('Subject line for email alerts. Leave blank to use default subject line. You may include any of the following variables:', 'usp'); ?>
279 - <code>%%post_title%%</code>, <code>%%post_content%%</code>, <code>%%post_author%%</code>, <code>%%blog_name%%</code>, <code>%%blog_url%%</code>, <code>%%post_url%%</code>, <code>%%admin_url%%</code>,
304 + <code>%%post_title%%</code>, <code>%%post_content%%</code>, <code>%%post_cats%%</code>, <code>%%post_author%%</code>, <code>%%post_date%%</code>, <code>%%blog_name%%</code>, <code>%%blog_url%%</code>, <code>%%post_url%%</code>, <code>%%admin_url%%</code>,
280 305 <code>%%edit_link%%</code>, <code>%%delete_link%%</code>, <code>%%user_email%%</code>, <code>%%user_url%%</code>, <code>%%custom_field%%</code>, <code>%%custom_field_2%%</code></div></td>
281 306 </tr>
282 307 <tr>
283 308 <th scope="row"><label class="description" for="usp_options[email_alert_message]"><?php esc_html_e('Email Alert Message', 'usp'); ?></label></th>
@@ -282,9 +307,9 @@
282 307 <tr>
283 308 <th scope="row"><label class="description" for="usp_options[email_alert_message]"><?php esc_html_e('Email Alert Message', 'usp'); ?></label></th>
284 309 <td><textarea class="textarea" rows="3" cols="50" name="usp_options[email_alert_message]"><?php if (isset($usp_options['email_alert_message'])) echo esc_textarea($usp_options['email_alert_message']); ?></textarea>
285 310 <div class="mm-item-caption"><?php esc_html_e('Message for email alerts. Leave blank to use default message. You may include any of the following variables:', 'usp'); ?>
286 - <code>%%post_title%%</code>, <code>%%post_content%%</code>, <code>%%post_author%%</code>, <code>%%blog_name%%</code>, <code>%%blog_url%%</code>, <code>%%post_url%%</code>, <code>%%admin_url%%</code>,
311 + <code>%%post_title%%</code>, <code>%%post_content%%</code>, <code>%%post_cats%%</code>, <code>%%post_author%%</code>, <code>%%post_date%%</code>, <code>%%blog_name%%</code>, <code>%%blog_url%%</code>, <code>%%post_url%%</code>, <code>%%admin_url%%</code>,
287 312 <code>%%edit_link%%</code>, <code>%%delete_link%%</code>, <code>%%user_email%%</code>, <code>%%user_url%%</code>, <code>%%custom_field%%</code>, <code>%%custom_field_2%%</code></div></td>
288 313 </tr>
289 314 <tr>
290 315 <th scope="row"><label class="description"><?php esc_html_e('More Options', 'usp'); ?></label></th>
@@ -410,8 +435,13 @@
410 435 <td><input type="checkbox" value="1" name="usp_options[custom_checkbox]" <?php if (isset($usp_options['custom_checkbox'])) checked('1', $usp_options['custom_checkbox']); ?> />
411 436 <span class="mm-item-caption"><?php esc_html_e('Display custom checkbox on the submission form', 'usp'); ?></span></td>
412 437 </tr>
413 438 <tr>
439 + <th scope="row"><label class="description" for="usp_options[custom_checkbox_req]"><?php esc_html_e('Require Checkbox', 'usp'); ?></label></th>
440 + <td><input type="checkbox" value="1" name="usp_options[custom_checkbox_req]" <?php if (isset($usp_options['custom_checkbox_req'])) checked('1', $usp_options['custom_checkbox_req']); ?> />
441 + <span class="mm-item-caption"><?php esc_html_e('Make the custom checkbox required (uncheck to make optional)', 'usp'); ?></span></td>
442 + </tr>
443 + <tr>
414 444 <th scope="row"><label class="description" for="usp_options[custom_checkbox_name]"><?php esc_html_e('Checkbox Name', 'usp'); ?></label></th>
415 445 <td><input type="text" size="45" maxlength="200" name="usp_options[custom_checkbox_name]" value="<?php if (isset($usp_options['custom_checkbox_name'])) echo esc_attr($usp_options['custom_checkbox_name']); ?>" />
416 446 <div class="mm-item-caption"><?php esc_html_e('Use only alphanumeric, underscores, and dashes. If unsure, use the default name:', 'usp'); ?> <code>usp_custom_checkbox</code></div></td>
417 447 </tr>
@@ -462,9 +492,9 @@
462 492 </div>
463 493
464 494 <h3 id="usp-recaptcha"><?php esc_html_e('Google reCaptcha', 'usp'); ?></h3>
465 495 <div class="mm-table-wrap">
466 - <div class="mm-section-desc"><?php esc_html_e('To enable Google reCaptcha, enter your public and private keys.', 'usp'); ?></div>
496 + <div class="mm-section-desc"><?php esc_html_e('To enable Google reCaptcha, enter your public and private keys.', 'usp'); ?> <strong><?php esc_html_e('Important:', 'usp'); ?></strong> <?php esc_html_e('do NOT use both Google and Cloudflare captchas at the same time.', 'usp'); ?></div>
467 497 <table class="widefat mm-table">
468 498 <tr>
469 499 <th scope="row"><label class="description" for="usp_options[recaptcha_public]"><?php esc_html_e('Public Key', 'usp'); ?></label></th>
470 500 <td><input type="text" size="45" name="usp_options[recaptcha_public]" value="<?php if (isset($usp_options['recaptcha_public'])) echo esc_attr($usp_options['recaptcha_public']); ?>" />
@@ -484,8 +514,25 @@
484 514 </tr>
485 515 </table>
486 516 </div>
487 517
518 + <h3 id="usp-turnstile"><?php esc_html_e('Cloudflare Turnstile', 'usp'); ?></h3>
519 + <div class="mm-table-wrap">
520 + <div class="mm-section-desc"><?php esc_html_e('To enable Cloudflare Turnstile, enter your site key and secret key.', 'usp'); ?> <strong><?php esc_html_e('Important:', 'usp'); ?></strong> <?php esc_html_e('do NOT use both Google and Cloudflare captchas at the same time.', 'usp'); ?></div>
521 + <table class="widefat mm-table">
522 + <tr>
523 + <th scope="row"><label class="description" for="usp_options[turnstile_site_key]"><?php esc_html_e('Site Key', 'usp'); ?></label></th>
524 + <td><input type="text" size="45" name="usp_options[turnstile_site_key]" value="<?php if (isset($usp_options['turnstile_site_key'])) echo esc_attr($usp_options['turnstile_site_key']); ?>" />
525 + <div class="mm-item-caption"><?php esc_html_e('Enter your Site Key', 'usp'); ?></div></td>
526 + </tr>
527 + <tr>
528 + <th scope="row"><label class="description" for="usp_options[turnstile_secret_key]"><?php esc_html_e('Secret Key', 'usp'); ?></label></th>
529 + <td><input type="text" size="45" name="usp_options[turnstile_secret_key]" value="<?php if (isset($usp_options['turnstile_secret_key'])) echo esc_attr($usp_options['turnstile_secret_key']); ?>" />
530 + <div class="mm-item-caption"><?php esc_html_e('Enter your Secret Key', 'usp'); ?></div></td>
531 + </tr>
532 + </table>
533 + </div>
534 +
488 535 <h3 id="usp-image-uploads"><?php esc_html_e('Image Uploads', 'usp'); ?></h3>
489 536 <div class="mm-table-wrap">
490 537 <div class="mm-section-desc"><?php esc_html_e('Configure settings for image uploads.', 'usp'); ?></div>
491 538 <table class="widefat mm-table">
@@ -664,11 +711,11 @@
664 711 <h3><?php esc_html_e('Display the submit-post form', 'usp'); ?></h3>
665 712 <div class="shortcode-info">
666 713 <p><?php esc_html_e('USP enables you to display a post-submission form anywhere on your site.', 'usp'); ?></p>
667 714 <p><?php esc_html_e('Use the shortcode to display the form on any WP Post or Page:', 'usp'); ?></p>
668 - <pre>[user-submitted-posts]</pre>
715 + <div class="mm-pre">[user-submitted-posts]</div>
669 716 <p><?php esc_html_e('Or, use the template tag to display the form anywhere in your theme template:', 'usp'); ?></p>
670 - <pre>&lt;?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?&gt;</pre>
717 + <div class="mm-pre">&lt;?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?&gt;</div>
671 718 <p>
672 719 <?php esc_html_e('Want more than one form? Create unlimited submission forms, registration forms, contact forms and more with', 'usp'); ?>
673 720 <a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/usp-pro/"><?php esc_html_e('USP Pro', 'usp'); ?>&nbsp;&raquo;</a>
674 721 </p>
@@ -677,11 +724,11 @@
677 724 <h3><?php esc_html_e('Display the login/register form', 'usp'); ?></h3>
678 725 <div class="shortcode-info">
679 726 <p><?php esc_html_e('You also can display a simple form that enables users to log in, register, or reset their password.', 'usp'); ?></p>
680 727 <p><?php esc_html_e('Use the shortcode to display the form on any WP Post or Page:', 'usp'); ?></p>
681 - <pre>[usp-login-form]</pre>
728 + <div class="mm-pre">[usp-login-form]</div>
682 729 <p><?php esc_html_e('Or, use the template tag to display the form anywhere in your theme template:', 'usp'); ?></p>
683 - <pre>&lt;?php if (function_exists('usp_login_form')) usp_login_form(); ?&gt;</pre>
730 + <div class="mm-pre">&lt;?php if (function_exists('usp_login_form')) usp_login_form(); ?&gt;</div>
684 731 <p><?php esc_html_e('The login/register form displays as a tabbed interface, so users can switch between login, register, and reset password.', 'usp'); ?></p>
685 732 </div>
686 733
687 734 <h3><?php esc_html_e('Display user-submitted posts', 'usp'); ?></h3>
@@ -686,17 +733,17 @@
686 733
687 734 <h3><?php esc_html_e('Display user-submitted posts', 'usp'); ?></h3>
688 735 <div class="shortcode-info">
689 736 <p><?php esc_html_e('Use this shortcode to display a list of submitted posts on any WP Post or Page:', 'usp'); ?></p>
690 - <pre>[usp_display_posts]</pre>
737 + <div class="mm-pre">[usp_display_posts]</div>
691 738 <p><?php esc_html_e('Or, use the template tag to display a list of submitted posts anywhere in your theme template:', 'usp'); ?></p>
692 - <pre>&lt;?php if (function_exists('usp_display_posts')) echo usp_display_posts(array('userid' => 'all', 'numposts' => -1)); ?&gt;</pre>
739 + <div class="mm-pre">&lt;?php if (function_exists('usp_display_posts')) echo usp_display_posts(array('userid' => 'all', 'numposts' => -1)); ?&gt;</div>
693 740 <p><?php esc_html_e('Here are some examples showing how to configure this shortcode:', 'usp'); ?></p>
694 -<pre>[usp_display_posts] : default displays all submitted posts by all authors
741 +<div class="mm-pre">[usp_display_posts] : default displays all submitted posts by all authors
695 742 [usp_display_posts userid="1"] : displays all submitted posts by registered user with ID = 1
696 743 [usp_display_posts userid="Pat Smith"] : displays all submitted posts by author name "Pat Smith"
697 744 [usp_display_posts userid="all"] : displays all submitted posts by all users/authors
698 -[usp_display_posts userid="all" numposts="5"] : limit to 5 posts from all users</pre>
745 +[usp_display_posts userid="all" numposts="5"] : limit to 5 posts from all users</div>
699 746 <p>
700 747 <strong><?php esc_html_e('Tip:', 'usp'); ?></strong>
701 748 <?php esc_html_e('The pro version provides many more options for this shortcode.', 'usp'); ?>
702 749 <a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/usp-pro-display-list-submitted-posts/"><?php esc_html_e('Learn&nbsp;more', 'usp'); ?>&nbsp;&raquo;</a>
@@ -705,17 +752,17 @@
705 752
706 753 <h3><?php esc_html_e('Display image gallery', 'usp'); ?></h3>
707 754 <div class="shortcode-info">
708 755 <p><?php esc_html_e('Use this shortcode to display a gallery of uploaded images for each submitted post:', 'usp'); ?></p>
709 - <pre>[usp_gallery]</pre>
756 + <div class="mm-pre">[usp_gallery]</div>
710 757 <p><?php esc_html_e('Or, use the template tag to display an image gallery anywhere in your theme template:', 'usp'); ?></p>
711 - <pre>&lt;?php if (function_exists('usp_get_images')) $images = usp_get_images(); foreach ($images as $image) echo $image; ?&gt;</pre>
758 + <div class="mm-pre">&lt;?php if (function_exists('usp_get_images')) $images = usp_get_images(); foreach ($images as $image) echo $image; ?&gt;</div>
712 759 <p><?php esc_html_e('You can customize using any of the follwing attributes:', 'usp'); ?></p>
713 -<pre>$size = image size as thumbnail, medium, large or full -> default = thumbnail
760 +<div class="mm-pre">$size = image size as thumbnail, medium, large or full -> default = thumbnail
714 761 $before = text/markup displayed before the image URL -> default = {a href='%%url%%'}{img src='
715 762 $after = text/markup displayed after the image URL -> default = ' /}{/a}
716 763 $number = the number of images to display for each post -> default = false (display all)
717 -$postId = an optional post ID to use -> default = false (uses global/current post)</pre>
764 +$postId = an optional post ID to use -> default = false (uses global/current post)</div>
718 765 <p><strong><?php esc_html_e('Notes:', 'usp'); ?></strong></p>
719 766 <ul>
720 767 <li>
721 768 <?php esc_html_e('Use curly brackets', 'usp'); ?> <code>{</code> <code>}</code> <?php esc_html_e('to output angle brackets', 'usp'); ?>
@@ -733,13 +780,13 @@
733 780
734 781 <h3><?php esc_html_e('Reset Form Button', 'usp'); ?></h3>
735 782 <div class="shortcode-info">
736 783 <p><?php esc_html_e('This shortcode displays a link that resets the form to its original state:', 'usp'); ?></p>
737 - <pre>[usp-reset-button]</pre>
784 + <div class="mm-pre">[usp-reset-button]</div>
738 785 <p><?php esc_html_e('This shortcode accepts the following attributes:', 'usp'); ?></p>
739 -<pre>class = classes for the parent element (optional, default: none)
786 +<div class="mm-pre">class = classes for the parent element (optional, default: none)
740 787 value = link text (optional, default: "Reset form")
741 -url = the URL where your form is displayed (required, default: none)</pre>
788 +url = the URL where your form is displayed (required, default: none)</div>
742 789 <p><?php esc_html_e('Note that the url attribute accepts', 'usp'); ?> <code>%%current%%</code> <?php esc_html_e('to get the current URL.', 'usp'); ?></p>
743 790 </div>
744 791
745 792 <h3><?php esc_html_e('Access Control', 'usp'); ?></h3>
@@ -745,13 +792,13 @@
745 792 <h3><?php esc_html_e('Access Control', 'usp'); ?></h3>
746 793 <div class="shortcode-info">
747 794 <p><?php esc_html_e('USP provides three shortcodes to control access and restrict content.', 'usp'); ?></p>
748 795 <p><?php esc_html_e('Display content only to users with a specific capability:', 'usp'); ?></p>
749 - <pre>[usp_access cap="read" deny="Message for users without read capability"][/usp_access]</pre>
796 + <div class="mm-pre">[usp_access cap="read" deny="Message for users without read capability"][/usp_access]</div>
750 797 <p><?php esc_html_e('Display content to logged-in users:', 'usp'); ?></p>
751 - <pre>[usp_member deny="Message for users who are not logged in"][/usp_member]</pre>
798 + <div class="mm-pre">[usp_member deny="Message for users who are not logged in"][/usp_member]</div>
752 799 <p><?php esc_html_e('Display content to visitors only:', 'usp'); ?></p>
753 - <pre>[usp_visitor deny="Message for users who are logged in"][/usp_visitor]</pre>
800 + <div class="mm-pre">[usp_visitor deny="Message for users who are logged in"][/usp_visitor]</div>
754 801 <p>
755 802 <strong><?php esc_html_e('Tip:', 'usp'); ?></strong>
756 803 <?php esc_html_e('to include markup in the deny message, you can use', 'usp'); ?> <code>{tag}</code> <?php esc_html_e('to output', 'usp'); ?> <code>&lt;tag&gt;</code>.
757 804 </p>
@@ -756,15 +803,15 @@
756 803 <?php esc_html_e('to include markup in the deny message, you can use', 'usp'); ?> <code>{tag}</code> <?php esc_html_e('to output', 'usp'); ?> <code>&lt;tag&gt;</code>.
757 804 </p>
758 805 <p><strong><?php esc_html_e('Example', 'usp'); ?></strong></p>
759 806 <p><?php esc_html_e('If the user is logged in, display the post-submit form; or if the user is not logged in, display the login form:', 'usp'); ?></p>
760 -<pre>[usp_member]
807 +<div class="mm-pre">[usp_member]
761 808 [user-submitted-posts]
762 809 [/usp_member]
763 810
764 811 [usp_visitor]
765 812 [usp-login-form]
766 -[/usp_visitor]</pre>
813 +[/usp_visitor]</div>
767 814 <p>
768 815 <?php esc_html_e('The access shortcodes can be added to any WP Post or Page. So you can display forms and other content conditionally, based on user role and login status.', 'usp'); ?>
769 816 </p>
770 817 <p class="no-bottom-margin">
@@ -801,9 +848,9 @@
801 848 </div>
802 849
803 850 <div id="mm-credit-info">
804 851 <a target="_blank" rel="noopener noreferrer" href="https://perishablepress.com/user-submitted-posts/" title="<?php esc_attr_e('Plugin Homepage', 'usp'); ?>"><?php echo USP_PLUGIN; ?></a> <?php esc_html_e('by', 'usp'); ?>
805 - <a target="_blank" rel="noopener noreferrer" href="https://twitter.com/perishable" title="<?php esc_attr_e('Jeff Starr on Twitter', 'usp'); ?>">Jeff Starr</a> @
852 + <a target="_blank" rel="noopener noreferrer" href="https://x.com/perishable" title="<?php esc_attr_e('Jeff Starr on X (Twitter)', 'usp'); ?>">Jeff Starr</a> @
806 853 <a target="_blank" rel="noopener noreferrer" href="https://monzillamedia.com/" title="<?php esc_attr_e('Obsessive Web Design &amp; Development', 'usp'); ?>">Monzilla Media</a>
807 854 </div>
808 855 </form>
809 856 </div>