Skip to content

Content blocker incompatible with bricks builder #121

@JUVOJustin

Description

@JUVOJustin

I noticed that the content blocker feature is incompatible with the bricks builder. This is most likely since it does not send its content through the_content.

However, there is a bricks filter one could utilize to achieve the same:

// Add bricks support to members
add_filter( 'bricks/frontend/render_data', function($content, $post, $area) {

    // Make sure members plugin is active
    if (!function_exists('members_content_permissions_protect')) {
        return $content;
    }

    if ($area != 'content') {
        return $content;
    }
    return members_content_permissions_protect($content);
}, 95, 3);

I did test this and i works. There might be some edge cases I am currently not aware of. The filter is documented here: https://academy.bricksbuilder.io/article/filter-bricks-frontend-render_data/

I would love to see this merged into the plugin. If I get some subtle hint where to best add the code, i will happily provide a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions