Skip Navigation

[Resuelto] Turn off automatic live preview for Toolset in Gutenberg

This support ticket is created hace 2 años, 2 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Waqar hace 2 años, 2 meses.

Asistido por: Waqar.

Autor
Mensajes
#2462921

Hi team,

Toolset's live preview inside Gutenberg feature while editing specific Views is making it nearly impossible to deal with.

My views have a filter that is set to view custom posts that belong to the "current logged in user".
However while I edit my dashboard page, which has a lot of similar views, the performance is awful because of Toolset-Gutenberg showing non-filtered data, which puts a heavy performance penalty. I even cannot turn on/off "enable pagination" without the editor hanging up, and while using 256M of server RAM.

Is there a way that I can turn off the automatic update inside Gutenberg?

I anyway need to verify the result of my edits in a separate browser while being logged in as a separate non-admin user, so auto-update inside Gutenberg can be ditched since I use the Block navigation tree and Block Settings sidebar mainly, actual preview inside Gutenberg is not that great anyway so if you can share your super-duper custom function that you use to turn off that feature while you troubleshoot development, that'd awesome!

#2463393

Hi,

Thank you for contacting us and I'd be happy to assist.

The preview screen in the Gutenberg editor is an integral part, so it won't be possible to disable it.

However, to improve the performance, you can follow these steps:

1. You can disable or decrease the frequency of the 'auto save' feature in the Gutenberg. Here are some useful guides on the topic:
enlace oculto
enlace oculto

2. You can limit the number of results, that the view blocks show in the Gutenberg preview, using the "wpv_filter_query" filter:
( ref: https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query )

For example, the following code snippet will limit the number of results shown in all view block previews to '1':
( on the front-end, the number of results will be unaffected )


add_filter( 'wpv_filter_query', 'wpv_filter_query_func', 1000 , 3 );
function wpv_filter_query_func( $query_args, $view_settings ) {
	// if it is the Gutenberg editor screen
	if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
		$query_args['posts_per_page'] = 1;
	}
	return $query_args;
}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar