backward.php
2 months ago
get_taxonomies_by_object_type.php
2 months ago
pmxe_filter.php
2 months ago
pmxe_functions.php
2 months ago
pmxe_prepare_price.php
2 months ago
pmxe_render_xml_attributes.php
2 months ago
pmxe_render_xml_element.php
2 months ago
pmxe_render_xml_text.php
2 months ago
str_getcsv.php
2 months ago
wp_all_export_check_children_assign.php
2 months ago
wp_all_export_clear_xss.php
2 months ago
wp_all_export_comments_clauses.php
2 months ago
wp_all_export_generate_export_file.php
2 months ago
wp_all_export_get_cpt_name.php
2 months ago
wp_all_export_get_export_format.php
2 months ago
wp_all_export_is_compatible.php
2 months ago
wp_all_export_parse_field_name.php
2 months ago
wp_all_export_posts_join.php
2 months ago
wp_all_export_posts_where.php
2 months ago
wp_all_export_pre_user_query.php
2 months ago
wp_all_export_prepare_template_csv.php
2 months ago
wp_all_export_prepare_template_xml.php
2 months ago
wp_all_export_rand_char.php
2 months ago
wp_all_export_remove_colons.php
2 months ago
wp_all_export_remove_source.php
2 months ago
wp_all_export_reverse_rules_html.php
2 months ago
wp_all_export_rmdir.php
2 months ago
wp_all_export_secure_file.php
2 months ago
wp_all_export_terms_clauses.php
2 months ago
wp_all_export_url_title.php
2 months ago
wp_all_export_write_article.php
2 months ago
wp_redirect_or_javascript.php
2 months ago
wp_all_export_generate_export_file.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- legitimate plugin prefixes (pmxe/PMXE/wpae/Wpae/wp_all_export/wpallexport/XmlExport/CdataStrategy/VariableProductTitle/Soflyy/GF_Export); Plugin Check does not honor phpcs.xml prefix declaration |
| 4 | defined( 'ABSPATH' ) || exit; |
| 5 | |
| 6 | if ( ! function_exists('wp_all_export_generate_export_file') ) |
| 7 | { |
| 8 | function wp_all_export_generate_export_file( $export_id ) |
| 9 | { |
| 10 | $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure'); |
| 11 | |
| 12 | $wp_uploads = wp_upload_dir(); |
| 13 | |
| 14 | $target = $is_secure_import ? wp_all_export_secure_file($wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY, $export_id ) : $wp_uploads['path']; |
| 15 | |
| 16 | $export = new PMXE_Export_Record(); |
| 17 | |
| 18 | $export->getById( $export_id ); |
| 19 | |
| 20 | if ( ! $export->isEmpty()) |
| 21 | { |
| 22 | if($export->options['export_to'] == XmlExportEngine::EXPORT_TYPE_XML && |
| 23 | $export->options['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) { |
| 24 | $extension = \Wpae\App\Service\ExportGoogleMerchants::GOOGLE_MERCHANTS_EXTENSION; |
| 25 | } else { |
| 26 | $extension = $export->options['export_to']; |
| 27 | } |
| 28 | |
| 29 | if ( $export->options['creata_a_new_export_file'] ) |
| 30 | { |
| 31 | $export_file_name = sanitize_file_name($export->friendly_name) . '-' . ($export->iteration + 1) . '.' . $extension; |
| 32 | } |
| 33 | else |
| 34 | { |
| 35 | $export_file_name = sanitize_file_name($export->friendly_name) . '.' . $extension; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | return apply_filters('wp_all_export_export_file_name', $target . DIRECTORY_SEPARATOR . $export_file_name, $export_id ); |
| 40 | } |
| 41 | } |