Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

¿Cómo duplicar contenido en Polylang Free?

La versión gratuita de Polylang no trae por defecto la opción para poder duplicar el contenido de un idioma en el otro y así solo tener que cambiar el texto…

Con este código, todas las páginas y posts que dupliques se crearán con el contenido y el título del primer idioma, automáticamente.

// Duplicar el contenido original
function ecw_content_copy( $content ) {
if ( isset( $_GET['from_post'] ) ) {
$my_post = get_post( $_GET['from_post'] );
if ( $my_post )
return $my_post->post_content;
}
return $content;
}
add_filter( 'default_content', 'ecw_content_copy' );

// Duplicar el título del post original
function ecw_editor_title( $title ) {
if ( isset( $_GET['from_post'] ) ) {
$my_post = get_post( $_GET['from_post'] );
if ( $my_post )
return $my_post->post_title;
}
return $title;
}
add_filter( 'default_title', 'ecw_editor_title' );


This post first appeared on Taller De Wordpress, please read the originial post: here

Share the post

¿Cómo duplicar contenido en Polylang Free?

×

Subscribe to Taller De Wordpress

Get updates delivered right to your inbox!

Thank you for your subscription

×