Changeset 1820910
- Timestamp:
- 02/12/2018 11:29:32 PM (8 years ago)
- Location:
- hide-this/tags/1.1.3
- Files:
-
- 2 edited
-
README.md (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hide-this/tags/1.1.3/README.md
r1263269 r1820910 11 11 **Basic usage:** 12 12 13 `[hide]Lorem ipsum dolor sit amet.[/hide]` 13 ``` 14 [hide]Lorem ipsum dolor sit amet.[/hide] 15 ``` 14 16 15 17 This example will hide that content for all the site visitors. But you can be more specific by using attributes. … … 24 26 25 27 Hide your content to all visitors: 26 `[hide]Lorem ipsum dolor sit amet.[/hide]` 28 29 ``` 30 [hide]Lorem ipsum dolor sit amet.[/hide] 31 ``` 27 32 28 33 Hide your content to all visitors, except for a specific user: 29 `[hide for="all" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]` 34 35 ``` 36 [hide for="all" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide] 37 ``` 30 38 31 39 Hide your content to all non-logged visitors: 32 `[hide for="!logged"]Lorem ipsum dolor sit amet.[/hide]` 40 41 ``` 42 [hide for="!logged"]Lorem ipsum dolor sit amet.[/hide] 43 ``` 33 44 34 45 Hide your content to all logged in visitors: 35 `[hide for="logged"]Lorem ipsum dolor sit amet.[/hide]` 46 47 ``` 48 [hide for="logged"]Lorem ipsum dolor sit amet.[/hide] 49 ``` 36 50 37 51 Hide your content to all logged in visitors, except for a specific user: 38 `[hide for="logged" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]` 52 53 ``` 54 [hide for="logged" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide] 55 ``` 39 56 40 57 Hide your content for some specific role: 41 `[hide for="contributor"]Lorem ipsum dolor sit amet.[/hide]` 58 59 ``` 60 [hide for="contributor"]Lorem ipsum dolor sit amet.[/hide] 61 ``` 42 62 43 63 Hide your content for two specific roles: 44 `[hide for="editor, contributor"]Lorem ipsum dolor sit amet.[/hide]` 64 65 ``` 66 [hide for="editor, contributor"]Lorem ipsum dolor sit amet.[/hide] 67 ``` 45 68 46 69 Hide your content for all visitors except for a specific role: 47 `[hide for="!administrator"]Lorem ipsum dolor sit amet.[/hide]` 48 `[hide for="all" exclude="administrator"]Lorem ipsum dolor sit amet.[/hide]` 70 71 ``` 72 [hide for="!administrator"]Lorem ipsum dolor sit amet.[/hide] 73 [hide for="all" exclude="administrator"]Lorem ipsum dolor sit amet.[/hide] 74 ``` 49 75 50 76 Hide your content for all visitors except for two specific roles: 51 `[hide for="!administrator, !editor"]Lorem ipsum dolor sit amet.[/hide]` 52 `[hide for="all" exclude="administrator, editor"]Lorem ipsum dolor sit amet.[/hide]` 77 78 ``` 79 [hide for="!administrator, !editor"]Lorem ipsum dolor sit amet.[/hide] 80 [hide for="all" exclude="administrator, editor"]Lorem ipsum dolor sit amet.[/hide] 81 ``` 53 82 54 83 Hide your content for users with a specific role and a specific capability: 55 `[hide for="some_role:do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]` 84 85 ``` 86 [hide for="some_role:do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide] 87 ``` 56 88 57 89 Hide your content for users with a specific role, not having a specific capability: 58 `[hide for="some_role:!do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]` 90 91 ``` 92 [hide for="some_role:!do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide] 93 ``` 59 94 60 95 Hide your content for users with a specific capability: 61 `[hide for=":do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]` 96 97 ``` 98 [hide for=":do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide] 99 ``` 62 100 63 101 Hide your content for a specific user by user name: 64 `[hide for="username:foo"]` 102 103 ``` 104 [hide for="username:foo"]Lorem ipsum dolor sit amet.[/hide] 105 ``` 65 106 66 107 Hide your content for a specific user by user ID: 67 `[hide for="userid:42"]` 108 109 ``` 110 [hide for="userid:42"]Lorem ipsum dolor sit amet.[/hide] 111 ``` 68 112 69 113 Hide your content for a specific user by user email: 70 `[hide for="useremail:foo@mail.com"]` 114 115 ``` 116 [hide for="useremail:foo@mail.com"]Lorem ipsum dolor sit amet.[/hide] 117 ``` 71 118 72 119 Hide your content for everyone except for a specific user by user name: 73 `[hide for="username:!foo"]` 120 121 ``` 122 [hide for="username:!foo"]Lorem ipsum dolor sit amet.[/hide] 123 ``` 74 124 75 125 You should get the idea by now. Notice how you can use `!` to deny values such as login status, roles, capabilities and user values. … … 79 129 This plugin offers hooks for filters, so you can modify its functionality or add your own. 80 130 81 * `hide_this_attributes`: Modify the attributes that the shortcode receives. 131 * `hide_this_attributes`: Modify the attributes that the shortcode receives. 82 132 * `hide_this_content`: Modify the full content that the shortcode prints. 83 133 * `hide_this_hide_rules`: Modify rules for hiding content. -
hide-this/tags/1.1.3/readme.txt
r1638289 r1820910 4 4 Tags: hide, content, user, role, capability 5 5 Requires at least: 3.0 6 Tested up to: 4. 76 Tested up to: 4.9 7 7 Stable tag: 1.1.3 8 8 License: GPLv2 or later … … 34 34 35 35 Hide your content to all visitors: 36 `[hide]Lorem ipsum dolor sit amet.[/hide]` 36 37 ` 38 [hide]Lorem ipsum dolor sit amet.[/hide] 39 ` 37 40 38 41 Hide your content to all visitors, except for a specific user: 39 `[hide for="all" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]` 42 43 ` 44 [hide for="all" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide] 45 ` 40 46 41 47 Hide your content to all non-logged visitors: 42 `[hide for="!logged"]Lorem ipsum dolor sit amet.[/hide]` 48 49 ` 50 [hide for="!logged"]Lorem ipsum dolor sit amet.[/hide] 51 ` 43 52 44 53 Hide your content to all logged in visitors: 45 `[hide for="logged"]Lorem ipsum dolor sit amet.[/hide]` 54 55 ` 56 [hide for="logged"]Lorem ipsum dolor sit amet.[/hide] 57 ` 46 58 47 59 Hide your content to all logged in visitors, except for a specific user: 48 `[hide for="logged" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]` 60 61 ` 62 [hide for="logged" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide] 63 ` 49 64 50 65 Hide your content for some specific role: 51 `[hide for="contributor"]Lorem ipsum dolor sit amet.[/hide]` 66 67 ` 68 [hide for="contributor"]Lorem ipsum dolor sit amet.[/hide] 69 ` 52 70 53 71 Hide your content for two specific roles: 54 `[hide for="editor, contributor"]Lorem ipsum dolor sit amet.[/hide]` 72 73 ` 74 [hide for="editor, contributor"]Lorem ipsum dolor sit amet.[/hide] 75 ` 55 76 56 77 Hide your content for all visitors except for a specific role: 57 `[hide for="!administrator"]Lorem ipsum dolor sit amet.[/hide]` 58 `[hide for="all" exclude="administrator"]Lorem ipsum dolor sit amet.[/hide]` 78 79 ` 80 [hide for="!administrator"]Lorem ipsum dolor sit amet.[/hide] 81 [hide for="all" exclude="administrator"]Lorem ipsum dolor sit amet.[/hide] 82 ` 59 83 60 84 Hide your content for all visitors except for two specific roles: 61 `[hide for="!administrator, !editor"]Lorem ipsum dolor sit amet.[/hide]` 62 `[hide for="all" exclude="administrator, editor"]Lorem ipsum dolor sit amet.[/hide]` 85 86 ` 87 [hide for="!administrator, !editor"]Lorem ipsum dolor sit amet.[/hide] 88 [hide for="all" exclude="administrator, editor"]Lorem ipsum dolor sit amet.[/hide] 89 ` 63 90 64 91 Hide your content for users with a specific role and a specific capability: 65 `[hide for="some_role:do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]` 92 93 ` 94 [hide for="some_role:do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide] 95 ` 66 96 67 97 Hide your content for users with a specific role, not having a specific capability: 68 `[hide for="some_role:!do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]` 98 99 ` 100 [hide for="some_role:!do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide] 101 ` 69 102 70 103 Hide your content for users with a specific capability: 71 `[hide for=":do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]` 104 105 ` 106 [hide for=":do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide] 107 ` 72 108 73 109 Hide your content for a specific user by user name: 74 `[hide for="username:foo"]` 110 111 ` 112 [hide for="username:foo"]Lorem ipsum dolor sit amet.[/hide] 113 ` 75 114 76 115 Hide your content for a specific user by user ID: 77 `[hide for="userid:42"]` 116 117 ` 118 [hide for="userid:42"]Lorem ipsum dolor sit amet.[/hide] 119 ` 78 120 79 121 Hide your content for a specific user by user email: 80 `[hide for="useremail:foo@mail.com"]` 122 123 ` 124 [hide for="useremail:foo@mail.com"]Lorem ipsum dolor sit amet.[/hide] 125 ` 81 126 82 127 Hide your content for everyone except for a specific user by user name: 83 `[hide for="username:!foo"]` 128 129 ` 130 [hide for="username:!foo"]Lorem ipsum dolor sit amet.[/hide] 131 ` 84 132 85 133 You should get the idea by now. Notice how you can use `!` to deny values such as login status, roles, capabilities and user values.
Note: See TracChangeset
for help on using the changeset viewer.