芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/code-snippets/php/export/class-export-attachment.php
build_filename( $format ) ) ); header( sprintf( 'Content-Type: %s; charset=%s', sanitize_mime_type( $mime_type ), get_bloginfo( 'charset' ) ) ); } /** * Export snippets in JSON format as a downloadable file. */ public function download_snippets_json() { $this->do_headers( 'json', 'application/json' ); // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped echo wp_json_encode( $this->create_export_object(), apply_filters( 'code_snippets/export/json_encode_options', 0 ) ); exit; } /** * Export snippets in their code file format. */ public function download_snippets_code() { $mime_types = [ 'php' => 'text/php', 'css' => 'text/css', 'js' => 'text/javascript', ]; $type = isset( $mime_types[ $this->snippets_list[0]->type ] ) ? $this->snippets_list[0]->type : 'php'; $this->do_headers( $type, $mime_types[ $type ] ); // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped echo ( 'php' === $type || 'html' === $type ) ? $this->export_snippets_php() : $this->export_snippets_code( $type ); exit; } }