Skip Navigation

[Resuelto] How to assign a custom field in YOAST analysis as the 'standard editor'?

This support ticket is created hace 4 años, 3 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: Africa/Casablanca (GMT+01:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por marcB-6 hace 4 años, 2 meses.

Asistido por: Jamal.

Autor
Mensajes
#1759085

Hi guys,
In the content analysis Yoast is telling me that my content has 0 words. I assume this is because for this CPT i removed the standard editor for this post type. However, i do have a custom field that holds the most important information. How can i assign this field as the 'standard editor'?
Thanks!

#1759207

Hello and thank you for contacting the Toolset support.

I am sure you will understand that we can't support how Yoast Analysis is working. I suggest reaching the Yoast support team and asking there. If they provide more information and you still need our assistance, get back here and we'll do our best to help.

From a toolset perspective, I will suggest syncing this custom field value to the content of the post with a custom code that you can add to Toolset->Settings->Custom code.
This code will hook into the "save_post_post-post_type" action and will update the content of the post from the value of the custom field. https://developer.wordpress.org/reference/hooks/save_post_post-post_type/
Check this example for a custom post type "book" and a custom field "summary":

function ts_sync_content_value( $post_id ) {
    // get the value of the custom field
    $content = get_post_meta( $post_id, 'wpcf-summary' );
	
	// prepare post object
	$post = array(
		'ID' => $post_id,
		'post_content' => $content,
	);

	// Update the post 
	wp_update_post( $post );
}
add_action( 'save_post_book', 'ts_sync_content_value' );

I hope this helps. Let me know if you have any questions.

#1764053

My issue is resolved now. Thank you!