Using WordPress ‘load-importer-{$importer}’ PHP action

The load-importer-{$importer} WordPress PHP action fires before an importer screen is loaded, where the dynamic portion of the hook name, $importer, refers to the importer slug.

Usage

add_action('load-importer-{$importer}', 'your_custom_function');
function your_custom_function() {
    // your custom code here
}

Parameters

None

More information

See WordPress Developer Resources: load-importer-{$importer}

Examples

Add custom code before Blogger importer screen loads

add_action('load-importer-blogger', 'before_blogger_importer');
function before_blogger_importer() {
    // Add custom code to run before Blogger importer screen loads
}

Add custom code before WordPress importer screen loads

add_action('load-importer-wordpress', 'before_wordpress_importer');
function before_wordpress_importer() {
    // Add custom code to run before WordPress importer screen loads
}

Add custom code before RSS importer screen loads

add_action('load-importer-rss', 'before_rss_importer');
function before_rss_importer() {
    // Add custom code to run before RSS importer screen loads
}

Add custom code before LiveJournal importer screen loads

add_action('load-importer-livejournal', 'before_livejournal_importer');
function before_livejournal_importer() {
    // Add custom code to run before LiveJournal importer screen loads
}

Add custom code before Tumblr importer screen loads

add_action('load-importer-tumblr', 'before_tumblr_importer');
function before_tumblr_importer() {
    // Add custom code to run before Tumblr importer screen loads
}

Tagged in

Leave a Comment

Your email address will not be published. Required fields are marked *