Make WordPress Core

Ticket #33591: feed-missing-length-bug.php

File feed-missing-length-bug.php, 1.2 KB (added by jonnybot, 9 years ago)
Line 
1<?php
2require( './wp-load.php' );
3
4$ids = array(15299,15194);
5foreach ( $ids as $id ) {
6        echo "Doing post ";
7        echo $id;
8        echo "<br>";
9        $custom_field = get_post_custom($id);
10        //echo "Custom fields: <br>";
11        //echo var_dump($custom_field);
12        foreach ( $custom_field as $key => $val ) {
13                if ($key == 'enclosure') {
14                        echo "Found an enclusre key.<br>";
15                        echo "Value: ";
16                        echo var_dump($val);
17                        echo "<br>";
18                        foreach ( (array) $val as $enc ) {
19                                $enclosure = explode("\n", $enc);
20                                echo "Enclosure key value: <br>";
21                                echo var_dump($enclosure);
22                                echo "<br>Bad link tag (look at the source):    ";
23                                echo '<link href="' . trim(  $enclosure[0]  ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" /> <br>"';
24                                /**
25                                 * Filter the atom enclosure HTML link tag for the current post.
26                                 *
27                                 * @since 2.2.0
28                                 *
29                                 * @param string $html_link_tag The HTML link tag with a URI and other attributes.
30                                 */
31                                //echo apply_filters( 'atom_enclosure', '<link href="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" />' . "\n" );
32                        }
33                }
34        }       
35        echo "<br><br><br>";
36}
37
38?>