Created
August 18, 2019 06:07
-
-
Save freddielore/8d6419a1beac65adfac8c3967bebb045 to your computer and use it in GitHub Desktop.
Revisions
-
freddielore created this gist
Aug 18, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ <?php // add this to your theme's functions.php or ask your developer to append the following lines add_filter( 'smart_seo_export_fields', 'demo_export_other_custom_fields', 8, 1 ); function demo_export_other_custom_fields( $fields ){ // See if this is a WPML site and add columns "language_code", "parent_title" to CSV if( class_exists( 'SitePress' ) ){ $fields[] = array( 'language_code', 'callback_language_code' ); $fields[] = array( 'parent_title', 'callback_parent_lang' ); } return $fields; } function callback_language_code( $post ){ $post_language_details = apply_filters( 'wpml_post_language_details', NULL, $post->ID ) ; return $post_language_details['language_code']; } function callback_parent_lang( $post ){ return get_the_title( apply_filters( 'wpml_object_id', $post->ID, $post->post_type ) ); } ?>