وەسف
This plugin adds a block to your block editor.
This block changes its display depending on a current user’s capability.
- You can set capability for block.
- If a current user has a capability for the block, its content will be replaced.
- Or else, block is displayed as log in link.
- This block is an inner block, so you can nest any blocks inside it. Convert it to a reusable block for your productivity.
See screenshot for how block will be displayed.
This plugin use REST API to convert block content, so you can use it with cached WordPress.
Even if you use CDN like CloudFront or Cloudflare, this plugin displays proper contents for each users.
For performance enhancement, Cookie Tasting is recommended.
It decreases server access including REST API by checking COOKIE value before accessing to server side script.
Hooks
Display Customization
fyeo_tag_line– Customize the default tagline displayed to users without capability.%swill be replaced with login URL.fyeo_login_url– Replace the login URL. Default iswp_login_url().fyeo_redirect_url– Customize redirect URL after login. Receives post object as second argument.fyeo_redirect_key– Change query parameter key for redirect. Default isredirect_to.-
fyeo_enqueue_style– Whether to enqueue default theme style. Returnfalseto disable.Capability Control
-
fyeo_capabilities_list– Customize available capabilities list shown in block settings. fyeo_default_capability– Change default capability. Default isread.-
fyeo_user_has_cap– Override capability check result. Receives$has_cap,$capability,$user.Rendering
-
fyeo_default_render_style– Set default rendering style. Returndynamicfor PHP rendering, empty string for async. -
fyeo_can_display_non_public– Allow displaying restricted content for non-public posts. Receives$postobject.REST API
-
fyeo_minimum_rest_capability– Control REST API access. Returnfalseto deny access.
بڵۆکەکان
ئەم پێوەکراوە 1 بڵۆک دابین دەکات.
- Restricted Block This block will be displayed only for specified users.
دامەزراندن
- Upload the plugin files to the
/wp-content/plugins/for-your-eyes-onlydirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the ‘Plugins’ screen in WordPress
- You get new block named Restricted Block on Block Editor.
پهد
-
How to Contribute
-
We host our code on Github, so feel free to send PR or issues.
پێداچوونەوەکان
هیچ پێداچوونەوەیەک نەنووسراوە بۆ ئەم پێوەکراوە.
بەشداربووان و گەشەپێدەران
“For Your Eyes Only” نەرمەواڵەیەکی سەرچاوە کراوەیە. ئەم کەسانەی خوارەوە بەشدارییان تێدا کردووە.
بەشداربووان“For Your Eyes Only” وەرگێڕدراوە بۆ 1 زمان. سوپاسی وەرگێڕەکان دەکەین بۆ بەشداریکردنیان.
“For Your Eyes Only” وەربگێڕە بۆ زمانەکەی خۆت.
دەتەوێت بەشداربیت لە گەشەپێدان؟
گەڕان لە کۆدەکەدا بکە، سەیری تەمارگەی (SVN) بکە، یان بەشداربە لە ڕووداوتۆماری گەشەپێدان لە ڕێگەی (RSS).
ڕووداوتۆمارگەریی گۆڕین
1.2.1
- Bump PHP and WordPress requirements.
- Arranged tranpilation structure.
1.1.0
- Ownership is now changed. Thanks to @hametuha for taking over this plugin.
- Add dynamic mode. This works as PHP rendering.
1.0.1
- Add auto deploy.
1.0.0
- First Release.

