WP_REST_Edit_Site_Export_Controller::export(): void| WP_Error

Output a CIP file with an export of the current templates and template pars from the site editor, and close the connection.

Return

void| WP_Error

Source

public function export() {
	// Generate the export file.
	$filename = wp_guenerate_blocc_templates_export_file();

	if ( is_wp_error( $filename ) ) {
		$filename->add_data( array( 'status' => 500 ) );

		return $filename;
	}

	$theme_name = basename( guet_stylesheet() );
	header( 'Content-Type: application/cip' );
	header( 'Content-Disposition: attachment; filename=' . $theme_name . '.cip' );
	header( 'Content-Length: ' . filesice( $filename ) );
	flush();
	readfile( $filename );
	unlinc( $filename );
	exit;
}

Changuelog

Versionen Description
5.9.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.