| @@ -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'); ?> » | |
| 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>%%post_date%%</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>%%post_date%%</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> |
| @@ -467,9 +492,9 @@ | ||
| 467 | 492 | </div> |
| 468 | 493 | |
| 469 | 494 | <h3 id="usp-recaptcha"><?php esc_html_e('Google reCaptcha', 'usp'); ?></h3> |
| 470 | 495 | <div class="mm-table-wrap"> |
| 471 | - <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> | |
| 472 | 497 | <table class="widefat mm-table"> |
| 473 | 498 | <tr> |
| 474 | 499 | <th scope="row"><label class="description" for="usp_options[recaptcha_public]"><?php esc_html_e('Public Key', 'usp'); ?></label></th> |
| 475 | 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']); ?>" /> |
| @@ -489,8 +514,25 @@ | ||
| 489 | 514 | </tr> |
| 490 | 515 | </table> |
| 491 | 516 | </div> |
| 492 | 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 | + | |
| 493 | 535 | <h3 id="usp-image-uploads"><?php esc_html_e('Image Uploads', 'usp'); ?></h3> |
| 494 | 536 | <div class="mm-table-wrap"> |
| 495 | 537 | <div class="mm-section-desc"><?php esc_html_e('Configure settings for image uploads.', 'usp'); ?></div> |
| 496 | 538 | <table class="widefat mm-table"> |
| @@ -669,11 +711,11 @@ | ||
| 669 | 711 | <h3><?php esc_html_e('Display the submit-post form', 'usp'); ?></h3> |
| 670 | 712 | <div class="shortcode-info"> |
| 671 | 713 | <p><?php esc_html_e('USP enables you to display a post-submission form anywhere on your site.', 'usp'); ?></p> |
| 672 | 714 | <p><?php esc_html_e('Use the shortcode to display the form on any WP Post or Page:', 'usp'); ?></p> |
| 673 | - <pre>[user-submitted-posts]</pre> | |
| 715 | + <div class="mm-pre">[user-submitted-posts]</div> | |
| 674 | 716 | <p><?php esc_html_e('Or, use the template tag to display the form anywhere in your theme template:', 'usp'); ?></p> |
| 675 | - <pre><?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?></pre> | |
| 717 | + <div class="mm-pre"><?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?></div> | |
| 676 | 718 | <p> |
| 677 | 719 | <?php esc_html_e('Want more than one form? Create unlimited submission forms, registration forms, contact forms and more with', 'usp'); ?> |
| 678 | 720 | <a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/usp-pro/"><?php esc_html_e('USP Pro', 'usp'); ?> »</a> |
| 679 | 721 | </p> |
| @@ -682,11 +724,11 @@ | ||
| 682 | 724 | <h3><?php esc_html_e('Display the login/register form', 'usp'); ?></h3> |
| 683 | 725 | <div class="shortcode-info"> |
| 684 | 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> |
| 685 | 727 | <p><?php esc_html_e('Use the shortcode to display the form on any WP Post or Page:', 'usp'); ?></p> |
| 686 | - <pre>[usp-login-form]</pre> | |
| 728 | + <div class="mm-pre">[usp-login-form]</div> | |
| 687 | 729 | <p><?php esc_html_e('Or, use the template tag to display the form anywhere in your theme template:', 'usp'); ?></p> |
| 688 | - <pre><?php if (function_exists('usp_login_form')) usp_login_form(); ?></pre> | |
| 730 | + <div class="mm-pre"><?php if (function_exists('usp_login_form')) usp_login_form(); ?></div> | |
| 689 | 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> |
| 690 | 732 | </div> |
| 691 | 733 | |
| 692 | 734 | <h3><?php esc_html_e('Display user-submitted posts', 'usp'); ?></h3> |
| @@ -691,17 +733,17 @@ | ||
| 691 | 733 | |
| 692 | 734 | <h3><?php esc_html_e('Display user-submitted posts', 'usp'); ?></h3> |
| 693 | 735 | <div class="shortcode-info"> |
| 694 | 736 | <p><?php esc_html_e('Use this shortcode to display a list of submitted posts on any WP Post or Page:', 'usp'); ?></p> |
| 695 | - <pre>[usp_display_posts]</pre> | |
| 737 | + <div class="mm-pre">[usp_display_posts]</div> | |
| 696 | 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> |
| 697 | - <pre><?php if (function_exists('usp_display_posts')) echo usp_display_posts(array('userid' => 'all', 'numposts' => -1)); ?></pre> | |
| 739 | + <div class="mm-pre"><?php if (function_exists('usp_display_posts')) echo usp_display_posts(array('userid' => 'all', 'numposts' => -1)); ?></div> | |
| 698 | 740 | <p><?php esc_html_e('Here are some examples showing how to configure this shortcode:', 'usp'); ?></p> |
| 699 | -<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 | |
| 700 | 742 | [usp_display_posts userid="1"] : displays all submitted posts by registered user with ID = 1 |
| 701 | 743 | [usp_display_posts userid="Pat Smith"] : displays all submitted posts by author name "Pat Smith" |
| 702 | 744 | [usp_display_posts userid="all"] : displays all submitted posts by all users/authors |
| 703 | -[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> | |
| 704 | 746 | <p> |
| 705 | 747 | <strong><?php esc_html_e('Tip:', 'usp'); ?></strong> |
| 706 | 748 | <?php esc_html_e('The pro version provides many more options for this shortcode.', 'usp'); ?> |
| 707 | 749 | <a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/usp-pro-display-list-submitted-posts/"><?php esc_html_e('Learn more', 'usp'); ?> »</a> |
| @@ -710,17 +752,17 @@ | ||
| 710 | 752 | |
| 711 | 753 | <h3><?php esc_html_e('Display image gallery', 'usp'); ?></h3> |
| 712 | 754 | <div class="shortcode-info"> |
| 713 | 755 | <p><?php esc_html_e('Use this shortcode to display a gallery of uploaded images for each submitted post:', 'usp'); ?></p> |
| 714 | - <pre>[usp_gallery]</pre> | |
| 756 | + <div class="mm-pre">[usp_gallery]</div> | |
| 715 | 757 | <p><?php esc_html_e('Or, use the template tag to display an image gallery anywhere in your theme template:', 'usp'); ?></p> |
| 716 | - <pre><?php if (function_exists('usp_get_images')) $images = usp_get_images(); foreach ($images as $image) echo $image; ?></pre> | |
| 758 | + <div class="mm-pre"><?php if (function_exists('usp_get_images')) $images = usp_get_images(); foreach ($images as $image) echo $image; ?></div> | |
| 717 | 759 | <p><?php esc_html_e('You can customize using any of the follwing attributes:', 'usp'); ?></p> |
| 718 | -<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 | |
| 719 | 761 | $before = text/markup displayed before the image URL -> default = {a href='%%url%%'}{img src=' |
| 720 | 762 | $after = text/markup displayed after the image URL -> default = ' /}{/a} |
| 721 | 763 | $number = the number of images to display for each post -> default = false (display all) |
| 722 | -$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> | |
| 723 | 765 | <p><strong><?php esc_html_e('Notes:', 'usp'); ?></strong></p> |
| 724 | 766 | <ul> |
| 725 | 767 | <li> |
| 726 | 768 | <?php esc_html_e('Use curly brackets', 'usp'); ?> <code>{</code> <code>}</code> <?php esc_html_e('to output angle brackets', 'usp'); ?> |
| @@ -738,13 +780,13 @@ | ||
| 738 | 780 | |
| 739 | 781 | <h3><?php esc_html_e('Reset Form Button', 'usp'); ?></h3> |
| 740 | 782 | <div class="shortcode-info"> |
| 741 | 783 | <p><?php esc_html_e('This shortcode displays a link that resets the form to its original state:', 'usp'); ?></p> |
| 742 | - <pre>[usp-reset-button]</pre> | |
| 784 | + <div class="mm-pre">[usp-reset-button]</div> | |
| 743 | 785 | <p><?php esc_html_e('This shortcode accepts the following attributes:', 'usp'); ?></p> |
| 744 | -<pre>class = classes for the parent element (optional, default: none) | |
| 786 | +<div class="mm-pre">class = classes for the parent element (optional, default: none) | |
| 745 | 787 | value = link text (optional, default: "Reset form") |
| 746 | -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> | |
| 747 | 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> |
| 748 | 790 | </div> |
| 749 | 791 | |
| 750 | 792 | <h3><?php esc_html_e('Access Control', 'usp'); ?></h3> |
| @@ -750,13 +792,13 @@ | ||
| 750 | 792 | <h3><?php esc_html_e('Access Control', 'usp'); ?></h3> |
| 751 | 793 | <div class="shortcode-info"> |
| 752 | 794 | <p><?php esc_html_e('USP provides three shortcodes to control access and restrict content.', 'usp'); ?></p> |
| 753 | 795 | <p><?php esc_html_e('Display content only to users with a specific capability:', 'usp'); ?></p> |
| 754 | - <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> | |
| 755 | 797 | <p><?php esc_html_e('Display content to logged-in users:', 'usp'); ?></p> |
| 756 | - <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> | |
| 757 | 799 | <p><?php esc_html_e('Display content to visitors only:', 'usp'); ?></p> |
| 758 | - <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> | |
| 759 | 801 | <p> |
| 760 | 802 | <strong><?php esc_html_e('Tip:', 'usp'); ?></strong> |
| 761 | 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><tag></code>. |
| 762 | 804 | </p> |
| @@ -761,15 +803,15 @@ | ||
| 761 | 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><tag></code>. |
| 762 | 804 | </p> |
| 763 | 805 | <p><strong><?php esc_html_e('Example', 'usp'); ?></strong></p> |
| 764 | 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> |
| 765 | -<pre>[usp_member] | |
| 807 | +<div class="mm-pre">[usp_member] | |
| 766 | 808 | [user-submitted-posts] |
| 767 | 809 | [/usp_member] |
| 768 | 810 | |
| 769 | 811 | [usp_visitor] |
| 770 | 812 | [usp-login-form] |
| 771 | -[/usp_visitor]</pre> | |
| 813 | +[/usp_visitor]</div> | |
| 772 | 814 | <p> |
| 773 | 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'); ?> |
| 774 | 816 | </p> |
| 775 | 817 | <p class="no-bottom-margin"> |
| @@ -806,9 +848,9 @@ | ||
| 806 | 848 | </div> |
| 807 | 849 | |
| 808 | 850 | <div id="mm-credit-info"> |
| 809 | 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'); ?> |
| 810 | - <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> @ | |
| 811 | 853 | <a target="_blank" rel="noopener noreferrer" href="https://monzillamedia.com/" title="<?php esc_attr_e('Obsessive Web Design & Development', 'usp'); ?>">Monzilla Media</a> |
| 812 | 854 | </div> |
| 813 | 855 | </form> |
| 814 | 856 | </div> |