Page Guard
开发者 |
Frank Culross
|
更新时间 |
2022年8月23日 00:30 |
捐献地址: |
去捐款 |
PHP版本: |
4.7 及以上 |
WordPress版本: |
6.0.1 |
版权: |
GPLv2 or later |
版权网址: |
版权信息
|
详情介绍:
Page Guard uses a single URL parameter or POST variable as a means of providing a token to guard access to any page on which this plugin's shortcode is placed. Output of alternative content can be made to occur when the token is missing or fails to match what is expected - if the token received matches the expected one, the controlled content can be revealed to the visitor.
For this version, an additional shortcode attribute "title" also allows the page title to be changed conditionally PROVIDED JAVASCRIPT IS ENABLED IN THE BROWSER (it has no effect if JavaScript is turned off!)
The shortcode to use is 'pageguard' - its attributes are:
tokenparam (required) -> a string value containing the name of the token URL param - e.g. 'mytoken'
eq (optional) -> a string value containing the expected value of the tokenparam - e.g. 'x34ggj45b'
ne (optional) -> as for "eq" but when used, shortcode will output content on non matching token
absent (optional) -> when absent="1", shortcode will output content on detection of missing token
title (optional) -> a string containing a page title to apply when the parent shortcode's criteria are met
Syntax examples:
show block on matching token -
[pageguard param="token" eq="download"]
Text to be output on matching token found
[/pageguard]
show block on non match + change title
[pageguard tokenparam="token" ne="download" title="Downloads - invalid token"]
Error text for output when token fails to match
[/pageguard]
show this on no token found + change title
[pageguard tokenparam="token" absent="1" title="Downloads - missing token"]
Error text for output when token is missing
[/pageguard]
安装:
- To install the plugin, download the zip file and upload via the plugin interface of your WordPress site or install the plugin through the WordPress plugins screen directly.
- Activate the plugin through the 'Plugins' screen in WordPress
更新日志:
1.1
Added JavaScript based support for changing page title to match shortcode criteria
1.0
First implementation