Make WordPress Core

Opened 4 weeks ago

Last modified 3 weeks ago

#61244 new defect (bug)

The export_wp() function inserts empty <wp:comment> data when get_comment() returns a false or empty value

Reported by: wpexplorer's profile WPExplorer Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: trunk
Component: Export Keywords: has-patch
Focuses: administration Cc:

Description

If you wish to exclude comments from the WordPress export you can use the following code:

add_action( 'export_wp', function() {
    add_filter( 'get_comment', '__return_false' );
} );

However, the function will still loop through empty values for the $comments array inserting unnecessary <wp:comment> items.

Change History (2)

This ticket was mentioned in PR #6574 on WordPress/wordpress-develop by @WPExplorer.


4 weeks ago
#1

  • Keywords has-patch added

If you wish to exclude comments from the WordPress export you can use the following code:

add_action( 'export_wp', function() {
    add_filter( 'get_comment', '__return_false' );
} );

However, the function will still loop through empty values for the $comments array inserting unnecessary <wp:comment> items.

#2 @freewebmentor
3 weeks ago

  • Focuses administration added

Hi @wpexplorer! 👋

Thank you for your contribution to WordPress! 💖

Note: See TracTickets for help on using tickets.