]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/export.php
WordPress 3.9.1-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / export.php
index 91d88a18abe5b9f8ff330319f75558e12b653c22..162e00721e8ca79931a6b3bf0a9a0dfdb6092cc7 100644 (file)
@@ -30,7 +30,14 @@ function export_wp( $args = array() ) {
        );
        $args = wp_parse_args( $args, $defaults );
 
        );
        $args = wp_parse_args( $args, $defaults );
 
-       do_action( 'export_wp' );
+       /**
+        * Fires at the beginning of an export, before any headers are sent.
+        *
+        * @since 2.3.0
+        *
+        * @param array $args An array of export arguments.
+        */
+       do_action( 'export_wp', $args );
 
        $sitename = sanitize_key( get_bloginfo( 'name' ) );
        if ( ! empty($sitename) ) $sitename .= '.';
 
        $sitename = sanitize_key( get_bloginfo( 'name' ) );
        if ( ! empty($sitename) ) $sitename .= '.';
@@ -350,7 +357,10 @@ function export_wp( $args = array() ) {
 <?php endforeach; ?>
 <?php if ( 'all' == $args['content'] ) wxr_nav_menu_terms(); ?>
 
 <?php endforeach; ?>
 <?php if ( 'all' == $args['content'] ) wxr_nav_menu_terms(); ?>
 
-       <?php do_action( 'rss2_head' ); ?>
+       <?php
+       /** This action is documented in wp-includes/feed-rss2.php */
+       do_action( 'rss2_head' );
+       ?>
 
 <?php if ( $post_ids ) {
        global $wp_query;
 
 <?php if ( $post_ids ) {
        global $wp_query;
@@ -374,8 +384,26 @@ function export_wp( $args = array() ) {
                <dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
                <guid isPermaLink="false"><?php the_guid(); ?></guid>
                <description></description>
                <dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
                <guid isPermaLink="false"><?php the_guid(); ?></guid>
                <description></description>
-               <content:encoded><?php echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) ); ?></content:encoded>
-               <excerpt:encoded><?php echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) ); ?></excerpt:encoded>
+               <content:encoded><?php
+                       /**
+                        * Filter the post content used for WXR exports.
+                        *
+                        * @since 2.5.0
+                        *
+                        * @param string $post_content Content of the current post.
+                        */
+                       echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
+               ?></content:encoded>
+               <excerpt:encoded><?php
+                       /**
+                        * Filter the post excerpt used for WXR exports.
+                        *
+                        * @since 2.6.0
+                        *
+                        * @param string $post_excerpt Excerpt for the current post.
+                        */
+                       echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
+               ?></excerpt:encoded>
                <wp:post_id><?php echo $post->ID; ?></wp:post_id>
                <wp:post_date><?php echo $post->post_date; ?></wp:post_date>
                <wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
                <wp:post_id><?php echo $post->ID; ?></wp:post_id>
                <wp:post_date><?php echo $post->post_date; ?></wp:post_date>
                <wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
@@ -394,6 +422,18 @@ function export_wp( $args = array() ) {
 <?php  wxr_post_taxonomy(); ?>
 <?php  $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
                foreach ( $postmeta as $meta ) :
 <?php  wxr_post_taxonomy(); ?>
 <?php  $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
                foreach ( $postmeta as $meta ) :
+                       /**
+                        * Filter whether to selectively skip post meta used for WXR exports.
+                        *
+                        * Returning a truthy value to the filter will skip the current meta
+                        * object from being exported.
+                        *
+                        * @since 3.3.0
+                        *
+                        * @param bool   $skip     Whether to skip the current post meta. Default false.
+                        * @param string $meta_key Current meta key.
+                        * @param object $meta     Current meta object.
+                        */
                        if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) )
                                continue;
                ?>
                        if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) )
                                continue;
                ?>