Skip to content

iAPI: Implement a data-wp-if directiveΒ #70878

@DAreRodz

Description

@DAreRodz

What problem does this address?

For now, we haven't required a directive to render HTML conditionally. However, there are cases where it has proven to be useful, rather than using techniques like adding the attribute hidden to those elements that shouldn't be displayed.

Related discussion for a data-wp-show directive: #53058

What is your proposed solution?

The data-wp-if directive implementation was delayed, waiting for the WP HTML API to support adding inner elements natively rather than relying on the iAPI's custom logic. We could keep waiting for this feature to be implemented or make the necessary changes to WP_Interactivity_API_Directives_Processor to support this directive.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions