Exporting Listing permalinks as part of the export CSV file

Include the URL or permalink of the detail page for each listing when exporting listings. 

This code, if added using the Code Snippets plugin, will add an extra column with the URL or permalink for each listing when you export your listings:

/**
 * Export listing url in CSV file.
 */
function gd_snippet_200814_export_posts_csv_row( $post_info, $post_ID, $post_type ) {
	$post_info['post_url'] = get_permalink( $post_ID );

	return $post_info;
}
add_filter( 'geodir_export_posts_csv_row', 'gd_snippet_200814_export_posts_csv_row', 20, 3 );

function gd_snippet_200814_export_posts_csv_columns( $columns, $post_type ) {
	$columns[] = 'post_url';

	return $columns;
}
add_filter( 'geodir_export_posts_csv_columns', 'gd_snippet_200814_export_posts_csv_columns', 20, 2 );
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us