Make WordPress Core

Ticket #48180: extend_export_with_filter_for_join_and_where_clause.patch

File extend_export_with_filter_for_join_and_where_clause.patch, 888 bytes (added by mgleich, 5 years ago)

Patch to insert two lines with filters

  • wp-admin/includes/export.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    123123                }
    124124        }
    125125
     126        $join = apply_filters('export_filter_join', $join, $args);
     127
    126128        if ( 'post' == $args['content'] || 'page' == $args['content'] || 'attachment' == $args['content'] ) {
    127129                if ( $args['author'] ) {
    128130                        $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] );
     
    137139                }
    138140        }
    139141
     142    $where = apply_filters('export_filter_where', $where, $args);
     143
    140144        // Grab a snapshot of post IDs, just in case it changes during the export.
    141145        $post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
    142146