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

Closed
codente opened this issue Feb 22, 2024 · 4 comments
Closed

Preview doesn't show any Beaver Builder content #172

codente opened this issue Feb 22, 2024 · 4 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!

@jimbowermandesign
Copy link

I apologize in advance for this (newbie here), where can I download the plug-in with this fix? I inherited a site using Beaver Builder and this is driving me nuts.

@ocean90
Copy link
Owner

ocean90 commented Nov 16, 2024

Thank you for providing the snippet! Everyone who is also using Beaver Builder, please copy the above snippet to your theme's function.php.

@ocean90 ocean90 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2024
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

5 participants