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.
Related Articles
// 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' );