Here are the Hooks Provided By WP All Import and WP All Export
Our Action Reference provides hooks that allow you to change how WP All Import and WP All Export process data. After customizing the examples based on your needs, you can place them either in WP All Import or WP All Export's Function Editor, or in your theme's functions.php file.
Click here for more information.
Table of Contents
WP All Import
- pmxi_saved_post
- pmxi_before_xml_import
- pmxi_after_xml_import
- pmxi_update_post_meta
- pmxi_gallery_image
- pmxi_attachment_uploaded
- pmxi_acf_custom_field
- pmxi_after_post_import
- pmxi_article_data
- pmxi_before_delete_post
- pmxi_custom_field
- pmxi_delete_post
- pmxi_single_category
- pmxi_product_variation_saved
- pmxi_custom_types
- pmxi_visible_template_sections
- pmxi_before_post_import
- pmxi_before_post_import_{$addon}
- pmxi_custom_field_to_delete
- pmxi_custom_field_to_update
- pmxi_is_images_to_update
- pmxi_is_attachments_to_update
- pmxi_missing_post
- pmxi_before_import_delete
- pmxi_manage_imports_columns
- pmxi_manage_imports_column
- wp_all_import_is_post_to_update
- wp_all_import_attachments_uploads_dir
- wp_all_import_auto_create_csv_headers
- wp_all_import_copy_uploaded_file_into_files_folder
- wp_all_import_curl_download_only
- wp_all_import_feed_type
- wp_all_import_get_image_from_gallery
- wp_all_import_handle_upload
- wp_all_import_image_filename
- wp_all_import_api_image_filename
- wp_all_import_images_uploads_dir
- wp_all_import_is_check_duplicates
- wp_all_import_is_php_allowed
- wp_all_import_is_post_to_create
- wp_all_import_is_post_to_delete
- wp_all_import_is_post_to_change_missing
- wp_all_import_is_post_to_skip
- wp_all_import_is_unlink_missing_posts
- wp_all_import_multi_glue
- wp_all_import_phpexcel_object
- wp_all_import_search_image_by_wp_attached_file
- wp_all_import_set_post_terms
- wp_all_import_skip_x_csv_rows
- wp_all_import_specified_records
- wp_all_import_use_wp_set_object_terms
- wp_all_import_get_prices_from_first_variation
- wp_all_import_make_product_simple
- wp_all_import_product_attributes_delimiter
- wp_all_import_variable_product_imported
- wp_all_import_variation_any_attribute
- wp_all_import_variation_taxonomies
- wp_all_import_is_images_section_enabled
- wp_all_import_minimum_number_of_variations
- wp_all_import_post_skipped
- wp_all_import_single_image_uploads_dir
- wp_all_import_single_attachment_uploads_dir
- wp_all_import_before_variable_product_import
- wp_all_import_force_cron_processing_on_empty_feed
- wp_all_import_regenerate_lookup_tables
- wp_all_import_recount_terms_after_import
- wp_all_import_term_exists
- wp_all_import_is_import_empty_acf_fields
- wp_all_import_scan_files_recursively
- wp_all_import_logger
- wp_all_import_content_images_get_full_size
- wp_all_import_before_preserve_post_data
- wp_all_import_specified_delimiters
- wp_all_import_csv_parser_settings
- wp_all_import_is_trim_parsed_data
- wp_all_import_use_only_wp_http_api
- wp_all_import_hash_ignore_options
- wp_all_import_shard_delay
- wp_all_import_phpexcel_delimiter
- wp_all_import_is_enabled_stream_filter
- wp_all_import_is_base64_images_allowed
- wp_all_import_add_attachment
- wp_all_import_json_to_xml
- wp_all_import_feed_url
- wp_all_import_default_options
- wp_all_import_acf_field_class
- wp_all_import_acf_field_field
- wp_all_import_acf_field_view_dir
- wp_all_import_acf_field_view_dir_{field_type}
- wp_all_import_acf_field_view_path
- wp_all_import_acf_field_view_path_{field_type}
- wp_all_import_acf_field_template_header_path
- wp_all_import_acf_field_template_footer_path
- wp_all_import_acf_field_template_header_path{field_type}
- wp_all_import_acf_field_template_footer_path{field_type}
- wp_all_import_is_post_to_change_missing
- wpai_ftp_root
- wpai_ftp_ignore_passive_address
- wpai_ftp_passive_mode
- wpai_ftp_timeout
- wpai_ftp_custom_target_file_filter
- wpai_ftp_enable_debug
- wpai_ftp_allow_hidden_files_folders
- wpai_ftp_allowed_file_extensions
- wpai_is_case_insensitive_taxonomy_mapping
- {newest.ext}
- {any.ext}
- {oldest.ext}
- {custom.ext}
- wpallimport_after_images_import
- wpallimport_xml_row
- is_xml_preprocess_enabled
- import_functions_file_path
WP All Export
- pmxe_after_export
- pmxe_after_iteration
- pmxe_before_export
- pmxe_exported_post
- pmxe_woo_field
- pmxe_is_bundle
- pmxe_manage_imports_columns
- pmxe_manage_imports_column
- pmxe_csv_value
- pmxe_price
- pmxe_term_id
- pmxe_term_name
- pmxe_term_permalink
- pmxe_term_slug
- pmxe_term_description
- pmxe_term_parent
- pmxe_sql_field
- pmxe_comment_id
- pmxe_comment_post_id
- pmxe_comment_author
- pmxe_comment_author_email
- pmxe_comment_author_url
- pmxe_comment_author_ip
- pmxe_comment_karma
- pmxe_comment_content
- pmxe_comment_date
- pmxe_comment_approved
- pmxe_comment_agent
- pmxe_comment_type
- pmxe_comment_parent
- pmxe_comment_status
- pmxe_user_id
- pmxe_post_id
- pmxe_post_guid
- pmxe_post_type
- pmxe_post_title
- pmxe_post_content
- pmxe_post_date
- pmxe_post_modified_date
- pmxe_post_parent
- pmxe_post_parent_slug
- pmxe_ping_status
- pmxe_post_template
- pmxe_menu_order
- pmxe_post_status
- pmxe_post_format
- pmxe_post_author
- pmxe_post_slug
- pmxe_post_excerpt
- pmxe_woo_attribute
- pmxe_post_taxonomy
- pmxe_trid_field
- wp_all_export_additional_data
- wp_all_export_after_csv_line
- wp_all_export_config_options
- wp_all_export_csv_headers
- wp_all_export_csv_rows
- wp_all_export_export_file_name
- wp_all_export_generate_bundle
- wp_all_export_implode_delimiter
- wp_all_export_is_csv_headers_enabled
- wp_all_export_order_item
- wp_all_export_pre_csv_headers
- wp_all_export_product_variation_mode
- wp_all_export_raw_prices
- wp_all_export_repeater_delimiter
- wp_all_export_use_csv_compliant_line_endings
- wp_all_export_xml_rows
- wp_all_export_zapier_response
- wp_all_export_no_cache
- wp_all_export_remove_csv_headers
- wp_all_export_enable_rtl
- wp_all_export_is_wrap_value_into_cdata
- wp_all_export_default_fields
- wp_all_export_available_sections
- wp_all_export_xml_header
- wp_all_export_csv_strategy
- wp_all_export_main_xml_tag
- wp_all_export_xml_footer
- wp_all_export_record_xml_tag
- wp_all_export_field_name
- wp_all_export_other_fields
- wp_all_export_available_data
- wp_all_export_disable_acf
- wp_all_export_add_before_node
- wp_all_export_add_after_node
- wpallexport_custom_types
pmxi_saved_post
Description
This action fires when WP All Import saves a post of any type. The post ID, the record's data from your file, and a boolean value showing if the post is being updated are provided.
Parameters
Param | Type | Description |
$post_id | int | The ID of the item (post/user/taxonomy) saved or updated. |
$xml_node | SimpleXMLElement | The libxml resource of the current XML element. |
$is_update | bool | Returns 0 for new item 1 for updated item. |
Usage
function my_saved_post( $post_id, $xml_node, $is_update ) {
// Retrieve the import ID.
$import_id = wp_all_import_get_import_id();
// Only run for import 8.
if ( $import_id == '8' ) {
// Convert SimpleXml object to array for easier use.
$record = json_decode( json_encode( ( array ) $xml_node ), 1 );
// Do something.
}
}
add_action( 'pmxi_saved_post', 'my_saved_post', 10, 3 );
Search the docs for pmxi_saved_post
to see real-world code snippets that use this filter.
pmxi_before_xml_import
Description
This action fires before any records are imported. It's used to call code that validates the import file or other code that needs to run at the start. It's called regardless of import file type used.
Parameters
Param | Type | Description |
$import_id | int | The ID of the import that's about to run. |
Usage
function before_xml_import( $import_id ) {
// Only Run for import ID 5.
if ($import_id == 5) {
// Do something.
}
}
add_action('pmxi_before_xml_import', 'before_xml_import', 10, 1);
Search the docs for pmxi_before_xml_import
to see real-world code snippets that use this filter.
pmxi_after_xml_import
Description
This action fires after at the end of each import. The import object contains the values configured for the import and statistics for the last run.
Parameters
Param | Type | Description |
$import_id | int | The ID of the import that's about to finish. |
$import | object | The import object. |
Usage
function after_xml_import( $import_id, $import ) {
// Only run if import ID is 5.
if ($import_id == 5) {
// Do something.
}
}
add_action( 'pmxi_after_xml_import', 'after_xml_import', 10, 2 );
Search the docs for pmxi_after_xml_import
to see real-world code snippets that use this filter.
pmxi_update_post_meta
Description
This action fires when WP All Import creates or updates post meta (custom fields). The post ID, field name, and field value are provided.
Parameters
Param | Type | Description |
$post_id | int | The ID of the imported item. |
$meta_key | string | The name/key of the field that's being saved. |
$meta_value | mixed | The value imported into the field. |
Usage
function my_update_post_meta( $post_id, $meta_key, $meta_value) {
// Do something.
}
add_action( 'pmxi_update_post_meta', 'my_update_post_meta', 10, 3 );
Search the docs for pmxi_update_post_meta
to see real-world code snippets that use this filter.
pmxi_gallery_image
Description
This action fires each time an image is imported. It provides the post ID, image attachment ID, and image filepath as parameters. Whether or not existing images are deleted before new ones are imported is also indicated.
Parameters
Param | Type | Description |
$post_id | int | The ID of the imported item. |
$att_id | int | The ID of the image that was imported. |
$filepath | string | The local file path to the full size image. |
$is_keep_existing_images | bool/empty | Returns 1 if keeping existing images. Always cast as empty in the function arguments. |
Usage
function wpai_image_imported( $post_id, $att_id, $filepath, $is_keep_existing_images = '' ) {
// Do something.
}
add_action( 'pmxi_gallery_image', 'wpai_image_imported', 10, 4 );
Search the docs for pmxi_gallery_image
to see real-world code snippets that use this filter.
pmxi_attachment_uploaded
Description
This action fires when an attachment is uploaded. It provides the post ID, attachment ID, and attachment file path. If you need to work with images use pmxi_gallery_image
.
Parameters
Param | Type | Description |
$post_id | int | The post ID that's being imported. |
$att_id | int | The attachment ID. |
$filepath | string | The full path to the file: C:pathtowordpresswp-contentuploads20105filename.png |
Usage
function my_attachment_uploaded($pid, $attid, $filepath){
$attachment = get_post($attid);
// Do something with $attachment.
}
add_action('pmxi_attachment_uploaded', 'my_attachment_uploaded', 10, 3);
Search the docs for pmxi_attachment_uploaded
to see real-world code snippets that use this filter.
wp_all_import_is_post_to_update
Description
This filter is used to determine if a post should be updated or skipped. It takes the post ID and, optionally, an array of XML nodes. The returned value should be either true
to update the post or false
to skip it.
Parameters
Param | Type | Description |
$continue | bool | true to update, false to skip. |
$post_id | int | The Post ID that's about to be updated. |
$xml_node | array | An array containing the data for the current import record. |
$import_id | int | The ID of the import that's running. |
Usage
function my_is_post_to_update( $continue, $post_id, $xml_node, $import_id ) {
// Run this code on a specific import
if ($import_id == '5') {
// Do something to decide if this post should update
if ( ... ) {
return true;
}
// Don't update this post
return false;
}
}
add_filter( 'wp_all_import_is_post_to_update', 'my_is_post_to_update', 10, 4 );
Search the docs for wp_all_import_is_post_to_update
to see real-world code snippets that use this filter.
pmxi_acf_custom_field
Description
This filter allows the modification of ACF field values. Only fields set to be updated or created during the import will fire this hook.
Parameters
Param | Type | Description |
$value | mixed | The value being imported to the ACF field. |
$post_id | int | The Post ID that's being imported. |
$name | string | The ACF field name. |
Usage
function wp_all_import_pmxi_acf_custom_field( $value, $pid, $name ) {
// Code here.
}
add_filter( 'pmxi_acf_custom_field', 'wp_all_import_pmxi_acf_custom_field', 10, 3 );
Search the docs for pmxi_acf_custom_field
to see real-world code snippets that use this filter.
pmxi_after_post_import
Description
This action fires after each imported post. If you need post IDs you should use pmxi_saved_post
.
Parameters
Param | Type | Description |
$import_id | int | The import ID that's running. |
Usage
function my_after_post_import($import_id) {
// Only run for import ID 5.
if ($import_id == '5') {
// Do something.
}
}
add_action('pmxi_after_post_import', 'my_after_post_import', 10, 1);
Search the docs for pmxi_after_post_import
to see real-world code snippets that use this filter.
pmxi_article_data
Description
This filter allows updating core post fields before each post is imported. When updating, $post_to_update contains the current post's WP_Post
object. The current file record's data is in $current_xml_node.
Parameters
Param | Type | Description |
$articleData | array | Current article data. |
$import | object | The import object. |
$post_to_update | object | Post object for the post that's being updated. |
$current_xml_node | array | Parsed data for the current import record. |
Here are the fields available for modification in the $articleData array:
array(15) {
["post_type"]=>string
["post_status"]=>string
["comment_status"]=>string
["ping_status"]=>string
["post_title"]=>string
["post_excerpt"]=>string
["post_name"]=>string
["post_content"]=>string
["post_date"]=>string
["post_date_gmt"]=>string
["post_author"]=>int
["menu_order"]=>int
["post_parent"]=>int
["page_template"]=>string
["ID"]=>string
}
Usage
function my_pmxi_article_data( $articleData, $import, $post_to_update, $current_xml_node ) {
// Do something with the article data.
return $articleData;
}
add_filter('pmxi_article_data', 'my_pmxi_article_data', 10, 4);
Search the docs for pmxi_article_data
to see real-world code snippets that use this filter.
pmxi_before_delete_post
Description
This action fires just before WP All Import deletes a post. The post ID and import object are provided as parameters.
Parameters
Param | Type | Description |
$post_id | int | The post ID that's about to be deleted. |
$import | object | The import object. |
Usage
function before_delete_post( $post_id, $import ) {
// Do something before post is deleted.
}
add_action('pmxi_before_delete_post', 'before_delete_post', 10, 2);
Search the docs for pmxi_before_delete_post
to see real-world code snippets that use this filter.
pmxi_custom_field
Description
This filter first before a custom field's value is saved. If the field is being updated the $original_value
is provided. The $value
is provided and must be returned. The field's name, $key
, and the post being updated, $post_id
, are available.
Parameters
Param | Type | Description |
$value | string | The value being imported into the custom field. |
$post_id | int | The post ID. |
$key | string | The custom field key. |
$original_value | string | Original, unserialized, value. |
$existing_meta_keys | array | Existing meta keys. |
$import_id | int | The import ID that's running. |
Usage
function my_custom_field( $value, $post_id, $key, $original_value, $existing_meta_keys, $import_id ) {
// Only run for import ID 5.
if ($import_id == '5') {
// Only modify the 'myField' custom field for post 65.
if( $key == 'myField' && $post_id == 65 ){
// Do something.
}
}
// Return the value for the custom field.
return $value;
}
add_filter( 'pmxi_custom_field', 'my_custom_field', 10, 6 );
Search the docs for pmxi_custom_field
to see real-world code snippets that use this filter.
pmxi_delete_post
Description
This action fires just before posts are deleted at the end of an import when using the 'Delete products that are no longer present in your file' option. It allows performing actions on the posts immediately before they are deleted. The list of post IDs to be deleted and the import object are provided.
Parameters
Param | Type | Description |
$ids | array | Array of post IDs that will be deleted. |
$import | object | The import object. |
Usage
function wpai_pmxi_delete_post( $ids = array(), $import ){
foreach( $ids as $pid ) {
// Do something with post using ID - $pid
}
}
add_action( 'pmxi_delete_post', 'wpai_pmxi_delete_post', 10, 2 );
Search the docs for pmxi_delete_post
to see real-world code snippets that use this filter.
pmxi_single_category
Description
This filter fires before taxonomy terms are imported and can be used to filter them. An array containing the term information and the taxonomy name are provided.
Parameters
Param | Type | Description |
$term_into | array | Array with term information. |
$tax_name | string | The taxonomy name. |
Here is the $term_into
array:
Array
(
[name] => {string}
[parent] => {int or empty if none}
[assign] => {bool}
[is_mapping] => {1 if true, empty if false}
[hierarchy_level] => {int}
[max_hierarchy_level] => {int}
)
Usage
function wpai_pmxi_single_category( $term_into, $tax_name ) {
// Do something.
// Return the updated term information.
return $term_into;
}
add_filter( 'pmxi_single_category', 'wpai_pmxi_single_category', 10, 2 );
Search the docs for pmxi_single_category
to see real-world code snippets that use this filter.
wp_all_import_attachments_uploads_dir
Description
Can be used to change the directory that imported attachments are saved to.
Parameters
Param | Type | Description |
$uploads | array | Contains information related to the WordPress uploads path & URL. |
$articleData | array | Contains a list of data related to the post/user/taxonomy being imported. |
$current_xml_node | array | Array of data for current import record. |
$import_id | int | The import ID that's running. |
Usage
add_filter( 'wp_all_import_attachments_uploads_dir', 'wpai_wp_all_import_attachments_uploads_dir', 10, 4 );
function wpai_wp_all_import_attachments_uploads_dir( $uploads, $articleData, $current_xml_node, $import_id ) {
return $uploads;
}
Search the docs for wp_all_import_attachments_uploads_dir
to see real-world code snippets that use this hook.
wp_all_import_auto_create_csv_headers
Description
Auto generate headers, or use headers in file.
You cannot call this hook from WP All Import's Function Editor. It must be saved in a plugin or in your theme.
Parameters
Param | Type | Description |
$create_headers | bool | Auto-generate headers? true / false. |
$import_id | int | The import ID that's running. |
Usage
add_filter( 'wp_all_import_auto_create_csv_headers', 'wpai_wp_all_import_auto_create_csv_headers', 10, 2 );
function wpai_wp_all_import_auto_create_csv_headers( $create_headers, $import_id ){
// Return true to auto-generate header, or false to use the header in the file.
return $create_headers;
}
Search the docs for wp_all_import_auto_create_csv_headers
to see real-world code snippets that use this hook.
wp_all_import_copy_uploaded_file_into_files_folder
Description
Return TRUE and WP All Import will copy uploaded import file into /wp-content/uploads/wpallimport/files folder.
Parameters
Param | Type | Description |
$copy_uploaded_files | bool | Copy file? true / false. |
Usage
function wpai_wp_all_import_copy_uploaded_file_into_files_folder( $copy_uploaded_files ) {
return $copy_uploaded_files;
}
add_filter( 'wp_all_import_copy_uploaded_file_into_files_folder', 'wpai_wp_all_import_copy_uploaded_file_into_files_folder', 10, 1 );
Search the docs for wp_all_import_copy_uploaded_file_into_files_folder
to see real-world code snippets that use this hook.
wp_all_import_curl_download_only
Description
Force WP All Import to download the feed on the first request (skips reading headers). Useful if feeds reject multiple pings/requests.
This code must be added in a plugin or your theme. It will not work in WP All Import's Function Editor.
Parameters
Param | Type | Description |
$download_only | bool | Only download via curl? true / false. |
Usage
add_filter( 'wp_all_import_curl_download_only', 'wpai_wp_all_import_curl_download_only', 10, 1 );
function wpai_wp_all_import_curl_download_only( $download_only ){
return true;
}
Search the docs for wp_all_import_curl_download_only
to see real-world code snippets that use this hook.
wp_all_import_feed_type
Description
Can be used to define the feed type (xml/csv/json/etc).
This code must be added in a plugin or your theme. It will not work in WP All Import's Function Editor.
Parameters
Param | Type | Description |
$type | string | The feed type. |
$url | string | The URL that's being imported. |
Usage
add_filter( 'wp_all_import_feed_type', 'wpai_feed_type', 10, 2 );
function wpai_feed_type( $type, $url ){
// Check $url and return $type.
return $type;
}
Search the docs for wp_all_import_feed_type
to see real-world code snippets that use this hook.
wp_all_import_get_image_from_gallery
Description
Called after an existing image is found in the Media Library. Only works with the "Use images currently in Media Library" and "Use images currently uploaded in wp-content/uploads/wpallimport/files/" options.
Parameters
Param | Type | Description |
$attach | object | The existing image that will be attached. |
$image_name | string | The image name that will be imported. |
$targetDir | string | The directory that the image will be uploaded to. |
Usage
add_filter( 'wp_all_import_get_image_from_gallery', 'wpai_wp_all_import_get_image_from_gallery', 10, 3 );
function wpai_wp_all_import_get_image_from_gallery( $attach, $image_name, $targetDir ) {
/**
* Do something with found attachment
*/
return $attach; // if attach == false the image will be downloaded
}
Search the docs for wp_all_import_get_image_from_gallery
to see real-world code snippets that use this hook.
wp_all_import_handle_upload
Description
Filters the data array for attachments & images uploaded through WP All Import.
Parameters
Param | Type | Description |
$file | array | Contains the filepath, URL & filetype |
Usage
add_filter( 'wp_all_import_handle_upload', 'wpai_wp_all_import_handle_upload', 10, 1 );
function wpai_wp_all_import_handle_upload( $file ){
// Handle & return $file here.
}
Search the docs for wp_all_import_handle_upload
to see real-world code snippets that use this hook.
wp_all_import_image_filename
Description
Can be used to set a custom filename for an imported image.
Parameters
Param | Type | Description |
$filename | string | The filename as created by the import. |
$img_title | string | From "SEO and advanced options". Will always be blank for ACF fields. |
$img_caption | string | From "SEO and advanced options". Will always be blank for ACF fields. |
$img_alt | string | From "SEO and advanced options". Will always be blank for ACF fields. |
$articleData | array | Array of current import item data. |
$import_id | int | The import ID. |
$img_url | string | The image URL. |
Usage
function wpai_image_filename( $filename = '', $img_title = '', $img_caption = '', $img_alt = '', $articleData = '', $import_id = '', $img_url = '' ) {
// Your code
return $filename;
}
add_filter( 'wp_all_import_image_filename', 'wpai_image_filename', 10, 7 );
Search the docs for wp_all_import_image_filename
to see real-world code snippets that use this hook.
wp_all_import_images_uploads_dir
Description
Can be used to set a custom path in which images (as well as media intended for ACF fields) are uploaded. Only applies to media uploaded via WP All Import.
Parameters
Param | Type | Description |
$uploads | array | Contains information related to the WordPress uploads path & URL. |
$articleData | array | Contains a list of data related to the post/user/taxonomy being imported. |
$current_xml_node | array | Contains a list of nodes within the current import record. |
$import_id | int | Contains the ID of the import. |
Usage
add_filter( 'wp_all_import_images_uploads_dir', 'wpai_wp_all_import_images_uploads_dir', 10, 4 );
function wpai_wp_all_import_images_uploads_dir( $uploads, $articleData, $current_xml_node, $import_id ) {
// Do something with code here.
return $uploads;
}
Search the docs for wp_all_import_images_uploads_dir
to see real-world code snippets that use this hook.
wp_all_import_is_check_duplicates
Description
Turn duplicate checking on/off. If you turn it off, WP All Import will create duplicate items each re-run.
Parameters
Param | Type | Description |
$is_check_duplicates | bool | Check for duplicates? true / false. |
$import_id | int | The import ID. |
Usage
add_filter( 'wp_all_import_is_check_duplicates', 'wpai_is_check_duplicates', 10, 2 );
function wpai_is_check_duplicates( $is_check_duplicates, $import_id ) {
// Cancel checking for duplicates if this is import ID 10.
return ( $import_id == 10 ) ? false : true;
}
Search the docs for wp_all_import_is_check_duplicates
to see real-world code snippets that use this hook.
wp_all_import_is_php_allowed
Description
Determine whether PHP functions in the import template will be executed.
Parameters
Param | Type | Description |
$is_php_allowed | bool | Execute functions? true / false. |
Usage
function wpai_wp_all_import_is_php_allowed( $is_php_allowed ) {
return $is_php_allowed;
}
add_filter( 'wp_all_import_is_php_allowed', 'wpai_wp_all_import_is_php_allowed', 10, 1 );
Search the docs for wp_all_import_is_php_allowed
to see real-world code snippets that use this hook.
wp_all_import_is_post_to_create
Description
This filter is used to determine if a post should be created or skipped. The returned value should be either true
to create the post or false
to skip it.
Parameters
Param | Type | Description |
$continue_import | bool | Create post? true / false. |
$data | array | An array holding values for the current record. |
$import_id | int | The import ID. |
Usage
function my_is_post_to_create( $continue_import, $data, $import_id ) {
// Unless you want this code to execute for every import, check the import id
// if ($import_id == 5) { ... }
return true;
}
add_filter( 'wp_all_import_is_post_to_create', 'my_is_post_to_create', 10, 3 );
Search the docs for wp_all_import_is_post_to_create
to see real-world code snippets that use this hook.
wp_all_import_is_post_to_delete
Description
This fires when a missing post is about to be deleted by an import.
Parameters
Param | Type | Description |
$is_post_to_delete | bool | Delete post? true / false. |
$post_id | int | The post ID that's about to be deleted. |
$import | object | The import object. |
Usage
function my_is_post_to_delete( $is_post_to_delete, $post_id, $import ) {
// Unless you want this code to execute for every import, check the import id
// if ( $import->id == 5 ) { ... }
return true;
}
add_filter( 'wp_all_import_is_post_to_delete', 'my_is_post_to_delete', 10, 3 );
Search the docs for wp_all_import_is_post_to_delete
to see real-world code snippets that use this hook.
wp_all_import_is_unlink_missing_posts
Description
Used to completely remove the relationship between import and post from pmxi_posts database table.
Parameters
Param | Type | Description |
$is_unlink_missing | bool | Unlink post? true / false. |
$import_id | int | The import ID. |
$post_id | int | The post ID. |
Usage
add_filter( 'wp_all_import_is_unlink_missing_posts', 'wpai_wp_all_import_is_unlink_missing_posts', 10, 3 );
function wpai_wp_all_import_is_unlink_missing_posts( $is_unlink_missing, $import_id, $post_id ) {
// Do something with code here.
return $is_unlink_missing;
}
Search the docs for wp_all_import_is_unlink_missing_posts
to see real-world code snippets that use this hook.
wp_all_import_multi_glue
Description
Change the delimiter used when querying multiple values with XPath (default is ", "). Learn about XPath queries here: XPath Queries.
Parameters
Param | Type | Description |
$delimiter | string | The delimiter. |
Usage
add_filter( 'wp_all_import_multi_glue', 'wpai_wp_all_import_multi_glue', 10, 1 );
function wpai_wp_all_import_multi_glue( $delimiter ) {
// Change delimiter if you want.
// e.g.:
// $delimiter = '|';
return $delimiter;
}
Search the docs for wp_all_import_multi_glue
to see real-world code snippets that use this hook.
wp_all_import_phpexcel_object
Description
Access/modify the PHPExcel object and file path for the import file.
Parameters
Param | Type | Description |
$PHPExcel | object | The PHPExcel object. |
$xlsFilePath | string | The path to the import file. |
Usage
add_filter( 'wp_all_import_phpexcel_object', 'wpai_wp_all_import_phpexcel_object', 10, 2 );
function wpai_wp_all_import_phpexcel_object( $PHPExcel, $xlsFilePath ) {
return $PHPExcel;
}
Search the docs for wp_all_import_phpexcel_object
to see real-world code snippets that use this hook.
wp_all_import_search_image_by_wp_attached_file
Description
Can be used to stop WP All Import from looking for existing images via _wp_attached_file.
Parameters
Param | Type | Description |
$is_search_by_wp_attached_file | bool | Look in _wp_attached_file? true / false. |
Usage
add_filter( 'wp_all_import_search_image_by_wp_attached_file', 'wpai_wp_all_import_search_image_by_wp_attached_file', 10, 1 );
function wpai_wp_all_import_search_image_by_wp_attached_file( $is_search_by_wp_attached_file ) {
// Do something with code here
return $is_search_by_wp_attached_file;
}
Search the docs for wp_all_import_search_image_by_wp_attached_file
to see real-world code snippets that use this hook.
wp_all_import_set_post_terms
Description
Called when WP All Import is setting the post taxonomy terms.
Parameters
Param | Type | Description |
$term_taxonomy_ids | array | Array of taxonomy IDs. |
$tx_name | string | The name of the taxonomy. |
$pid | int | The post ID. |
$import_id | int | The import ID. |
Usage
add_filter( 'wp_all_import_set_post_terms', 'wpai_wp_all_import_set_post_terms', 10, 4 );
function wpai_wp_all_import_set_post_terms( $term_taxonomy_ids, $tx_name, $pid, $import_id ) {
// Code here.
return $term_taxonomy_ids;
}
Search the docs for wp_all_import_set_post_terms
to see real-world code snippets that use this hook.
wp_all_import_skip_x_csv_rows
Description
Specifies the amount of rows to be skipped. You must use this hook in a plugin or your theme, not in WP All Import's Function Editor.
Parameters
Param | Type | Description |
$skip_rows | bool/int | Return false to not skip rows. Return integer to specify how many rows to skip. |
$import_id | int | The import ID. |
Usage
add_filter( 'wp_all_import_skip_x_csv_rows', 'wpai_skip_rows', 10, 2 );
function wpai_skip_rows( $skip_rows, $import_id ) {
// Handle & return $skip_rows here.
}
Search the docs for wp_all_import_skip_x_csv_rows
to see real-world code snippets that use this hook.
wp_all_import_specified_records
Description
Use this to override the specified records to be imported that were defined in the Import only specified records option in the import settings. That option has to be enabled for this hook to fire. It's a comma-separated list of ints or int ranges. e.g. "1-7,10,15-20". The integers represent the position in the data file.
Parameters
Param | Type | Description |
$specified_records | string | The current value from the "Import only specified records" option. |
$import_id | int | The import ID. |
$root_nodes | array | Contains an array of simpleXML objects of nodes from the used import file. |
Usage
function my_specified_records( $specified_records, $import_id, $root_nodes ) {
// Unless you want this code to execute for every import, check the import id
// if ($import_id === 5) { ... }
// your code here
return $specified_records;
}
add_filter( 'wp_all_import_specified_records', 'my_specified_records', 10, 3 );
Search the docs for wp_all_import_specified_records
to see real-world code snippets that use this hook.
wp_all_import_use_wp_set_object_terms
Description
Force WP All Import to use the wp_set_object_terms() WordPress function. Using this function is a bit slower, but it's sometimes necessary for compatibility with certain themes and plugins.
Parameters
Param | Type | Description |
$use_wp_set_object_terms | bool | Return true to use WordPress function wp_set_object_terms(). Return false to use pure SQL. |
$tx_name | string | The taxonomy name. |
Usage
function wpai_wp_all_import_use_wp_set_object_terms( $use_wp_set_object_terms, $tx_name ) {
return $use_wp_set_object_terms;
}
add_filter( 'wp_all_import_use_wp_set_object_terms', 'wpai_wp_all_import_use_wp_set_object_terms', 10, 2 );
Search the docs for wp_all_import_use_wp_set_object_terms
to see real-world code snippets that use this hook.
wpallimport_after_images_import
Description
Called after the images section of the import is processed, but only when the "Keep images currently in Media Library" option is enabled.
Parameters
Param | Type | Description |
$post_id | int | The post ID. |
$gallery_attachment_ids | array | An array of the images that were imported to the post. |
$missing_images | array | An array of the images that were missing, based on previous imports. |
Usage
function soflyy_img_import( $post_id, $gallery_attachment_ids, $missing_images ) {
// Do something.
}
add_action( 'wpallimport_after_images_import', 'soflyy_img_import', 10, 3 );
Search the docs for wpallimport_after_images_import
to see real-world code snippets that use this hook.
wpallimport_xml_row
Description
Allows reading or modification of the data record before importing. All file types (CSV/JSON/XLS/XLSX/TXT/etc) are converted to XML, so this hook works with all of them.
Please note that XML nodes generated by this hook can't be used in "FOREACH" ACF Repeater fields.
Parameters
Param | Type | Description |
$xml_node | libxml resource | SimpleXMLElement containing the current records data. |
Usage
function wpai_xml_row( $xml_node ) {
// Modify simpleXML object as needed
return $xml_node;
}
add_filter( 'wpallimport_xml_row', 'wpai_xml_row', 10, 1 );
Search the docs for wpallimport_xml_row
to see real-world code snippets that use this hook.
pmxi_product_variation_saved
Description
This action fires each time WP All Import save a product variation. The variation's ID is provided. This only fires when the Link all variations option in the Attributes tab is used to create variations.
Parameters
Param | Type | Description |
$variation_id | int | The variation ID. |
Usage
function wpai_wp_all_import_variation_imported( $variation_id ){
// Do something.
}
add_action( 'pmxi_product_variation_saved', 'wpai_wp_all_import_variation_imported', 10, 1 );
Search the docs for pmxi_product_variation_saved
to see real-world code snippets that use this filter.
wp_all_import_get_prices_from_first_variation
Description
Can be used to set the parent product price to the price of the first variation in the case that WP All Import converts the product to a simple product.
Parameters
Param | Type | Description |
$get_prices_from_first_variation | bool | Set parent product price to first variation price? true / false. |
$product_id | int | The product ID. |
$import_id | int | The import ID. |
Usage
function wpai_wp_all_import_get_prices_from_first_variation( $get_prices_from_first_variation, $product_id, $import_id ) {
// Do something.
return $get_prices_from_first_variation;
}
add_filter( 'wp_all_import_get_prices_from_first_variation', 'wpai_wp_all_import_get_prices_from_first_variation', 10, 3 );
Search the docs for wp_all_import_get_prices_from_first_variation
to see real-world code snippets that use this hook.
wp_all_import_make_product_simple
Description
Called after a product is converted into a Simple Product by our WooCommerce Add-On. This only happens when the "Create products with no variations as simple product" option is enabled.
Parameters
Param | Type | Description |
$product_id | int | The product ID. |
$import_id | int | The import ID. |
Usage
function wpai_wp_all_import_make_product_simple( $product_id, $import_id ) {
// Code here.
}
add_action( 'wp_all_import_make_product_simple', 'wpai_wp_all_import_make_product_simple', 10, 2 );
Search the docs for wp_all_import_make_product_simple
to see real-world code snippets that use this hook.
wp_all_import_product_attributes_delimiter
Description
Modify the delimiter used to separate multiple attributes in the WooCommerce Add-On. Default is the pipe symbol "|".
Parameters
Param | Type | Description |
$delimiter | string | Default is "|". |
$product_id | int | The product ID. |
$import_id | int | The import ID. |
Usage
function wpai_wp_all_import_product_attributes_delimiter( $delimiter, $product_id, $import_id ) {
return $delimiter;
}
add_filter( 'wp_all_import_product_attributes_delimiter', 'wpai_wp_all_import_product_attributes_delimiter', 10, 3 );
Search the docs for wp_all_import_product_attributes_delimiter
to see real-world code snippets that use this hook.
wp_all_import_variable_product_imported
Description
Called when WP All Import saves a variable product
Parameters
Param | Type | Description |
$product_id | int | The product ID. |
Usage
add_action( 'wp_all_import_variable_product_imported', 'wpai_wp_all_import_variable_product_imported', 10, 1 );
function wpai_wp_all_import_variable_product_imported( $post_parent ) {
// Code here.
}
Search the docs for wp_all_import_variable_product_imported
to see real-world code snippets that use this hook.
wp_all_import_variation_any_attribute
Description
Return true to set variation as "Any" in the case that multiple attribute values are present (e.g.: L|XL|XXL).
Parameters
Param | Type | Description |
$variation_any_attribute | bool | Set variation to "Any"? true / false. |
$import_id | int | The import ID. |
Usage
function wpai_wp_all_import_variation_any_attribute( $variation_any_attribute, $import_id ) {
return $variation_any_attribute;
}
add_filter( 'wp_all_import_variation_any_attribute', 'wpai_wp_all_import_variation_any_attribute', 10, 2 );
Search the docs for wp_all_import_variation_any_attribute
to see real-world code snippets that use this hook.
wp_all_import_variation_taxonomies
Description
Can be used to add taxonomies to WooCommerce product variations, which isn't supported by WooCommerce out of the box.
Parameters
Param | Type | Description |
$taxonomies | array | List of taxonomies. |
Usage
add_filter( 'wp_all_import_variation_taxonomies', 'wpai_wp_all_import_variation_taxonomies', 10, 1 );
function wpai_wp_all_import_variation_taxonomies( $taxonomies ){
if ( ! in_array( 'my_taxonomy_name', $taxonomies ) ) $taxonomies[] = 'my_taxonomy_name';
return $taxonomies;
}
Search the docs for wp_all_import_variation_taxonomies
to see real-world code snippets that use this hook.
pmxe_after_export
Description
This action is used to run code after the export has completed. It provides the export ID and an object containing stats, settings, data, etc for the export.
Parameters
Param | Type | Description |
$export_id | int | The export ID. |
$exportObj | object | The export object. |
Usage
function wp_all_export_after_export( $export_id, $exportObj ) {
// Run for export 5 only
if ( $export_id == '5' ) {
// Do something
}
}
add_action( 'pmxe_after_export', 'wp_all_export_after_export', 10, 2 );
Search the docs for pmxe_after_export
to see real-world code snippets that use this filter.
pmxe_after_iteration
Description
This action fires after each iteration only when running via cron. It provides the export ID and an object containing stats, settings, data, etc for the export.
Parameters
Param | Type | Description |
$export_id | int | The export ID. |
$exportObj | object | The export object. |
Usage
function wpae_continue_cron( $export_id, $exportObj ) {
// Run this for a specific export
if ($export_id == '5') {
// Do something
}
}
add_action( 'pmxe_after_iteration', 'wpae_continue_cron', 10, 2 );
Search the docs for pmxe_after_iteration
to see real-world code snippets that use this filter.
pmxe_before_export
Description
This action runs at the start of an export before any data is processed. It provides the export ID and must be called outside of the Function Editor - such as from your theme's functions.php file.
Parameters
Param | Type | Description |
$export_id | int | The export ID. |
Usage
function wp_all_export_before_export( $export_id ) {
// Run this for a specific export.
if ($export_id == '5') {
// Do something.
}
}
add_action( 'pmxe_before_export', 'wp_all_export_before_export', 10, 1 );
Search the docs for pmxe_before_export
to see real-world code snippets that use this filter.
pmxe_exported_post
Description
This action fires after each record is saved to the export file. It provides the post ID and an object containing stats, settings, data, etc for the export.
Parameters
Param | Type | Description |
$post_id | int | The post ID. |
$exportObj | object | The export object. |
Usage
function wpae_pmxe_exported_post( $post_id, $exportObject ) {
// Only run for a certain post.
if( $post_id == '55' ){
// Do something.
}
}
add_action('pmxe_exported_post', 'wpae_pmxe_exported_post', 10, 2);
Search the docs for pmxe_exported_post
to see real-world code snippets that use this filter.
pmxe_woo_field
Description
This filter allows WooCommerce field values to be modified as they're exported. It provides the field's value, name, and the post ID. You must return the value as a string
.
Parameters
Param | Type | Description |
$value | mixed | The value of the field. |
$field_name | string | The field name. |
$pid | int | The post ID. |
Usage
function wp_all_export_woo_field( $value, $field_name, $pid ) {
if( $field_name == '_a_field' ){
// Generate the new value
return $new_value;
} else {
return $value;
}
}
add_filter( 'pmxe_woo_field', 'wp_all_export_woo_field', 10, 3 );
Search the docs for pmxe_woo_field
to see real-world code snippets that use this filter.
wp_all_export_additional_data
Description
This filter only fires when Simple XML Feed
exports run. It does nothing for any other export type. Any additional fields currently added will be in the $add_data
parameter. The $options
parameter contains the full export configuration. The export ID is provided in the last parameter.
Parameters
Param | Type | Description |
$add_data | array | Any additional data to add, empty by default. |
$options | array | Export options array containing the export's configuration. |
$export_id | int | ID of the running export. |
Usage
function wpae_additional_data( $add_data, $options, $export_id ) {
// Add data as needed.
// Return the updated data array.
return $add_data;
}
add_filter( 'wp_all_export_additional_data', 'wpae_additional_data', 10, 2 );
Search the docs for wp_all_export_additional_data
to see real-world code snippets that use this filter.
wp_all_export_after_csv_line
Description
This filter fires after each CSV line and provides the file resource handle so that additional characters can be added. The second parameter provides the export ID.
Parameters
Param | Type | Description |
$stream | file system pointer resource | The resource handle pointing to the export file. |
$export_id | int | The export ID. |
Usage
function wpae_wp_all_export_after_csv_line( $stream, $export_id ){
// Do something.
return $stream;
}
add_filter( 'wp_all_export_after_csv_line', 'wpae_wp_all_export_after_csv_line', 10, 2 );
Search the docs for wp_all_export_after_csv_line
to see real-world code snippets that use this filter.
wp_all_export_config_options
Description
This filter fires during exports and was specifically added to allow changing the max_execution_time
and max_input_time
values. The other options are listed below but should not be modified with the filter.
Parameters
Param | Type | Description |
$options | array | Export configuration options. |
Option array values:
Array
(
[info_api_url] => http://www.wpallimport.com
[scheduling_license] => {hashed string}
[scheduling_license_status] => {status string}
[dismiss] => 0
[dismiss_manage_top] => 0
[dismiss_manage_bottom] => 0
[cron_job_key] => {string}
[max_input_time] => -1
[max_execution_time] => -1
[secure] => 1
[license] => {hashed string}
[license_status] => {status string}
[zapier_api_key] => {string}
[zapier_invitation_url] =>
[zapier_invitation_url_received] =>
)
Usage
function wpai_wp_all_import_config_options( $options ) {
// Do something.
return $options;
}
add_filter( 'wp_all_export_config_options', 'wpai_wp_all_import_config_options', 10, 1 );
Search the docs for wp_all_export_config_options
to see real-world code snippets that use this filter.
wp_all_export_csv_headers
Description
Manipulate export file headers.
Parameters
Param | Type | Description |
$headers | array | Current headers. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_csv_headers', 'wpae_wp_all_export_csv_headers', 10, 2 );
function wpae_wp_all_export_csv_headers( $headers, $export_id ) {
// Code here.
return $headers;
}
Search the docs for wp_all_export_csv_headers
to see real-world code snippets that use this hook.
wp_all_export_csv_rows
Description
Filters the records to export. This is for CSV formatted exports only. See 'wp_all_export_xml_rows' for filtering XML exports.
Parameters
Param | Type | Description |
$articles | array | An array of records for exporting. Each article is keyed by the column header name for that field. |
$options | array | The export configuration options. |
$export_id | int | The export ID. |
Usage
function wp_all_export_csv_rows( $articles, $options, $export_id ) {
// Unless you want this code to execute for every export, be sure to check the export id
// if ($export_id == 5) { ...
// Loop through the array and unset() any entries you don't want exported
// foreach ($articles as $key => $article) {
// if ($article["Title"] == "Something") {
// unset($articles[$key]);
// }
// }
return $articles; // Return the array of records to export
}
add_filter( 'wp_all_export_csv_rows', 'wp_all_export_csv_rows', 10, 3 );
Search the docs for wp_all_export_csv_rows
to see real-world code snippets that use this hook.
wp_all_export_export_file_name
Description
Filter to change the filename of the exported data file
Parameters
Param | Type | Description |
$file_path | string | The file path, including the filename. |
$export_id | int | The export ID. |
Usage
function wpae_wp_all_export_export_file_name( $file_path, $export_id ){
// Unless you want your code to execute for every export, be sure to check the export id
// if ($export_id == 5) { ... }
return $file_path;
}
add_filter( 'wp_all_export_export_file_name', 'wpae_wp_all_export_export_file_name', 10, 2 );
Search the docs for wp_all_export_export_file_name
to see real-world code snippets that use this hook.
wp_all_export_generate_bundle
Description
Determine whether the bundle zip file should be generated.
Parameters
Param | Type | Description |
$is_generate_bundle | bool | Generate bundle? true / false. |
Usage
add_filter( 'wp_all_export_generate_bundle', 'wpae_do_not_generate_bundle', 10, 1 );
function wpae_do_not_generate_bundle( $is_generate_bundle ) {
return $is_generate_bundle ;
}
Search the docs for wp_all_export_generate_bundle
to see real-world code snippets that use this hook.
wp_all_export_implode_delimiter
Description
Modify the implode delimiter for export fields. Default delimiter is the pipe symbol "|".
Parameters
Param | Type | Description |
$implode_delimiter | string | The delimiter to be used. Default is "|". |
$export_id | int | The export ID. |
Usage
function wpae_wp_all_export_implode_delimiter( $implode_delimiter, $export_id ) {
// Do something.
return $implode_delimiter;
}
add_filter( 'wp_all_export_implode_delimiter', 'wpae_wp_all_export_implode_delimiter', 10, 2 );
Search the docs for wp_all_export_implode_delimiter
to see real-world code snippets that use this hook.
wp_all_export_is_csv_headers_enabled
Description
Can be used to completely remove the CSV header.
Parameters
Param | Type | Description |
$is_headers_enabled | bool | Keep headers? true / false. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_is_csv_headers_enabled', 'wpae_wp_all_export_is_csv_headers_enabled', 10, 2 );
function wpae_wp_all_export_is_csv_headers_enabled( $is_headers_enabled, $export_id ){
// Return 'false' to remove the header.
return $is_headers_enabled;
}
Search the docs for wp_all_export_is_csv_headers_enabled
to see real-world code snippets that use this hook.
wp_all_export_order_item
Description
Filters the items in a WooCommerce Order to export.
Parameters
Param | Type | Description |
$is_export_record | bool | Include item in export? true / false. |
$product_id | int | The product ID. |
$export_options | array | The export options array. |
$export_id | int | The export ID. |
Usage
function filter_my_order_items ( $is_export_record, $product_id, $export_options, $export_id ) {
// Unless you want this to execute for every export you should check the id here:
// if ( $export_id == 5 ) {
// Your code here
return true;
}
add_filter( "wp_all_export_order_item", "filter_my_order_items", 10, 4 );
Search the docs for wp_all_export_order_item
to see real-world code snippets that use this hook.
wp_all_export_pre_csv_headers
Description
Allows for CSV headers to be added above the default headers.
Parameters
Param | Type | Description |
$preCsvHeaders | bool / string | The headers to add to the file. Default false. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_pre_csv_headers', 'export_add_headers', 10, 2 );
function export_add_headers ( $preCsvHeaders, $exportId ) {
// Modify & return $preCsvHeaders
return $preCsvHeaders;
}
Search the docs for wp_all_export_pre_csv_headers
to see real-world code snippets that use this hook.
wp_all_export_product_variation_mode
Description
Choose whether to export parent products or just variations.
Parameters
Param | Type | Description |
$exportVariationMode | string | Export variation mode. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_product_variation_mode', 'export_only_variations', 10, 2 );
function export_only_variations( $exportVariationMode, $exportID ) {
return XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_VARIATION; // Only export variations for variable products, don't export the parent products
}
Search the docs for wp_all_export_product_variation_mode
to see real-world code snippets that use this hook.
wp_all_export_raw_prices
Description
Can be used to disable price formatting for WooCommerce exports.
Parameters
Param | Type | Description |
$raw_prices | bool | Disable price formatting? true / false. |
Usage
add_filter( 'wp_all_export_raw_prices', 'my_disable_formatting', 10, 1 );
function my_disable_formatting( $raw_prices ) {
// Do something.
return $raw_prices;
}
Search the docs for wp_all_export_raw_prices
to see real-world code snippets that use this hook.
wp_all_export_repeater_delimiter
Description
Define the delimiter used for ACF Repeater fields. Default is comma.
Parameters
Param | Type | Description |
$implode_delimiter | string | The delimiter to use. Default ",". |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_repeater_delimiter', 'wpae_wp_all_export_repeater_delimiter', 10, 2 );
function wpae_wp_all_export_repeater_delimiter( $implode_delimiter, $export_id ) {
return $implode_delimiter;
}
Search the docs for wp_all_export_repeater_delimiter
to see real-world code snippets that use this hook.
wp_all_export_use_csv_compliant_line_endings
Description
Use custom CSV writer when affected by https://bugs.php.net/bug.php?id=43225.
Parameters
Param | Type | Description |
$use_compliant_endings | bool | Use compliant endings? true / false. |
Usage
add_filter( 'wp_all_export_csv_strategy', function( $csvStrategy ) {
return \Wpae\Csv\CsvWriter::CSV_STRATEGY_CUSTOM;
}, 10, 1 );
add_filter( 'wp_all_export_use_csv_compliant_line_endings', function( $useCsvCompliantLineEndings ) {
return true;
}, 10, 1 );
Search the docs for wp_all_export_use_csv_compliant_line_endings
to see real-world code snippets that use this hook.
wp_all_export_xml_rows
Description
Filter a single XML record for conditional export. See wp_all_export_csv_rows for CSV exports.
Parameters
Param | Type | Description |
$is_export_record | bool | Include record in export? true / false. |
$record | object | Record object. |
$export_options | array | The export options. |
$export_id | int | The export ID. |
Usage
function my_wp_all_export_xml_rows( $is_export_record, $record, $export_options, $export_id ) {
// Unless you want this code to execute for every export, be sure to check the export id
//
// if ( $export_id == 5 ) { ...
// Check $record object and return true to export or false to skip
return true;
}
add_filter( 'wp_all_export_xml_rows', 'my_wp_all_export_xml_rows', 10, 4 );
Search the docs for wp_all_export_xml_rows
to see real-world code snippets that use this hook.
wp_all_export_zapier_response
Description
Can be used to manipulate the response sent to Zapier.
Parameters
Param | Type | Description |
$response | array | The response to Zapier. |
Usage
add_filter( 'wp_all_export_zapier_response', 'wpae_wp_all_export_zapier_response', 10, 1 );
function wpae_wp_all_export_zapier_response( $response ) {
// Code here.
return $response;
}
Search the docs for wp_all_export_zapier_response
to see real-world code snippets that use this example.
pmxi_custom_types
Description
This filter allows modifying the option shown in the post type dropdown on Step 1 of an import. The current list of types and the list being updated are available as parameters. The custom_types
list is where you'd add a post type to the dropdown that doesn't otherwise appear. The hidden_post_types
list allows removing items from the dropdown.
Parameters
Param | Type | Description |
$custom_types | array | The list of post types that will be available. |
$type | string | Which type of list is being updated - custom_types or hidden_post_types |
Usage
function wpai_custom_types( $custom_types ) {
// Modify the custom types to be shown on Step 1.
// Return the updated list.
return $custom_types;
}
add_filter( 'pmxi_custom_types', 'wpai_custom_types', 10, 1 );
Search the docs for pmxi_custom_types
to see real-world code snippets that use this filter.
pmxi_visible_template_sections
Description
This filter allows modifying what sections are shown in Step 3 and Manage Imports › Edit Import. It provides an array of sections set to show and the post type being imported.
Parameters
Param | Type | Description |
$sections | string array | The sections to show on Step 3. Possible options: 'caption', 'main', 'taxonomies', 'cf', 'featured', 'other', 'nested' |
$post_type | string | The post type being imported. |
Usage
function show_addon_section_users_customers( $sections, $post_type ) {
// Do something for your post type.
if ( 'your_post_type' == $post_type )
// Do something.
return $sections;
}
add_filter( 'pmxi_visible_template_sections', 'show_addon_section_users_customers', 11, 2 );
Search the docs for pmxi_visible_template_sections
to see real-world code snippets that use this filter.
wp_all_import_is_images_section_enabled
Description
This filter defines if the images section is enabled or disabled for a specific post type during import.
Parameters
Param | Type | Description |
$enabled | bool | Whether the images section is enabled or not. Returns true by default. |
$post_type | string | The post type that's being imported. |
Usage
function my_images_section_enabled( $enabled, $post_type ) {
return $enabled;
}
add_filter( 'wp_all_import_is_images_section_enabled', 'my_images_section_enabled', 10, 2 );
Search the docs for wp_all_import_is_images_section_enabled
to see real-world code snippets that use this hook.
wp_all_import_minimum_number_of_variations
Description
Use this hook to set the minimum number of variations a product can have before it's converted to a simple product by the "Create products with no variations as simple products" option.
Parameters
Param | Type | Description |
$min_variations | int | Minimum number of variations. Default 2. |
$product_id | bool | The Product ID. |
$import_id | string | The Import ID. |
Usage
add_filter( 'wp_all_import_minimum_number_of_variations', 'wpai_wp_all_import_minimum_number_of_variations', 10, 3 );
function wpai_wp_all_import_minimum_number_of_variations( $min_number_of_variations, $pid, $import_id ) {
return 1;
}
Search the docs for wp_all_import_minimum_number_of_variations
to see real-world code snippets that use this hook.
wpai_is_case_insensitive_taxonomy_mapping
Description
Return true to make the mapping rules in the "Enable Mapping for Categories" section case insensitive. Added in WP All Import v4.7.0-beta-1.1.
Parameters
Param | Type | Description |
$is_case_insensitive | bool | Defaults to false. |
$tx_name | string | The taxonomy name. |
Usage
add_filter( 'wpai_is_case_insensitive_taxonomy_mapping', 'my_is_case_insensitive_mapping', 10, 2 );
function my_is_case_insensitive_mapping( $is_case_insensitive, $tx_name ) {
// Return true to make it case insensitive
return $is_case_insensitive;
}
Search the docs for wpai_is_case_insensitive_taxonomy_mapping
to see real-world code snippets that use this hook.
wp_all_import_post_skipped
Description
Fires whenever an import record is SKIPPED.
Parameters
Param | Type | Description |
$post_to_update_id | int | The post ID, or 0 if there's no post. |
$import_id | int | The import ID. |
$current_xml_node | array | An array with the current import record's data. |
Usage
// Log all skips
add_action( 'wp_all_import_post_skipped', 'my_log_skips', 10, 3 );
function my_log_skips( $created, $import_id, $xml_data ) {
$uploads = wp_upload_dir();
$log_file_name = $uploads['basedir'] . '/' . $import_id . '_import_custom_log.txt';
if ( file_exists( $log_file_name ) ) {
$existing_data = file_get_contents( $log_file_name );
} else {
touch( $log_file_name );
$existing_data = '';
}
if ( $created == 0 ) {
$created = 'N/A';
}
if ( array_key_exists( 'sku', $xml_data ) && array_key_existS( 'title', $xml_data ) ) {
$existing_data .= '[ID: ' . $created . '] [SKU: ' . $xml_data['sku'] . '] [Title: ' . $xml_data['title'] . '] has been skipped.' . PHP_EOL;
file_put_contents( $log_file_name, $existing_data );
}
}
Search the docs for wp_all_import_post_skipped
to see other real-world code snippets that use this hook.
wp_all_import_single_image_uploads_dir
Description
This action fires every time an image is imported. Can be used to set a custom path in which images (as well as media intended for ACF fields) gets uploaded. Only applies to media uploaded via WP All Import. The main difference from wp_all_import_images_uploads_dir is that it includes the old image URL as a parameter.
Parameters
Param | Type | Description |
$uploads | array | Contains information related to the WordPress uploads path & URL. |
$image_url | string | Contains the imported image URL. |
$articleData | array | Contains a list of data related to the post/user/taxonomy being imported. |
$current_xml_node | array | Array of data for current import record. |
$import_id | int | The import ID that's running. |
$post_id | int | The post ID that's being imported. |
Usage
add_filter( 'wp_all_import_single_image_uploads_dir', 'wpai_wp_all_import_single_image_uploads_dir', 10, 6 );
function wpai_wp_all_import_single_image_uploads_dir( $uploads, $image_url, $articleData, $current_xml_node, $import_id, $post_id ) {
// Do something with code here.
return $uploads;
}
Search the docs for wp_all_import_single_image_uploads_dir
to see real-world code snippets that use this hook.
wp_all_import_single_attachment_uploads_dir
Description
This action fires every time an attachment is imported. Can be used to set a custom path in which attachments are uploaded. The main difference from wp_all_import_attachments_uploads_dir is that it includes the old attachment URL as a parameter.
Parameters
Param | Type | Description |
$uploads | array | Contains information related to the WordPress uploads path & URL. |
$attachment_url | string | Contains the imported attachment URL. |
$articleData | array | Contains a list of data related to the post/user/taxonomy being imported. |
$current_xml_node | array | Array of data for current import record. |
$import_id | int | The import ID that's running. |
Usage
add_filter( 'wp_all_import_single_attachment_uploads_dir', 'wpai_wp_all_import_single_attachment_uploads_dir', 10, 5 );
function wpai_wp_all_import_single_attachment_uploads_dir( $uploads, $attachment_url, $articleData, $current_xml_node, $import_id) {
// Do something with code here.
return $uploads;
}
Search the docs for wp_all_import_single_attachment_uploads_dir
to see real-world code snippets that use this hook.
wp_all_import_before_variable_product_import
Description
This action provides the ID of the parent product before parent data is synced to variations.
Parameters
Param | Type | Description |
$product_id | int | The parent product ID. |
Usage
function my_before_variable_product_import($product_id) {
$import_id = wp_all_import_get_import_id();
// Only run for import ID 5.
if ($import_id == '5') {
// Do something.
}
}
add_action('wp_all_import_before_variable_product_import', 'my_before_variable_product_import', 10, 1);
Search the docs for wp_all_import_before_variable_product_import
to see real-world code snippets that use this filter.
wpai_ftp_root
Description
This filter is used to change the FTP root used when downloading a file via FTP. It passes the current $root and the import ID. The desired root should be returned.
Parameters
Param | Type | Description |
$root | string | Current value for root. Default: '/' |
$import_id | int | The ID of the import that's running. |
Usage
function my_change_ftp_root( $root, $import_id ) {
// Run this code on a specific import
if ($import_id == '5') {
// Do something with the FTP root found in $root
}
return $root;
}
add_filter( 'wpai_ftp_root', 'my_change_ftp_root', 10, 2 );
Search the docs for
to see real-world code snippets that use this filter.wpai_ftp_root
wpai_ftp_ignore_passive_address
Description
This filter is used to ignore passive addresses. It's disabled by default.
Parameters
Param | Type | Description |
$ignore | bool | Whether to ignore passive address or not. Default: false |
Usage
function my_ignore_passive_address( $ignore ) {
return $ignore;
}
add_filter( 'wpai_ftp_ignore_passive_address', 'my_ignore_passive_address', 10, 1 );
Search the docs for
to see real-world code snippets that use this filter.wpai_ftp_ignore_passive_address
wp_all_import_logger
Description
This filter allows to extend the logging logic into other outputs, by allowing you to hook existing logging into external logging function and pass the data.
Parameters
Param | Type | Description |
$logger | function | Current $logger function |
Usage
function my_custom_logger( $logger ) {
return function($m){
//Output to WP_CLI, if possible.
if(class_exists('WP_CLI')){
\WP_CLI::line($m);
}
//Do something else.
}
}
add_filter( 'wp_all_import_logger', 'my_custom_logger', 10, 1);
Search the docs for wp_all_import_logger
to see real-world code snippets that use this filter.
wpai_ftp_passive_mode
Description
This filter is used to enable or disable passive mode. It's enabled by default.
Parameters
Param | Type | Description |
$enable | bool | Whether to enable or disable passive mode. Default: true |
Usage
function my_passive_mode( $enable ) {
return $enable;
}
add_filter( 'wpai_ftp_passive_mode', 'my_passive_mode', 10, 1 );
Search the docs for
to see real-world code snippets that use this filter.wpai_ftp_passive_mode
wpai_ftp_timeout
Description
This filter is used to control the FTP timeout time.
Parameters
Param | Type | Description |
$seconds | int | Amount of time before timing out. Default: 10 |
Usage
function my_custom_timeout( $seconds ) {
return $seconds;
}
add_filter( 'wpai_ftp_timeout', 'my_custom_timeout', 10, 1 );
Search the docs for
to see real-world code snippets that use this filter.wpai_ftp_timeout
wpai_ftp_custom_target_file_filter
Description
This filter fires when retrieving the file in an import with an FTP source. It allows you to provide a dynamic value for the target file name. This is triggered by using /your/path/here/{custom.ext} in the path when configuring the import (where ext is the extension that will be passed via the filter). The path portion is optional, but the {custom.ext} part is required, or the filter won't be called.
Parameters
Param | Type | Description |
$current_full_path | string | The current full path used. |
$contents_of_full_path | array | Array with the contents of the current path. |
$user_provided_extension | string | The custom extension provided. |
Usage
add_filter( 'wpai_ftp_custom_target_file_filter', 'my_custom_target_file', 10, 3 );
function my_custom_target_file( $current_full_path, $contents_of_full_path, $user_provided_extension ) {
// Do something with code here.
return $current_full_path;
}
Search the docs for wpai_ftp_custom_target_file_filter
to see real-world code snippets that use this hook.
pmxe_is_bundle
Description
This filter fires when exporting WooCommerce products in a Google Merchant Center export feed. It's used to define the value for the "is_bundle" attribute.
Parameters
Param | Type | Description |
$default_value | string | The current default value for "is_bundle". |
$entry | object | The current product object. |
$export_id | string | The export ID that's running. |
Usage
add_filter( 'pmxe_is_bundle', 'my_set_bundle', 10, 3 );
function my_set_bundle( $default_value, $entry, $export_id ) {
return $default;
}
Search the docs for pmxe_is_bundle
to see real-world code snippets that use this hook.
{newest.ext}
Description
This relative format obtains the newest file when importing from FTP or SFTP. After selecting the import file in the selection window, modify the FTP file path field and change the added filename to {newest.ext}, where ext corresponds to the file extension you're targeting. For example, to obtain the newest .CSV file, you would input {newest.CSV}. The extension is case-sensitive.
{any.ext}
Description
This relative format obtains any file matching the extension when importing from FTP or SFTP. After selecting the import file in the selection window, modify the FTP file path field and change the added filename to {any.ext}, where ext corresponds to the file extension you're targeting. For example, to obtain .CSV files, you would input {any.CSV}. The extension is case-sensitive.
{oldest.ext}
Description
This relative format obtains the oldest file when importing from FTP or SFTP. After selecting the import file in the selection window, modify the FTP file path field and change the added filename to {oldest.ext}, where ext corresponds to the file extension you're targeting. For example, to obtain the oldest .CSV file, you would input {oldest.CSV}. The extension is case-sensitive.
{custom.ext}
Description
This relative format obtains a custom file when importing from FTP or SFTP. After selecting the import file in the selection window, modify the FTP file path field and change the added filename to {custom.ext}, where ext corresponds to the file extension you're targeting. For example, to obtain a specific .CSV file, you would input {custom.CSV}. The extension is case-sensitive. This relative format is tied to the wpai_ftp_custom_target_file_filter
filter.
wp_all_import_force_cron_processing_on_empty_feed
Description
This filter fires when importing via cron job or our Automatic Scheduling Service. It allows you to run the import on an empty feed. Out of the box, empty feeds will be skipped when running via cron jobs.
Parameters
Param | Type | Description |
$is_force_processing | bool | Whether the import should run on an empty feed or not. Returns false by default. |
$import_id | int | The import ID. |
Usage
add_filter( 'wp_all_import_force_cron_processing_on_empty_feed', 'my_run_on_empty_feed', 10, 2 );
function my_run_on_empty_feed( $is_force_processing, $import_id ) {
// Do something with code here.
return $is_force_processing;
}
Search the docs for wp_all_import_force_cron_processing_on_empty_feed
to see real-world code snippets that use this hook.
wp_all_import_regenerate_lookup_tables
Description
This filter allows disabling the automatic regeneration of WooCommerce lookup tables after each product import.
Parameters
Param | Type | Description |
$regenerate_lookup_tables | bool | Whether to regenerate lookup tables at the end of an import or not. |
$import_id | int | The import ID. |
Usage
add_filter( 'wp_all_import_regenerate_lookup_tables', 'wpai_regenerate_lookup_tables', 10, 2 );
function wpai_regenerate_lookup_tables( $regenerate_lookup_tables, $import_id ) {
// Do something with code here.
return $regenerate_lookup_tables;
}
Search the docs for wp_all_import_regenerate_lookup_tables
to see real-world code snippets that use this hook.
pmxi_is_images_to_update
Description
This filter controls whether images are to be updated for the record being imported.
Parameters
Param | Type | Description |
$is_images_to_update | bool | Whether images are to be updated or not. True by default. |
$articleData | array | Array of current import item data. |
$current_xml_node | array | Parsed data for the current import record. |
$post_id | int | The post ID in question. |
Usage
add_filter( 'pmxi_is_images_to_update', 'wpai_is_images_to_update', 10, 2 );
function wpai_is_images_to_update( $is_images_to_update, $articleData, $current_xml_node, $post_id ) {
// Do something with code here.
return $is_images_to_update;
}
Search the docs for pmxi_is_images_to_update
to see real-world code snippets that use this hook.
wp_all_import_recount_terms_after_import
Description
This filter controls whether the import calls the WooCommerce _wc_term_recount function at the end of the import process.
Parameters
Param | Type | Description |
$is_recount_terms | bool | Whether to recount terms or not. True by default. |
$import_id | int | The import ID in question. |
Usage
add_filter('wp_all_import_recount_terms_after_import', 'wpai_wp_all_import_recount_terms_after_import', 10, 2);
function wpai_wp_all_import_recount_terms_after_import( $is_recount_terms, $import_id ){
return $is_recount_terms;
}
Search the docs for wp_all_import_recount_terms_after_import
to see real-world code snippets that use this hook.
wp_all_import_term_exists
Description
This filter fires when WP All Import checks if a taxonomy term already exists. The $term_exists value will be whatever is returned by the term_exists function when WP All Import calls it. This filter allows overriding the found term and expects the same data – as provided by that function – to be returned.
Parameters
Param | Type | Description |
$term_exists | int|array | If it exists, this would contain the data returned from the term_exists function about the term found. |
$taxonomy | string | The taxonomy name to use. |
$term | int|string | The term to check. Accepts term ID, slug, or name. |
$parent | int | ID of parent term under which to confine the exists search. |
Usage
add_filter('wp_all_import_term_exists', 'wpai_wp_all_import_term_exists', 10, 4);
function wpai_wp_all_import_term_exists( $term_exists, $taxonomy, $term, $parent ){
//Do something with code
return $term_exists;
}
Search the docs for wp_all_import_term_exists
to see real-world code snippets that use this hook.
wp_all_import_is_import_empty_acf_fields
Description
This filter fires when importing ACF fields and returns a true value, which allows you to import/update empty ACF fields. However, in some cases, you may need to disable that behavior and skip updating/importing empty ACF fields.
Parameters
Param | Type | Description |
$is_update | bool | Whether to update empty ACF fields or not. |
$import_id | int | Import ID in question. |
Usage
add_filter('wp_all_import_is_import_empty_acf_fields', 'example_empty_acf_fields', 10, 2);
function example_empty_acf_fields( $is_update, $import_id ) {
//Do something with code.
return $is_update;
}
Search the docs for wp_all_import_is_import_empty_acf_fields
to see real-world code snippets that use this hook.
pmxi_before_post_import
Description
This action fires before each post or record is imported.
Parameters
Param | Type | Description |
$import_id | int | The import ID in question. |
Usage
function my_before_post_import( $import_id ) {
// Only run for import ID 5.
if ($import_id == '5') {
// Do something.
}
}
add_action('pmxi_before_post_import', 'my_before_post_import', 10, 1);
Search the docs for pmxi_before_post_import
to see real-world code snippets that use this filter.
wpallexport_custom_types
Description
This filter allows you to set your own post types to choose from when creating an export via WP All Export.
Parameters
Param | Type | Description |
$custom_types | array | It contains all information about the post types available to export. |
Usage
add_filter( 'wpallexport_custom_types', 'my_wpallexport_custom_types', 10, 1 );
function my_wpallexport_custom_types( $custom_types ) {
return $custom_types;
}
Search the docs for wpallexport_custom_types
to see real-world code snippets that use this hook.
pmxi_custom_field_to_delete
Description
This filter allows you to control whether custom fields are deleted or not when importing via WP All Import. This filter is only called when the Choose which data to update setting is selected and only for fields entered in the Custom Fields section of the import.
Parameters
Param | Type | Description |
$is_field_to_delete | bool | Whether the custom field should be deleted or not. Default: true. |
$pid | int | Current post ID. |
$post_type | string | Post type being imported. |
$import_options | array | Current import options. |
$meta_key | string | Current custom field meta key. |
Usage
add_filter('pmxi_custom_field_to_delete', 'wpai_pmxi_custom_field_to_delete', 10, 4);
function wpai_pmxi_custom_field_to_delete( $is_field_to_delete, $pid, $post_type, $import_options, $meta_key ){
return $is_field_to_delete;
}
Search the docs for pmxi_custom_field_to_delete
to see real-world code snippets that use this hook.
pmxi_custom_field_to_update
Description
This filter allows you to control whether custom fields are updated or not when importing via WP All Import. This filter is only called when the Choose which data to update setting is selected and only for fields entered in the Custom Fields section of the import.
Parameters
Param | Type | Description |
$is_field_to_update | bool | Whether the custom field should be updated or not. Default: true. |
$post_type | string | Post type being imported. |
$import_options | array | Current import options. |
$meta_key | string | Current custom field meta key. |
Usage
add_filter('pmxi_custom_field_to_update', 'wpai_pmxi_custom_field_to_update', 10, 4);
function wpai_pmxi_custom_field_to_update( $is_field_to_update, $post_type, $import_options, $meta_key ){
return $is_field_to_update;
}
Search the docs for pmxi_custom_field_to_update
to see real-world code snippets that use this hook.
wp_all_import_scan_files_recursively
Description
This filter allows you to cancel the sub-folder scan in the /wpallimport/files/ folder when creating a new import process. This code has to be added to a Code Snippets plugin, or your theme's functions.php file.
Parameters
Param | Type | Description |
$scan_recursively | bool | Whether to scan recursively in the /wpallimport/files/ folder or not. Default: true. |
Usage
add_filter('wp_all_import_scan_files_recursively', 'wpai_wp_all_import_scan_files_recursively', 10, 1);
function wpai_wp_all_import_scan_files_recursively($scan_recursively) {
return $scan_recursively;
}
Search the docs for wp_all_import_scan_files_recursively
to see real-world code snippets that use this hook.
wp_all_import_content_images_get_full_size
Description
By default, WP All Import will try to get full-size images in the content, but that behavior can change with this filter. The import will only try to get the full-size content images if the image URL follows the format: imgURLhere/image.ext-0000x0000 where -0000x0000 includes dimensions from 2 to 4 digits each. This filter returning 'false' would help anyone using that URL format who either wants to keep the specified source image sizes, or that wants the fastest download speed.
Parameters
Param | Type | Description |
$get_full_size | bool | Whether to get the full-size images or not. Default: true. |
$article_data | array | Current article data. |
$import_id | int | Current import ID. |
Usage
add_filter( 'wp_all_import_content_images_get_full_size', 'wpai_wp_all_import_content_images_get_full_size', 10, 3);
function wpai_wp_all_import_content_images_get_full_size( $get_full_size, $article_data, $import_id ) {
return $get_full_size;
}
Search the docs for wp_all_import_content_images_get_full_size
to see real-world code snippets that use this hook.
wp_all_import_before_preserve_post_data
Description
This action allows you to manipulate the import options on the fly.
Parameters
Param | Type | Description |
$import | object | The import object. |
$pid | int | The post ID to update. |
$articleData | array | Current article data. |
Usage
add_action('wp_all_import_before_preserve_post_data', 'wpai_wp_all_import_before_preserve_post_data', 10, 3);
function wpai_wp_all_import_before_preserve_post_data($import, $pid, $articleData) {
// Do something to modify import options before post import.
}
Search the docs for wp_all_import_before_preserve_post_data
to see real-world code snippets that use this filter.
wp_all_import_specified_delimiters
Description
This filter can be used to define the delimiters WP All Import will allow in CSV import files.
Parameters
Param | Type | Description |
$delimiters | array | Array with the current CSV delimiters allowed, such as comma, semicolon, pipe, and tabulation. |
Usage
add_filter( 'wp_all_import_specified_delimiters', 'wpai_specified_delimiters', 10, 1);
function wpai_specified_delimiters( $delimiters ) {
return $delimiters;
}
Search the docs for wp_all_import_specified_delimiters
to see real-world code snippets that use this hook.
wp_all_import_csv_parser_settings
Description
This filter can be used to change the CSV parser settings programmatically.
Parameters
Param | Type | Description |
$settings | array | Array with the current CSV parser settings. |
Usage
add_filter( 'wp_all_import_csv_parser_settings', 'wpai_csv_parser_settings', 10, 1);
function wpai_csv_parser_settings( $settings ) {
/**
* csv parsing default-settings
* $settings = array(
* 'delimiter' => ',',
* 'eol' => '',
* 'length' => 999999,
* 'escape' => '"'
* )
*
*/
return $settings;
}
Search the docs for wp_all_import_csv_parser_settings
to see real-world code snippets that use this hook.
wp_all_import_is_trim_parsed_data
Description
This filter can be used to avoid trimming import field values when the import file is processed.
Parameters
Param | Type | Description |
$is_trim | bool | Default: true . Return false to avoid trimming values when parsed. |
Usage
add_filter('wp_all_import_is_trim_parsed_data', 'wpai_wp_all_import_is_trim_parsed_data', 10, 1);
function wpai_wp_all_import_is_trim_parsed_data($is_trim){
return $is_trim;
}
Search the docs for wp_all_import_is_trim_parsed_data
to see real-world code snippets that use this hook.
wp_all_export_no_cache
Description
This filter sets HTTP headers to tell the browser and any proxies not to cache the files being served by WP All Export. When true
is returned in this hook, it has the added benefit of avoiding a redirect to reach the file – as it's served directly instead.
The code for this filter has to be added inside your child themes functions.php file, or in a plugin like Code Snippets.
Parameters
Param | Type | Description |
$cache | bool | Return false to use cache. Return true to not use cache. Default: false |
Usage
add_filter( 'wp_all_export_no_cache', 'my_change_cache', 10, 1 );
function my_change_cache( $cache ) {
return $cache;
}
Search the docs for wp_all_export_no_cache
to see real-world code snippets that use this hook.
wp_all_import_use_only_wp_http_api
Description
This filter will force WP All Import to make the initial attempt to download a file with the WordPress HTTP API. In most cases, that means it will prevent cURL from being used directly.
Parameters
Param | Type | Description |
$only_http | bool | Return false to use normal behavior. Return true to use only WP's HTTP API. Default: false |
Usage
add_filter( 'wp_all_import_use_only_wp_http_api', 'wpai_wp_all_import_use_only_wp_http_api', 10, 1 );
function wpai_wp_all_import_use_only_wp_http_api( $only_http ) {
return $only_http;
}
Search the docs for wp_all_import_use_only_wp_http_api
to see real-world code snippets that use this hook.
wp_all_import_hash_ignore_options
Description
This filter can be used to add or remove options from the $hash_ignore_options array, allowing you to modify which settings are ignored by the Skip Records If Their Data Has Not Changed option.
This could be handy in cases where you don't want a certain setting to be included in the hash generated, thus allowing you to change that setting without the hash being invalidated.
Parameters
Param | Type | Description |
$hash_ignore_options | array | Array with the current options being ignored when the hash is generated. |
$import_id | int | The import ID that's running. |
Usage
add_filter('wp_all_import_hash_ignore_options', 'my_ignore_records_per_iteration', 10, 2);
function my_ignore_records_per_iteration($hash_ignore_options, $import_id) {
return $hash_ignore_options;
}
Search the docs for wp_all_import_hash_ignore_options
to see real-world code snippets that use this hook.
wp_all_import_shard_delay
Description
This filter can be used to add a sleep or delay right after the import file is divided into chunks and a new chunk is generated.
Parameters
Param | Type | Description |
$sleep | int | Amount of time in microseconds. For example, to sleep half a second (0.5s), this would need to be 500000. |
Usage
add_filter( 'wp_all_import_shard_delay', 'add_delay', 10, 1 );
function add_delay( $sleep ) {
return $sleep;
}
Search the docs for wp_all_import_shard_delay
to see real-world code snippets that use this hook.
wp_all_import_phpexcel_delimiter
Description
This filter sets the delimiter to use when processing your uploaded Excel files. It's only needed when using something other than commas.
Parameters
Param | Type | Description |
$delimiter | string | Current delimiter used to parse Excel files. Default: Comma (,) |
Usage
add_filter('wp_all_import_phpexcel_delimiter', 'soflyy_set_excel_delimiter', 10, 2);
function soflyy_set_excel_delimiter ($delimiter, $file_path) {
//$filename = basename($file_path);
//if ( $filename == 'example.xlsx' ) {
// return '|';
//}
return $delimiter;
}
Search the docs for wp_all_import_phpexcel_delimiter
to see real-world code snippets that use this hook.
wpai_ftp_enable_debug
Description
This filter can be used to enable FTP debugging.
Parameters
Param | Type | Description |
$is_debug_enabled | bool | Default: false . Return true to enable FTP debugging. |
Usage
add_filter('wpai_ftp_enable_debug', 'ftp_enable_debug', 10, 1);
function ftp_enable_debug ( $is_debug_enabled ) {
return $is_debug_enabled;
}
Search the docs for wpai_ftp_enable_debug
to see real-world code snippets that use this hook.
wpai_ftp_allow_hidden_files_folders
Description
This filter is used to show hidden files and folders when accessing an FTP/SFTP location via WP All Import.
Parameters
Param | Type | Description |
$hidden_enabled | bool | Default: false . Return true to show hidden files and folders. |
Usage
add_filter('wpai_ftp_allow_hidden_files_folders', 'ftp_enable_hidden_files', 10, 1);
function ftp_enable_hidden_files ( $hidden_enabled ) {
return $hidden_enabled;
}
Search the docs for wpai_ftp_allow_hidden_files_folders
to see real-world code snippets that use this hook.
wpai_ftp_allowed_file_extensions
Description
This filter is used to modify the allowed file extensions when importing via FTP/SFTP in WP All Import.
Parameters
Param | Type | Description |
$allowed_ext | array | Current file extensions which are allowed. |
Usage
add_filter('wpai_ftp_allowed_file_extensions', 'ftp_allowed_file_extensions', 10, 1);
function ftp_allowed_file_extensions ( $allowed_ext ) {
return $allowed_ext;
}
Search the docs for wpai_ftp_allowed_file_extensions
to see real-world code snippets that use this hook.
wp_all_import_is_enabled_stream_filter
Description
This filter controls whether the 'preprocessxml' custom stream filter is used or not: https://www.php.net/manual/en/function.stream-filter-register.php.
It's essentially the same end result as the is_xml_preprocess_enabled filter, except this one disables the custom stream filtering completely instead of overriding it where it still has to process the data.
Parameters
Param | Type | Description |
$is_enabled | bool | Default: true . Return false to disable the stream reader option. |
Usage
add_filter('wp_all_import_is_enabled_stream_filter', 'wpai_is_enabled_stream_filter', 10, 1);
function wpai_is_enabled_stream_filter ( $is_enabled ) {
return $is_enabled;
}
Search the docs for wp_all_import_is_enabled_stream_filter
to see real-world code snippets that use this hook.
is_xml_preprocess_enabled
Description
This filter is used to disable preprocessing the XML in cases where the XML import file is valid, and UTF-8 encoded, but WP All Import still rejects it.
It's also relevant when trying to process UTF-16 encoded files. It's not guaranteed they'll work, but often they do.
Parameters
Param | Type | Description |
$is_enabled | bool | Default: true . Return false to disable the XML preprocessing. |
Usage
add_filter('is_xml_preprocess_enabled', 'wpai_is_xml_preprocess_enabled', 10, 1);
function wpai_is_xml_preprocess_enabled ( $is_enabled ) {
return $is_enabled;
}
Search the docs for is_xml_preprocess_enabled
to see real-world code snippets that use this hook.
wp_all_import_api_image_filename
Description
This filter can be used to set a custom filename for images imported via our API or Add-Ons. That is, not imported via the general image section.
Parameters
Param | Type | Description |
$image_name | string | Current image filename name used. |
$img_url | string | URL to the image imported. |
$pid | int | Current post ID. |
Usage
add_filter('wp_all_import_api_image_filename', 'wpai_api_image_filename', 10, 3);
function wpai_api_image_filename($image_name, $img_url, $pid){
return $image_name;
}
Search the docs for wp_all_import_api_image_filename
to see real-world code snippets that use this hook.
wp_all_import_is_base64_images_allowed
Description
This filter can be used to enable or disable importing base64 images in WP All Import.
Parameters
Param | Type | Description |
$is_allowed | bool | Default: true . Return false to disable importing base64 images. |
$image_url | string | URL of the image imported. |
$import_id | int | The import ID that's running. |
Usage
add_filter('wp_all_import_is_base64_images_allowed', 'wpai_is_base64_images_allowed', 10, 3);
function wpai_is_base64_images_allowed( $is_allowed, $image_url, $import_id ){
return $is_allowed;
}
Search the docs for wp_all_import_is_base64_images_allowed
to see real-world code snippets that use this hook.
wp_all_import_add_attachment
Description
This action fires every time a new attachment is added.
Parameters
Param | Type | Description |
$att_id | int | The ID for the newly added attachment. |
Usage
add_action('wp_all_import_add_attachment', 'wpai_add_attachment', 10, 1);
function wpai_add_attachment( $att_id ){
// Do something with the attachment ID $att_id
}
Search the docs for wp_all_import_add_attachment
to see real-world code snippets that use this filter.
wp_all_import_json_to_xml
Description
The filter is used to modify the associative array representation of a JSON import file before it's converted to XML.
The variable $data is passed as the return value from json_decode() with the associative option enabled, and is expected always to be an array.
Parameters
Param | Type | Description |
$data | array | Associative array representation of JSON import file |
Usage
add_filter('wp_all_import_json_to_xml', 'wpai_json_to_xml', 10, 1);
function wpai_json_to_xml( $data ) {
return $data;
}
Search the docs for wp_all_import_json_to_xml
to see real-world code snippets that use this hook.
import_functions_file_path
Description
This filter lets you modify where the functions.php file for our Function Editor is stored.
Parameters
Param | Type | Description |
$functions_path | string | Current functions.php file directory path. |
Usage
add_filter('import_functions_file_path', 'example_adjust_wpai_functions_file_path');
function example_adjust_wpai_functions_file_path ( $functions_path ) {
//Example to store functions.php in the root of your WP install in a folder "my-functions-folder"
//$new_functions_directory = get_home_path() . DIRECTORY_SEPARATOR . 'my-functions-folder';
//return $new_functions_directory . DIRECTORY_SEPARATOR . 'functions.php';
return $functions_path;
}
Search the docs for import_functions_file_path
to see real-world code snippets that use this hook.
pmxi_missing_post
Description
This action fires every time a missing record is found for any of the options under Instead of deletion... when using the Remove or modify records that are not present in this import file option. This fires long before the configured action is taken (modify or delete).
Parameters
Param | Type | Description |
$pid | int | Current post ID. |
Usage
add_action('pmxi_missing_post', 'wp_all_import_missing_post', 10, 1);
function wp_all_import_missing_post( $pid ){
// Do something with the post ID $pid
}
Search the docs for pmxi_missing_post
to see real-world code snippets that use this filter.
wp_all_import_is_post_to_skip
Description
This filter is used to control or perform an action when posts are skipped. The returned value should be either true
to skip the post or false
to avoid skipping it.
Parameters
Param | Type | Description |
$is_skip | bool | Whether the post should be skipped or not. Default: false . |
$import_id | int | The ID of the import that's running. |
$current_xml_node | array | An array containing the data for the current import record. |
$iteration | int | Array index of record being processed. |
$post_to_update_id | int | The Post ID that's about to be skipped. |
Usage
add_filter('wp_all_import_is_post_to_skip', 'wpai_wp_all_import_is_post_to_skip', 10, 5);
function wpai_wp_all_import_is_post_to_skip( $is_skip, $import_id, $current_xml_node, $iteration, $post_to_update_id){
return $is_skip;
}
Search the docs for wp_all_import_is_post_to_skip
to see real-world code snippets that use this hook.
pmxi_is_attachments_to_update
Description
This filter controls whether attachments are to be updated for the record being imported.
Parameters
Param | Type | Description |
$is_to_update | bool | Whether the attachment should be updated or not. Default: true . |
$articleData | int | Contains a list of data related to the post/user/taxonomy being imported. |
$current_xml_node | array | Array of data for current import record. |
Usage
add_filter( 'pmxi_is_attachments_to_update', 'wpai_pmxi_is_attachments_to_update', 10, 3 );
function wpai_pmxi_is_attachments_to_update( $is_to_update, $articleData, $current_xml_node, $import_id ) {
return $is_to_update;
}
Search the docs for pmxi_is_attachments_to_update
to see real-world code snippets that use this hook.
wp_all_export_remove_csv_headers
Description
This action fires when the export is run and can be used to remove its headers. Works on CSV and Excel exports only.
Parameters
Param | Type | Description |
$remove_headers | bool | Whether headers should be removed or not. Default: false . |
$export_id | int | The export ID. |
Usage
add_filter('wp_all_export_remove_csv_headers', 'wp_all_export_remove_csv_headers', 10, 2);
function wp_all_export_remove_csv_headers( $remove_headers, $export_id ){
return $remove_headers;
}
Search the docs for wp_all_export_remove_csv_headers
to see real-world code snippets that use this filter.
pmxi_before_import_delete
Description
This action fires right before any of the Manage Imports › Delete actions are performed on an import. See more: How to Delete Records.
Parameters
Param | Type | Description |
$item | object | The current import object. |
$is_delete_posts | bool | Whether records are set to be deleted or not. Default: false . |
Usage
add_action( 'pmxi_before_import_delete', 'wpai_before_import_delete', 10, 2 );
function wpai_before_import_delete( $item, $is_delete_posts ) {
// Do something before the import process is deleted.
}
Search the docs for pmxi_before_import_delete
to see real-world code snippets that use this filter.
wp_all_import_default_options
Description
This filter allows controlling the default options assigned to a new import. For example, you can have the Existing Items option chosen as default instead of the New Items one. See: Import Types Available in WP All Import.
Parameters
Param | Type | Description |
$default_options | array | Array with the default options. |
Usage
add_filter( 'wp_all_import_default_options', 'my_wp_all_import_default_options', 10, 1 );
function my_wp_all_import_default_options( $default_options ) {
//Make "Existing Items" default
//$default_options['wizard_type'] = 'matching';
return $default_options;
}
Search the docs for wp_all_import_default_options
to see real-world code snippets that use this hook.
wp_all_import_feed_url
Description
This filter allows overriding the URL provided with the Download a file › From URL option.
Parameters
Param | Type | Description |
$url | string | String with the current URL used. |
Usage
add_filter( 'wp_all_import_feed_url', 'wpai_feed_url', 10, 1 );
function wpai_feed_url( $url ) {
return $url;
}
Search the docs for wp_all_import_feed_url
to see real-world code snippets that use this hook.
wp_all_export_enable_rtl
Description
This filter allows to enable RTL (right-to-left) support when exporting Excel files in WP All Export.
Parameters
Param | Type | Description |
$is_rtl | bool | Whether Right-To-Left is enabled or not. Default: false . |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_enable_rtl', 'wpae_enable_rtl', 10, 2 );
function wpae_enable_rtl( $is_rtl, $export_id ) {
return $is_rtl;
}
Search the docs for wp_all_export_enable_rtl
to see real-world code snippets that use this hook.
wp_all_export_is_wrap_value_into_cdata
Description
This filter allows to programmatically control whether to wrap values with CDATA tags or not. Note this completely overrides the CDATA settings in the export configuration. This only applies to XML exports.
Parameters
Param | Type | Description |
$is_wrap_into_cdata | bool | Whether to wrap the value in CDATA tags or not. |
$value | string | Current element value. |
$element_name | string | Current element name. |
Usage
add_filter( 'wp_all_export_is_wrap_value_into_cdata', 'wpae_is_wrap_value_cdata', 10, 3 );
function wpae_is_wrap_value_cdata( $is_wrap_into_cdata, $value, $element_name ) {
return $is_wrap_into_cdata;
}
Search the docs for wp_all_export_is_wrap_value_into_cdata
to see real-world code snippets that use this hook.
wp_all_export_default_fields
Description
This filter allows modifying the default fields added automatically to the export when a new export is created in WP All Export.
Parameters
Param | Type | Description |
$default_fields | array | An array of arrays with the default fields. Each subfield array contains label, name, and type for the field. |
Usage
add_filter( 'wp_all_export_default_fields', 'wpae_default_fields', 10, 1 );
function wpae_default_fields( $default_fields ) {
return $default_fields;
}
Search the docs for wp_all_export_default_fields
to see real-world code snippets that use this hook.
wp_all_export_available_sections
Description
This filter allows programmatically controlling which are the available sections found under Available Data in WP All Export.
Parameters
Param | Type | Description |
$available_sections | array | Array of arrays with all of the available sections with export data. |
Usage
add_filter( 'wp_all_export_available_sections', 'wpae_available_sections', 10, 1 );
function wpae_available_sections( $available_sections ) {
return $available_sections;
}
Search the docs for wp_all_export_available_sections
to see real-world code snippets that use this hook.
wp_all_export_xml_header
Description
This filter allows programmatically changing the XML header for XML exports.
Parameters
Param | Type | Description |
$xml_header | string | Current XML header: <?xml version="1.0" encoding="UTF-8"?> |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_xml_header', 'wpae_xml_header', 10, 2 );
function wpae_xml_header( $xml_header, $export_id ) {
return $xml_header;
}
Search the docs for wp_all_export_xml_header
to see real-world code snippets that use this hook.
wp_all_export_csv_strategy
Description
This filter allows programmatically changing the CSV strategy for the CSV writer used in WP All Export. The only two values accepted by this filter are CSV_STRATEGY_DEFAULT and CSV_STRATEGY_CUSTOM.
Parameters
Param | Type | Description |
$csvStrategy | string | Current CSV strategy: \Wpae\Csv\CsvWriter::CSV_STRATEGY_DEFAULT |
Usage
add_filter( 'wp_all_export_csv_strategy', 'wpae_export_csv_strategy', 10, 1 );
function wpae_export_csv_strategy( $csvStrategy ) {
return $csvStrategy;
}
Search the docs for wp_all_export_csv_strategy
to see real-world code snippets that use this hook.
pmxi_manage_imports_columns
Description
This filter allows programmatically changing the columns available in All Import › Manage Imports.
Parameters
Param | Type | Description |
$columns | array | Array with current columns. |
Usage
add_filter( 'pmxi_manage_imports_columns', 'wp_all_import_manage_imports_columns', 10, 1 );
function wp_all_import_manage_imports_columns( $columns ) {
return $columns;
}
Search the docs for pmxi_manage_imports_columns
to see real-world code snippets that use this hook.
pmxi_manage_imports_column
Description
This action fires where the columns are added and allows adding custom columns to WP All Import.
Parameters
Param | Type | Description |
$column_id | string | Column identifier. |
$item | array | Array with current settings for imports. |
Usage
add_action( 'pmxi_manage_imports_column', 'wp_all_import_manage_imports_column', 10, 2 );
function wp_all_import_manage_imports_column( $column_id, $item ) {
//Do something with the column data
}
Search the docs for pmxi_manage_imports_column
to see real-world code snippets that use this hook.
wp_all_export_main_xml_tag
Description
This filter allows programmatically changing the main XML tag used in the export. This filter overrides the Root XML Element value.
Parameters
Param | Type | Description |
$main_xml_tag | string | Main XML tag used. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_main_xml_tag', 'wpae_main_xml_tag', 10, 2 );
function wpae_main_xml_tag( $main_xml_tag, $export_id ) {
return $main_xml_tag;
}
Search the docs for wp_all_export_main_xml_tag
to see real-world code snippets that use this hook.
wp_all_export_xml_footer
Description
This filter allows programmatically adding a footer to your XML export in WP All Export.
Parameters
Param | Type | Description |
$xml_footer | string | Footer tag to use. Default: empty. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_xml_footer', 'wpae_xml_footer', 10, 2 );
function wpae_xml_footer( $xml_footer, $export_id ) {
return $xml_footer;
}
Search the docs for wp_all_export_xml_footer
to see real-world code snippets that use this hook.
wp_all_export_record_xml_tag
Description
This filter allows programmatically changing the XML tag for nodes. For example, when exporting posts, this would be "post". This filter overrides the Single Post XML Element option value.
Parameters
Param | Type | Description |
$record_xml | string | Main XML node tag. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_record_xml_tag', 'wpae_record_xml_tag', 10, 2 );
function wpae_record_xml_tag( $record_xml, $export_id ) {
return $record_xml;
}
Search the docs for wp_all_export_record_xml_tag
to see real-world code snippets that use this hook.
wp_all_export_field_name
Description
This filter allows programmatically changing the name of your export fields. It's going to be executed for all export fields added to your export.
Parameters
Param | Type | Description |
$element_name | string | The field name for the export field. |
$export_id | int | The export ID. |
Usage
add_filter( 'wp_all_export_field_name', 'wpae_field_name', 10, 2 );
function wpae_field_name( $element_name, $export_id ) {
return $element_name;
}
Search the docs for wp_all_export_field_name
to see real-world code snippets that use this hook.
wp_all_export_other_fields
Description
This filter allows programmatically modifying the fields available under Available Data › Other.
Parameters
Param | Type | Description |
$other_fields | Array | Array of arrays with current fields under Available Data › Other. |
Usage
add_filter( 'wp_all_export_other_fields', 'wpae_other_fields', 10, 1 );
function wpae_other_fields( $other_fields ) {
return $other_fields;
}
Search the docs for wp_all_export_other_fields
to see real-world code snippets that use this hook.
wp_all_export_available_data
Description
This filter allows programmatically modifying all the fields available under Available Data.
Parameters
Param | Type | Description |
$available_data | Array | Array of arrays with current fields and data under Available Data. |
Usage
add_filter( 'wp_all_export_available_data', 'wpae_available_data', 10, 1 );
function wpae_available_data( $available_data ) {
return $available_data;
}
Search the docs for wp_all_export_available_data
to see real-world code snippets that use this hook.
wp_all_export_disable_acf
Description
This filter allows programmatically disabling the ACF section from under Available Data.
Parameters
Param | Type | Description |
$disable_acf | bool | Whether to disable the ACF section or not. Default: false . |
Usage
add_filter( 'wp_all_export_disable_acf', 'wpae_disable_acf', 10, 1 );
function wpae_disable_acf( $disable_acf ) {
return $disable_acf;
}
Search the docs for wp_all_export_disable_acf
to see real-world code snippets that use this hook.
wp_all_export_add_before_node
Description
This filter allows adding additional information before each node. This only applies to XML exports.
Parameters
Param | Type | Description |
$add_data | array | Array where you can add new data, empty by default. |
$options | array | Export options array containing the export's configuration. |
$export_id | int | The export ID. |
$pid | int | The post ID. |
Usage
add_filter('wp_all_export_add_before_node', 'wpae_add_before_node', 10, 4);
function wpae_add_before_node( $add_data, $options, $export_id, $pid ) {
if ( $export_id == 30 ) {
$add_data['created_at'] = date("Y-m-d H:i:s");
}
return $add_data;
}
Search the docs for wp_all_export_add_before_node
to see real-world code snippets that use this hook.
wp_all_export_add_after_node
Description
This filter allows adding additional information after each node. This only applies to XML exports.
Parameters
Param | Type | Description |
$add_data | array | Array where you can add new data, empty by default. |
$options | array | Export options array containing the export's configuration. |
$export_id | int | The export ID. |
$pid | int | The post ID. |
Usage
add_filter('wp_all_export_add_after_node', 'wpae_add_after_node', 10, 4);
function wpae_add_after_node( $add_data, $options, $export_id, $pid ) {
if ( $export_id == 30 ) {
$add_data['created_at'] = date("Y-m-d H:i:s");
}
return $add_data;
}
Search the docs for wp_all_export_add_after_node
to see real-world code snippets that use this hook.
pmxe_manage_imports_columns
Description
This filter allows programmatically changing the columns available in All Export › Manage Exports.
Parameters
Param | Type | Description |
$columns | array | Array with current columns. |
Usage
add_filter( 'pmxe_manage_imports_columns', 'wpae_manage_columns', 10, 1 );
function wpae_manage_columns( $columns ) {
return $columns;
}
Search the docs for pmxe_manage_imports_columns
to see real-world code snippets that use this hook.
pmxe_manage_imports_column
Description
This action fires where the columns are added and allows adding custom columns to WP All Export.
Parameters
Param | Type | Description |
$column_id | string | Column identifier. |
$item | array | Array with current settings for imports. |
Usage
add_action( 'pmxe_manage_imports_column', 'wpae_manage_column', 10, 2 );
function wpae_manage_column( $column_id, $item ) {
//Do something with the column data
}
Search the docs for pmxe_manage_imports_column
to see real-world code snippets that use this hook.
pmxe_csv_value
Description
This filter passes all the data to write to CSV as an array before it’s sanitized. This filter should always provide one line at a time as the value. Sometimes that will be the header row, and sometimes it will be a data row.
Parameters
Param | Type | Description |
$value | string | Current data value to export. |
Usage
add_filter( 'pmxe_csv_value', 'wpae_csv_value', 10, 1 );
function wpae_csv_value( $value ) {
return $value;
}
Search the docs for pmxe_csv_value
to see real-world code snippets that use this hook.
pmxe_price
Description
This filter allows modifying the WooCommerce price during export.
Parameters
Param | Type | Description |
$price | int | Current price value to export. |
Usage
add_filter( 'pmxe_price', 'wpae_price', 10, 1 );
function wpae_price( $price ) {
return $price;
}
Search the docs for pmxe_price
to see real-world code snippets that use this hook.
pmxe_term_id
Description
This filter allows modifying any taxonomy term ID during export.
Parameters
Param | Type | Description |
$term | int | string | The current term. |
$id | int | The term ID. |
Usage
add_filter( 'pmxe_term_id', 'wpae_term_id', 10, 2 );
function wpae_term_id( $term, $id ) {
return $term;
}
Search the docs for pmxe_term_id
to see real-world code snippets that use this hook.
pmxe_term_name
Description
This filter allows modifying any taxonomy term name during export.
Parameters
Param | Type | Description |
$term | string | The current term. |
$id | int | The term ID. |
Usage
add_filter( 'pmxe_term_name', 'wpae_term_name', 10, 2 );
function wpae_term_name( $term, $id ) {
return $term;
}
Search the docs for pmxe_term_name
to see real-world code snippets that use this hook.
pmxe_term_permalink
Description
This filter allows modifying or using the taxonomy term permalink during export.
Parameters
Param | Type | Description |
$permalink | string | The current term permalink. |
$id | int | The term ID. |
Usage
add_filter( 'pmxe_term_permalink', 'wpae_term_permalink', 10, 2 );
function wpae_term_permalink( $permalink, $id ) {
return $permalink;
}
Search the docs for pmxe_term_permalink
to see real-world code snippets that use this hook.
pmxe_term_slug
Description
This filter allows modifying or using the taxonomy term slug during export.
Parameters
Param | Type | Description |
$slug | string | The current term slug. |
$id | int | The term ID. |
Usage
add_filter( 'pmxe_term_slug', 'wpae_term_slug', 10, 2 );
function wpae_term_slug( $slug, $id ) {
return $slug;
}
Search the docs for pmxe_term_slug
to see real-world code snippets that use this hook.
pmxe_term_description
Description
This filter allows modifying or using the taxonomy term description during export.
Parameters
Param | Type | Description |
$description | string | The current term description. |
$id | int | The term ID. |
Usage
add_filter( 'pmxe_term_description', 'wpae_term_description', 10, 2 );
function wpae_term_description( $description, $id ) {
return $description;
}
Search the docs for pmxe_term_description
to see real-world code snippets that use this hook.
pmxe_term_parent
Description
This filter allows modifying or using the taxonomy term parent during export.
Parameters
Param | Type | Description |
$parent | int | The current term parent ID. |
$id | int | The term ID. |
Usage
add_filter( 'pmxe_term_parent', 'wpae_term_parent', 10, 2 );
function wpae_term_parent( $parent, $id ) {
return $parent;
}
Search the docs for pmxe_term_parent
to see real-world code snippets that use this hook.
pmxe_sql_field
Description
This filter allows modifying the value exported by an SQL field in WP All Export.
Parameters
Param | Type | Description |
$value | string | The current value for the field. |
$field_name | string | The name of the field. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_sql_field', 'wpae_sql_field', 10, 3);
function wpae_sql_field( $value, $field_name, $pid ) {
return $value;
}
Search the docs for pmxe_sql_field
to see real-world code snippets that use this hook.
pmxe_comment_id
Description
This filter allows modifying the comment ID value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current value for the field. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_id', 'wpae_comment_id', 10, 2);
function wpae_comment_id( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_id
to see real-world code snippets that use this hook.
pmxe_comment_post_id
Description
This filter allows modifying the comment post ID value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current post ID for the comment. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_post_id', 'wpae_comment_post_id', 10, 2);
function wpae_comment_post_id( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_post_id
to see real-world code snippets that use this hook.
pmxe_comment_author
Description
This filter allows modifying the comment author value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current author value for the comment. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_author', 'wpae_comment_author', 10, 2);
function wpae_comment_author( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_author
to see real-world code snippets that use this hook.
pmxe_comment_author_email
Description
This filter allows modifying the comment author email value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | string | The current author email value for the comment. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_author_email', 'wpae_comment_author_email', 10, 2);
function wpae_comment_author_email( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_author_email
to see real-world code snippets that use this hook.
pmxe_comment_author_url
Description
This filter allows modifying the comment author URL value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | string | The current author's URL value for the comment. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_author_url', 'wpae_comment_author_url', 10, 2);
function wpae_comment_author_url( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_author_url
to see real-world code snippets that use this hook.
pmxe_comment_author_ip
Description
This filter allows modifying the comment author's IP value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current comment author's IP value. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_author_ip', 'wpae_comment_author_ip', 10, 2);
function wpae_comment_author_ip( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_author_ip
to see real-world code snippets that use this hook.
pmxe_comment_karma
Description
This filter allows modifying the comment's karma value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current comment's karma value. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_karma', 'wpae_comment_karma', 10, 2);
function wpae_comment_karma( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_karma
to see real-world code snippets that use this hook.
pmxe_comment_content
Description
This filter allows modifying the comment's content value when exported in WP All Export.
Parameters
Param | Type | Description |
$value | string | The current comment's content value. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_content', 'wpae_comment_content', 10, 2);
function wpae_comment_content( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_content
to see real-world code snippets that use this hook.
pmxe_comment_date
Description
This filter allows modifying the comment's date when exported in WP All Export.
Parameters
Param | Type | Description |
$value | string | The current comment's date. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_date', 'wpae_comment_date', 10, 2);
function wpae_comment_date( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_date
to see real-world code snippets that use this hook.
pmxe_comment_approved
Description
This filter allows modifying the comment approved status when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current comment's approved status |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_approved', 'wpae_comment_approved', 10, 2);
function wpae_comment_approved( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_approved
to see real-world code snippets that use this hook.
pmxe_comment_agent
Description
This filter allows modifying the comment's agent data when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current comment's agent data. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_agent', 'wpae_comment_agent', 10, 2);
function wpae_comment_agent( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_agent
to see real-world code snippets that use this hook.
pmxe_comment_type
Description
This filter allows modifying the comment's type when exported in WP All Export.
Parameters
Param | Type | Description |
$value | string | The current comment's type. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_type', 'wpae_comment_type', 10, 2);
function wpae_comment_type( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_type
to see real-world code snippets that use this hook.
pmxe_comment_parent
Description
This filter allows modifying the comment's parent data when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current comment's parent data. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_parent', 'wpae_comment_parent', 10, 2);
function wpae_comment_parent( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_parent
to see real-world code snippets that use this hook.
pmxe_comment_status
Description
This filter allows modifying the comment's status when exported in WP All Export.
Parameters
Param | Type | Description |
$value | string | The current comment status. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_comment_status', 'wpae_comment_status', 10, 2);
function wpae_comment_status( $value, $cid ) {
return $value;
}
Search the docs for pmxe_comment_status
to see real-world code snippets that use this hook.
pmxe_user_id
Description
This filter allows modifying the comment's author user ID when exported in WP All Export.
Parameters
Param | Type | Description |
$value | int | The current comment's author user ID. |
$cid | int | Current comment ID. |
Usage
add_filter('pmxe_user_id', 'wpae_user_id', 10, 2);
function wpae_user_id( $value, $cid ) {
return $value;
}
Search the docs for pmxe_user_id
to see real-world code snippets that use this hook.
pmxe_post_id
Description
This filter allows modifying the record's post ID when exporting in WP All Export.
Parameters
Param | Type | Description |
$value | int | Current record's post ID. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_id', 'wpae_post_id', 10, 2);
function wpae_post_id( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_id
to see real-world code snippets that use this hook.
pmxe_post_guid
Description
This filter allows modifying the record's permalink when exporting in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current record's permalink. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_guid', 'wpae_post_guid', 10, 2);
function wpae_post_guid( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_guid
to see real-world code snippets that use this hook.
pmxe_post_type
Description
This filter allows modifying the record's post type when exporting in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current record's post type. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_type', 'wpae_post_type', 10, 2);
function wpae_post_type( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_type
to see real-world code snippets that use this hook.
pmxe_post_title
Description
This filter allows modifying the post's title when exporting in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post title. |
Usage
add_filter('pmxe_post_title', 'wpae_post_title', 10, 1);
function wpae_post_title( $value ) {
return $value;
}
Search the docs for pmxe_post_title
to see real-world code snippets that use this hook.
pmxe_post_content
Description
This filter allows modifying the post's content when exporting in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post content. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_content', 'wpae_post_content', 10, 2);
function wpae_post_content( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_content
to see real-world code snippets that use this hook.
pmxe_post_date
Description
This filter allows modifying the post's date when exporting in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post date. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_date', 'wpae_post_date', 10, 2);
function wpae_post_date( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_date
to see real-world code snippets that use this hook.
pmxe_post_modified_date
Description
This filter allows modifying the post's modified date when exporting in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post modified date. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_modified_date', 'wpae_post_modified_date', 10, 2);
function wpae_post_modified_date( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_modified_date
to see real-world code snippets that use this hook.
pmxe_post_parent
Description
This filter allows modifying the post's parent ID when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | int | Current post parent ID. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_parent', 'wpae_post_parent', 10, 2);
function wpae_post_parent( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_parent
to see real-world code snippets that use this hook.
pmxe_post_parent_slug
Description
This filter allows modifying the post's parent slug when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post parent slug. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_parent_slug', 'wpae_post_parent_slug', 10, 2);
function wpae_post_parent_slug( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_parent_slug
to see real-world code snippets that use this hook.
pmxe_ping_status
Description
This filter allows modifying the post's ping status when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post's ping status. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_ping_status', 'wpae_ping_status', 10, 2);
function wpae_ping_status( $value, $pid ) {
return $value;
}
Search the docs for pmxe_ping_status
to see real-world code snippets that use this hook.
pmxe_post_template
Description
This filter allows modifying the post template when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post template. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_template', 'wpae_post_template', 10, 2);
function wpae_post_template( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_template
to see real-world code snippets that use this hook.
pmxe_menu_order
Description
This filter allows modifying the post's menu order when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | int | Current menu order. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_menu_order', 'wpae_menu_order', 10, 2);
function wpae_menu_order( $value, $pid ) {
return $value;
}
Search the docs for pmxe_menu_order
to see real-world code snippets that use this hook.
pmxe_post_status
Description
This filter allows modifying the post status when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post status. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_status', 'wpae_post_status', 10, 2);
function wpae_post_status( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_status
to see real-world code snippets that use this hook.
pmxe_post_format
Description
This filter allows modifying the post format when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post format. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_format', 'wpae_post_format', 10, 2);
function wpae_post_format( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_format
to see real-world code snippets that use this hook.
pmxe_post_author
Description
This filter allows modifying the post author ID when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post author ID. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_author', 'wpae_post_author', 10, 2);
function wpae_post_author( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_author
to see real-world code snippets that use this hook.
pmxe_post_slug
Description
This filter allows modifying the post slug when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post slug. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_slug', 'wpae_post_slug', 10, 2);
function wpae_post_slug( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_slug
to see real-world code snippets that use this hook.
pmxe_post_excerpt
Description
This filter allows modifying the post's excerpt when exporting posts in WP All Export.
Parameters
Param | Type | Description |
$value | string | Current post excerpt. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_excerpt', 'wpae_post_excerpt', 10, 2);
function wpae_post_excerpt( $value, $pid ) {
return $value;
}
Search the docs for pmxe_post_excerpt
to see real-world code snippets that use this hook.
pmxe_woo_attribute
Description
This filter allows modifying WooCommerce attribute data when exporting products in WP All Export.
Parameters
Param | Type | Description |
$atts | string | Current attribute value. Multiple attributes separated by |. |
$pid | int | Current post ID. |
$att_name | string | Current attribute name. |
Usage
add_filter('pmxe_woo_attribute', 'wpae_woo_attribute', 10, 3);
function wpae_woo_attribute( $name, $pid, $value ) {
return $value;
}
Search the docs for pmxe_woo_attribute
to see real-world code snippets that use this hook.
pmxe_post_taxonomy
Description
This filter allows modifying the exported post taxonomies when exporting records in WP All Export. Fires individually for each taxonomy term.
Parameters
Param | Type | Description |
$taxonomies | string | Current taxonomy from the record exported. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_post_taxonomy', 'wpae_post_taxonomy', 10, 3);
function wpae_post_taxonomy( $taxonomies, $pid ) {
return $taxonomies;
}
Search the docs for pmxe_post_taxonomy
to see real-world code snippets that use this hook.
pmxe_trid_field
Description
This filter allows modifying the exported language data from WPML when exporting in WP All Export.
Parameters
Param | Type | Description |
$language_code | string | Current language code. |
$element_name | int | Current element name. |
$pid | int | Current post ID. |
Usage
add_filter('pmxe_trid_field', 'wpae_trid_field', 10, 3);
function wpae_trid_field( $language_code, $element_name, $pid ) {
return $language_code;
}
Search the docs for pmxe_trid_field
to see real-world code snippets that use this hook.
pmxi_before_post_import_{$addon}
Description
Same as pmxi_before_post_import, but this action fires for each specific add-on that's configured to run. The {$addon} part must be whatever is defined as the $slug in the add-on. The add-on must be using the Rapid Add-On API, or the data won't show up with this action (it will be blank).
Parameters
Param | Type | Description |
$data | array | What was provided by the given add-on for that record |
$i | int | Internal identifier to determine which part of the data is used for the currently imported record. |
$import_id | int | The import ID in question. |
Usage
function my_before_post_import_example( $data, $i, $import_id ) {
// Only run for import ID 5.
if ($import_id == '5') {
// Do something.
// error_log(print_r($data, true));
}
}
add_action('pmxi_before_post_import_my_awesome_addon', 'my_before_post_import_example', 10, 3);
Search the docs for pmxi_before_post_import_{$addon}
to see real-world code snippets that use this filter.
wp_all_import_acf_field_class
Description
This filter can be used to load a custom class for a custom ACF field type. It's used when calling the class and a matching field is found.
Parameters
Param | Type | Description |
$class | string | Fully qualified class name. |
$fieldData | array | Array with all of the ACF field information. |
$post | array | Array with all of the post's information. |
$fieldName | string | Field name. |
$fieldParent | string | Field parent. |
Usage
function wpai_acf_field_class( $class, $fieldData, $post, $fieldName, $fieldParent ) {
//Do something with the class
return $class;
}
add_filter( 'wp_all_import_acf_field_class', 'wpai_acf_field_class', 10, 5 );
Search the docs for wp_all_import_acf_field_class
to see real-world code snippets that use this hook.
wp_all_import_acf_field_field
Description
This filter can be used to load a custom field object for a custom ACF field type. This can be used to return your custom field object if you don't want to use the default class loading behavior.
Parameters
Param | Type | Description |
$field | object | Custom field object to load. |
$class | string | Fully qualified class name. |
$fieldData | array | Array with all of the ACF field information. |
$post | array | Array with all of the post's information. |
$fieldName | string | Field name. |
$fieldParent | string | Field parent. |
Usage
function wpai_acf_field_field( $field, $class, $fieldData, $post, $fieldName, $fieldParent ) {
//Do something with the field
return $field;
}
add_filter( 'wp_all_import_acf_field_field', 'wpai_acf_field_field', 10, 6 );
Search the docs for wp_all_import_acf_field_field
to see real-world code snippets that use this hook.
wp_all_import_acf_field_view_dir
Description
This filter can be used to modify the field view directory for an ACF field type. This controls the header and footer shown.
Parameters
Param | Type | Description |
$fieldDir | string | Current field view directory. |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_view_dir( $fieldDir, $this ) {
//Do something with the field dir
return $fieldDir;
}
add_filter( 'wp_all_import_acf_field_view_dir', 'wpai_acf_field_view_dir', 10, 2 );
Search the docs for wp_all_import_acf_field_view_dir
to see real-world code snippets that use this hook.
wp_all_import_acf_field_view_dir_{field_type}
Description
This filter can be used to specify the location of the header and footer used for custom ACF field types that have ACF v4 and v5 versions. The {field_type} part has to be changed to your actual field slug.
Parameters
Param | Type | Description |
$fieldDir | string | Current field view directory. |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_view_dir_field_type( $fieldDir, $this ) {
//Do something with the field dir
return $fieldDir;
}
add_filter( 'wp_all_import_acf_field_view_dir_field_type', 'wpai_acf_field_view_dir_field_type', 10, 2 );
Search the docs for wp_all_import_acf_field_view_dir_{field_type}
to see real-world code snippets that use this hook.
wp_all_import_acf_field_view_path
Description
This filter can be used to modify the path to the view files for ACF field types.
Parameters
Param | Type | Description |
$filePath | string | Current view to display between the header and footer. |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_view_path( $filePath, $this ) {
//Do something with the field dir
return $filePath;
}
add_filter( 'wp_all_import_acf_field_view_path', 'wpai_acf_field_view_path', 10, 2 );
Search the docs for wp_all_import_acf_field_view_path
to see real-world code snippets that use this hook.
wp_all_import_acf_field_view_path_{field_type}
Description
This filter can be used to modify the path to the view file for a custom ACF field type. Whatever path is returned will be added via 'include' between the header and footer from the view dir. The {field_type} part has to be changed to your actual field slug.
Parameters
Param | Type | Description |
$filePath | string | Current view to display between the header and footer. |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_view_path_field_type( $filePath, $this ) {
//Do something with the field dir
return $filePath;
}
add_filter( 'wp_all_import_acf_field_view_path_field_type', 'wpai_acf_field_view_path_field_type', 10, 2 );
Search the docs for wp_all_import_acf_field_view_path_{field_type}
to see real-world code snippets that use this hook.
wp_all_import_acf_field_template_header_path
Description
This filter is used to control the default header that appears for an ACF field type.
Parameters
Param | Type | Description |
$filePath | string | Current location of the header.php file |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_template_header_path( $filePath, $this ) {
//Do something with the field dir
return $filePath;
}
add_filter( 'wp_all_import_acf_field_template_header_path', 'wpai_acf_field_template_header_path', 10, 2 );
Search the docs for wp_all_import_acf_field_template_header_path
to see real-world code snippets that use this hook.
wp_all_import_acf_field_template_footer_path
Description
This filter is used to control the default footer that appears for an ACF field type.
Parameters
Param | Type | Description |
$filePath | string | Current location of the footer.php file. |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_template_footer_path( $filePath, $this ) {
//Do something with the field dir
return $filePath;
}
add_filter( 'wp_all_import_acf_field_template_footer_path', 'wpai_acf_field_template_footer_path', 10, 2 );
Search the docs for wp_all_import_acf_field_template_footer_path
to see real-world code snippets that use this hook.
wp_all_import_acf_field_template_header_path{field_type}
Description
This filter is used to control the header that appears before the version-specific header used by default. Only needed when the default header doesn't meet your requirements. The {field_type} part has to be changed to your actual field slug.
Parameters
Param | Type | Description |
$filePath | string | Current location of the header.php file |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_template_header_path_field_type( $filePath, $this ) {
//Do something with the field dir
return $filePath;
}
add_filter( 'wp_all_import_acf_field_template_header_pathfield_type', 'wpai_acf_field_template_header_path_field_type', 10, 2 );
Search the docs for wp_all_import_acf_field_template_header_path{field_type}
to see real-world code snippets that use this hook.
wp_all_import_acf_field_template_footer_path{field_type}
Description
This filter is used to control the footer that appears after the version-specific footer used by default. Only needed when the default footer doesn't meet your requirements. The {field_type} part has to be changed to your actual field slug.
Parameters
Param | Type | Description |
$filePath | string | Current location of the footer.php file. |
$this | object | Reference to the current field object. |
Usage
function wpai_acf_field_template_footer_path_field_type( $filePath, $this ) {
//Do something with the file path
return $filePath;
}
add_filter( 'wp_all_import_acf_field_template_footer_pathfield_type', 'wpai_acf_field_template_footer_path_field_type', 10, 2 );
Search the docs for wp_all_import_acf_field_template_footer_path{field_type}
to see real-world code snippets that use this hook.
wp_all_import_is_post_to_change_missing
Description
This fires when a change missing post is about to be changed. Similar to the wp_all_import_is_post_to_delete filter except this filter controls if the various 'change missing' actions fire or not. The 'delete' filter is limited to only full deletions.
Parameters
Param | Type | Description |
$is_post_to_change | bool | Change post? true / false. |
$post_id | int | The post ID that's about to be deleted. |
$import | object | The import object. |
Usage
function my_is_post_to_change( $is_post_to_change, $post_id, $import ) {
// Unless you want this code to execute for every import, check the import id
// if ( $import->id == 5 ) { ... }
return $is_post_to_change;
}
add_filter( 'wp_all_import_is_post_to_change_missing', 'my_is_post_to_change', 10, 3 );
Search the docs for wp_all_import_is_post_to_change_missing
to see real-world code snippets that use this hook.
Related Docs
Example code snippets that are available to use with WP All Import and WP All Export.
Learn how to import any file into WordPress using WP All Import.
Shows you how to add support for your theme or plugin by creating an add-on.