Linux 软件免费装
Banner图

HRTSoftX - Conditional Elements

开发者 hrtsoftx
更新时间 2026年10月8日 12:39
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

hooks user roles conditional content content visibility display conditions

下载

1.0.0

详情介绍:

Conditional Elements lets you create content with the WordPress block editor, add it to WordPress hooks, and control when it is displayed. Create Gutenberg content, choose where it should appear, and configure conditions to control its visibility. You can include or exclude content based on configured conditions, control visibility by user role or device, and use custom WordPress action hooks when you need more flexibility. Key Features Placement Conditional Elements provides theme-aware placement options based on the active theme. For supported classic themes, additional theme-specific placement options may be available. For other classic themes, common WordPress hook locations are available, including: For WordPress block themes, supported placement locations include: Available placement options depend on the active theme and its supported hooks. You can also use Custom Hook to add content to any WordPress action hook. Conditions Conditional Elements provides several ways to control when content is displayed. Include Display content when the configured conditions match. Exclude Prevent content from being displayed when the configured conditions match. User Role Control content visibility based on the current user's WordPress role. Device Visibility Control visibility based on the visitor's device: Shortcode Each Conditional Element has a shortcode that can be copied directly from the Shortcode column in the Conditional Elements list table. Example: [hrtcel_element id=32] Use the shortcode anywhere WordPress supports shortcodes. The shortcode respects the Conditional Element's configured conditions by default. Bypass Conditions You can optionally bypass the configured conditions by passing bypass_conditions="true". Example: [hrtcel_element id=32 bypass_conditions="true"] This renders the element's content without applying its configured conditional rules.

安装:

  1. Install Conditional Elements through the WordPress plugin directory or upload the plugin files to the /wp-content/plugins/hrtsoftx-conditional-elements/ directory.
  2. Activate the plugin through the Plugins screen in WordPress.
  3. Go to Conditional Elements in the WordPress admin area.
  4. Create your content using the WordPress block editor.
  5. Select a placement and configure your conditions.
  6. Publish your Conditional Element.
  7. Copy the shortcode from the Shortcode column when you want to render the element directly.

屏幕截图:

  • Build your content with the familiar Gutenberg block editor.
  • Element Settings sidebar: choose placement, set priority and open display rules.
  • Display Rules modal: include and exclude locations and target user roles.
  • Frontend example: a Black Friday top bar rendered before the header.

常见问题:

Which themes are supported?

Conditional Elements supports WordPress block themes and includes integrations for popular classic themes such as Astra, Kadence, GeneratePress, Neve, and OceanWP. For other classic themes, common WordPress hook locations are available where supported by the theme. You can also use Custom Hook to add content to any WordPress action hook.

Can I use my own WordPress hook?

Yes. Use the Custom Hook placement and enter one or more WordPress action hooks separated by commas.

Does Conditional Elements work with Gutenberg?

Yes. Conditional Elements uses the WordPress block editor to create and manage content.

Can I control content visibility based on conditions?

Yes. You can configure include and exclude conditions to control when your content is displayed.

Can I control content visibility based on user roles?

Yes. You can configure user role conditions to control who can see your content.

Can I control content visibility by device?

Yes. Device visibility conditions let you show or hide content for desktop, tablet, or mobile devices.

Can I use Conditional Elements with a shortcode?

Yes. Every Conditional Element has a shortcode available from the Shortcode column in the Conditional Elements list table. For example: [hrtcel_element id=32]

Can I bypass conditions when using a shortcode?

Yes. Add bypass_conditions="true" to the shortcode. For example: [hrtcel_element id=32 bypass_conditions="true"] This renders the element without applying its configured conditional rules.

更新日志:

1.0.0