Ok so looks like the dev for this plugin maybe too busy to fix these issue. So here’s the fix if anyone interested. I didn’t spend too much time on the media so no date range. Make sure you back up before any editing.
Menu and media fix. You will need to edit 3 files in the plugin include folder.
class-functions.php:
Find around line 50 add these two line below it
//Modified by Be4Real prepare nav menu item
$where = $wpdb->prepare( "{$wpdb->posts}.post_type = %s", 'nav_menu_item' );
// Modified by Be4Real -grab a snapshot of post IDs, just in case it changes during the export
$post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
find around line 384:
function wxr_nav_menu_terms() {
$nav_menus = wp_get_nav_menus();
if ( empty( $nav_menus ) || ! is_array( $nav_menus ) )
return;
foreach ( $nav_menus as $menu ) {
echo "\t<wp:term><wp:term_id>{$menu->term_id}</wp:term_id><wp:term_taxonomy>nav_menu</wp:term_taxonomy><wp:term_slug>{$menu->slug}</wp:term_slug>";
wxr_term_name( $menu );
echo "</wp:term>\n";
}
}
Add these below the last }.
//Modified by Be4Real
function wxr_nav_menu_item_terms_and_posts( &$post_ids ) {
$posts_to_add = array();
foreach( $post_ids as $post_id ) {
if( ($type = get_post_meta( $post_id, '_menu_item_type', true ) ) == 'taxonomy' ) {
$term = get_term( get_post_meta( $post_id, '_menu_item_object_id', true ), ($tax = get_post_meta( $post_id, '_menu_item_object', true )) );
echo "\t<wp:term><wp:term_id>{$term->term_id}</wp:term_id><wp:term_taxonomy>{$tax}</wp:term_taxonomy><wp:term_slug>{$term->slug}</wp:term_slug>";
wxr_term_name( $term );
echo "</wp:term>\n";
} elseif( $type == 'post_type' && in_array( get_post_meta( $post_id, '_menu_item_object', true ), array( 'post', 'page' ) ) ) {
$posts_to_add[] = get_post_meta( $post_id, '_menu_item_object_id', true );
}
}
$post_ids = array_merge( $posts_to_add, $post_ids );
}//End Mod
Find around line 471
<?php if ( in_array( 'menus', $args['content'] ) ) wxr_nav_menu_terms(); ?>
REPLACE with
<?php wxr_nav_menu_terms(); ?>
<?php wxr_nav_menu_item_terms_and_posts( $post_ids ) ?>
Class-export-plus.php
Find around line 163
if ( $_GET['post_status'] ) {
$args['status'] = $_GET['post_status'];
}
ADD below the last }.
//Modified by Be4Real for Media
if ( 'attachment' == $_GET['content'] ) {
$args['content'] = 'attachment';
}
export-template.php
Find around line 62
<p><label><input type="checkbox" name="content[]" value="menus" checked="checked" /> <?php _e( 'Menus', 'export-plus' ); ?></label></p>
REPLACE with these:
<p><label><input type="checkbox" name="content[]" value="nav_menu_item" checked="checked" /> <?php _e( 'Menus', 'export-plus' ); ?></label></p>
<p><label><input type="checkbox" name="content[]" value="attachment" checked="checked" /> <?php _e( 'Media', 'export-plus' ); ?></label></p>
That’s it. Enjoy
]]>although it was apparently updated 2 months ago this plugin doesn’t ‘see’ or recognize any posts or CPT’s with dates more recent than March 2017. Unusable.
]]>Creates the Menu NAME only on import with NO Menu Data –
]]>I had this working on a site before, now on that same site when I go to do the export I get a Invalid Response from Chrome.
]]>Hello
Fine ………….. BUT ………….. not enough
I would appreciate to have a more precise date to export as 08/19/2015 because in a month we do a lot of job and it’s usefull to put on line day by day the pages which are ok for the on line server
Cordialment
]]>Hi,
I thought this would export the menu items along with the menus but it seems to only export the menus.
Is this true or should I be getting the menu items of the menus as well from the export.
If not, then I wanted to request that.
There is only one other plugin I’ve found that export the menu items, but Pagely said it thrashes on the database, therefore shutting down a Pagely website so I’ve since left that plugin alone
]]>It just makes more sense to be able to export in the WordPress native way, but export specific content.
]]>It seems both this exporter and the default one suffer from this disease that they refuse to export attachments when one selects “posts”. One ends up with posts without featured images imported, bad situation.
]]>“Menus” is one of the options. This is the only thing that I wanted to export. When I ran it I got all of the users!!!!!! NO MENUS!
]]>What about a checkbox for exporting comments?
Sometimes one also wants to move over comments along with the posts to another site.
]]>G’day Hugh,
Loving the plugin, although I seem to be having trouble getting the featured image for posts. Is this something that should be exporting, or does the plugin exclude this when any export filter options are set (like the default WP export does)?
I had been using this plugin – https://www.ads-software.com/plugins/demomentsomtres-wp-export/ – to get featured images from posts within a date range, but if you were able to tie the functionality into your plugin, your plugin would be all I need.
]]>Hey
I noticed your post at https://make.www.ads-software.com/core/ and went to check out your plugin. It would be great if the plugin could also export the media library contents.
Have a great day!
]]>The date fields did not function and a 0kb export file was downloaded.
]]>