_title_with_dashes( \get_bloginfo( 'name' ) ) . '-yoast-local-seo.csv"' ); $output = \fopen( 'php://output', 'w' ); \fputcsv( $output, $this->csv_column_headers ); foreach ( $locations_arr as $location ) { \fputcsv( $output, $location ); } \fpassthru( $output ); \fclose( $output ); exit; } /** * Output HTML for exporting WPSEO Local locations as .csv * * @since 3.9 */ public function output_export_html() { echo '

' . \esc_html__( 'Export', 'yoast-local-seo' ) . '

'; /* translators: %s extends to .csv */ echo '

' . \sprintf( \esc_html__( 'Export all your locations to a %s file', 'yoast-local-seo' ), '.csv' ) . '

'; echo '
'; // Add a NONCE field. \wp_nonce_field( 'wpseo_local_export_nonce', 'wpseo_local_export_nonce_field' ); echo ''; echo '
'; } }