| 开发者 | prototipo88 |
|---|---|
| 更新时间 | 2026年6月12日 15:26 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[riaco_content_protector] Hidden text here [/riaco_content_protector][riaco_content_protector] This text will be hidden until the visitor enters the password. [/riaco_content_protector]
Set the global password under:
Settings > Content Protector
Visitors will see a modern, styled form.\
After entering the correct password:
riaco_cp_unlocked_global. The scope suffix global can be changed via the riaco_cp_cookie_scope filter, which also changes the cookie name accordingly.
Style
You can style the content protector box.
It has this class: .riaco-cp--container, so you can add in your style.css:
.riaco-cp--container { background: #f8f9fa; padding: 20px; border: 1px solid #ddd; border-radius: 6px; }
You can replace button classes using:
add_filter( 'riaco_cp_button_classes', function( $classes ) { return 'button my-custom-button-class'; });
Or you can remove button classes:
add_filter( 'riaco_cp_button_classes', function( $classes ) { return str_replace( 'wp-element-button', '', $classes ); });
/wp-content/plugins/[riaco_content_protector] This is hidden. [/riaco_content_protector]= Can I protect multiple sections on the same page? =\ Yes. All instances use the same global password and unlock together. = Does this protect the entire post? =\ No — only the content wrapped in the shortcode. No, the global password is stored in plain text like WordPress page passwords for easy admin management. = Does this work with Gutenberg / block editor? =\ Yes. It works in both Classic and Block Editor.\ You can insert the shortcode inside Paragraph block or using Shortcode block.
All previously unlocked content cookies are invalidated. Users must re-enter the new password.
riaco_cp_content_access filter to override the cookie check (role/subscription bypass)riaco_cp_locked_html filter to replace the full locked-form HTMLriaco_cp_validate_password filter for custom password validation (per-post passwords, etc.)riaco_cp_rate_limit_bypass filter to exempt trusted IPs from the brute-force counterriaco_cp_cookie_scope filter for per-post or per-instance independent lock stateriaco_cp_ajax_response filter to inject extra fields into the unlock JSON responseriaco_cp_js_data filter to extend the RIACO_CP_Ajax JavaScript objectriaco_cp_settings_page_after action for extensions to add their own settings formriaco_cp:before_submit, riaco_cp:unlock_success, riaco_cp:unlock_error