Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview doesn't show any Beaver Builder content #172

Open
codente opened this issue Feb 22, 2024 · 2 comments
Open

Preview doesn't show any Beaver Builder content #172

codente opened this issue Feb 22, 2024 · 2 comments

Comments

@codente
Copy link

codente commented Feb 22, 2024

Starting in version 2.7.4.3 of Beaver Builder, there are security fixes that prevent non-public posts (like drafts) from being rendered by BB to people without access.

So this plugin stops working with Beaver Builder

There is a filter that can be used to adjust this though and we came up with the following:

add_filter( 'fl_render_content_by_id_can_view', function( $can_view, $post_id ) {
	if ( class_exists( 'DS_Public_Post_Preview' ) ) {
		$post_ids = get_option( 'public_post_preview', array() );
		$post_ids = array_map( 'intval', $post_ids );
		$can_view = ( in_array( $post_id, $post_ids ) ) ? true : $can_view;
	}
	return $can_view;
}, 10, 2 );

Would you be interested in adding this to your plugin for compatibility?

@ewelin34
Copy link

Can confirm this fix works! Thanks for being sharing!

@jjmss
Copy link

jjmss commented May 22, 2024

Can confirm aswell, works as expected :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants