WP-CLI Not Exporting xml data Issue with Elementor Header & Footer plugin
-
I’m encountering an issue with the Elementor Header & Footer Builder plugin when using WP-CLI to export custom post types. The
elementor-hf
custom post type does not appear in WP-CLI exports, while it is accessible through the standard WordPress export functionality.
List all post-types using – wp post-type list
Export Elementor Header & Footer templates in xml file – wp export –post_type=elementor-hf
Steps Taken:- Plugin Initialization: Confirmed that the plugin is active and initialized properly. The custom post type should be registered in the
init
hook. - Testing Custom Registration: I added the following code to my theme’s
functions.php
file to manually register the custom post type when WP-CLI is detected:
add_action('init', function() {
if ( defined( 'WP_CLI' ) && WP_CLI ) {
register_post_type('elementor-hf', array(
'label' => 'Header Footer',
'public' => true,
'show_in_rest' => true,
'supports' => array('title', 'editor', 'thumbnail'),
'has_archive' => false,
'rewrite' => array('slug' => 'elementor-hf'),
));
}
});3. Long-term Concerns: While the above code works, it’s not an ideal long-term solution for theme updates or changes. I want to ensure that the plugin registers its custom post types properly in the WP-CLI environment without needing to override or manually register them.
Request for Assistance:- Can you provide insights into how the Elementor Header & Footer Builder plugin handles custom post type registration in CLI environments?
- Is there a recommended way to ensure that the
elementor-hf
post type is consistently available when using WP-CLI, perhaps through a filter or action that ensures it gets registered regardless of the environment? - If there are known issues with WP-CLI compatibility, could you advise on any workarounds?
SS – https://prnt.sc/8Pgwe_8i35xi
Thank you for your assistance!
The page I need help with: [log in to see the link]
- Plugin Initialization: Confirmed that the plugin is active and initialized properly. The custom post type should be registered in the
- You must be logged in to reply to this topic.