If you are trying to fire your function when the WordPress Importer runs, there are a few filters and action hooks available.
From the plugin documentation:
import_start
: occurs after the export file has been uploaded and author import settings have been chosen
import_end
: called after the last output from the importer
Related Posts:
- What hook should be used to programmatically create a post only when master post is updated?
- How to store additional data that is related to core data
- Add a post when another post type is inserting
- Should I use custom post types or a custom database tables for plugin development?
- Hook for post and page load
- How to enqueue scripts on custom post add/edit pages?
- Where are wordpress custom types stored?
- How do you use a CPT as the default home page?
- Delete all posts of a custom post type—efficiently
- Calling a Function After New Post Creation for a WordPress Custom Post Type?
- How to Debug the ‘save_post’ Action?
- Custom Post Types, or completely custom?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- Get post ID from wp_insert_post()
- WP insert post and custom taxonomy
- get_query_var() not working in pre_get_posts
- Unregister post type from child theme
- Filter for “get_post_type_archive_link()”
- How to add a button to custom post type’s posts-page
- How to hook into the CPT’s title placeholder?
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- Custom Post Type with Input fields to seperate table on database.
- Right way of storing large number of custom post fields
- How to use custom database tables for custom post types?
- How do I programmatically add items of content to a custom post type?
- Why get_next_post_link() or get_previous_post_link() doesn’t return the required links?
- Admin Post Update Redirection to Posts Screen
- How often do you need to register_post_type?
- Not Able to Insert Taxonomy Term Using wp_insert_post()
- How to create notification on frontend using heartbeat api for multiple custom post types
- Custom Post Type or Custom Tables
- How to set a custom post type post as static front page?
- With what hook can I address all posts from all custom post types when they are published?
- Custom post type or just use custom fields
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- How I upload, save and set a featured image from my frontend?
- Create Pages from Database
- Hook when adding or editing a specific custom post type? [closed]
- Use Custom Database with Custom Post Type
- Custom Search | Wrong output & question
- Trying to save custom post type from frontend partially working
- How do I write this SQL statement for Posts written in last 24 hours?
- remove_action conditionally for Custom Post Type
- wp_insert_post custom taxonomy
- Assign category to front end post
- Save or update data when custom post published
- Custom post type Vs. data in own table
- How can I programmatically save data into custom fields that contain serialized data?
- Save custom post type in different table
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Using posts and postmeta table to store custom Address Book Plugin data
- How to register custom post types in a plugin?
- Add information above a custom post type listing of all posts page
- How to use custom post type APIs, but use a different db table
- Remove “Get Shortlink” button in admin of custom post type
- WordPress tax_input only if logged in
- Programmatically adding posts
- Developing WordPress on Kubernetes
- Recommended custom post type structure for TV Schedule site?
- Custom Blog Post Listing in Genesis Sample Child Theme
- Set a default category – if the user didn’t select one- before creating a post
- Is it possible to create a post using a metabox?
- Can’t unregister parent theme’s CPT from my child theme
- Modifying date filter on admin page for custom post type to link to custom field
- WordPress post count not showing for custom post type author
- Where to store custom tagging data associated with a custom post type
- How Can I Set the Post Author of a Post I Just Created With PHP?
- How to auto increment post title & post slug field?
- Auto-generated posts not showing in backend (but being counted!)
- wpdb custom post_type problem
- Adding custom tables to WordPress
- Hooking in to an archive page?
- Add custom column in custom post type edit page
- WP All Import – Using Xpath to set a select value
- Insert Multiple Post with Same Publish Button
- wp_insert_post generates endless posts
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- Validate custom fields before save using WordPress Rest API
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Sorting custom post type columns with external data and without meta values
- Posts are duplicating on wp_post_update
- create parent post using wp_insert_post
- How to use custom taxonomies to reference complex relationships?
- Create a clone from one WordPress site to another in a few minutes
- Cron job for creating posts not excecuting properly
- Database to page routing API?
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- How to checked selected category checkbox when my custom post inserted from frontend
- Limit number of custom posts per taxonomy
- How to change wp prefix for custom post type only?
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Add update or delete database records using custom post type
- How to import a custom MySQL DB table into a WordPress custom post type
- Filter Posts from the Main Query
- WP_Query orderby and tax_query
- Post author for revision not being set on update/insert
- Add CPT values to Database
- Importing Data from a Non-WordPress database, into WP
- How to organise this data within WordPress
- Organize WordPress site, so it can maintain with huge database