]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-links-opml.php
WordPress 3.7-scripts
[autoinstalls/wordpress.git] / wp-links-opml.php
index 069d7a5ff4222c51bbabe9b131e489ab7c2cdf53..b196f736da518a16f231e0b1f0c80bee477d3dfe 100644 (file)
  * @package WordPress
  */
 
  * @package WordPress
  */
 
-if ( empty($wp) ) {
-       require_once('./wp-load.php');
-       wp();
-}
+require_once( dirname( __FILE__ ) . '/wp-load.php' );
 
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 $link_cat = '';
 
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 $link_cat = '';
@@ -31,24 +28,45 @@ echo '<?xml version="1.0"?'.">\n";
        <head>
                <title><?php printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); ?></title>
                <dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated>
        <head>
                <title><?php printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); ?></title>
                <dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated>
-               <?php do_action('opml_head'); ?>
+               <?php
+               /**
+                * Fires in the OPML header.
+                *
+                * @since 3.0.0
+                */
+               do_action( 'opml_head' );
+               ?>
        </head>
        <body>
 <?php
 if ( empty($link_cat) )
        </head>
        <body>
 <?php
 if ( empty($link_cat) )
-       $cats = get_categories(array('type' => 'link', 'hierarchical' => 0));
+       $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0));
 else
 else
-       $cats = get_categories(array('type' => 'link', 'hierarchical' => 0, 'include' => $link_cat));
+       $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat));
 
 foreach ( (array)$cats as $cat ) :
 
 foreach ( (array)$cats as $cat ) :
-       $catname = apply_filters('link_category', $cat->name);
+       /**
+        * Filter the OPML outline link category name.
+        *
+        * @since 2.2.0
+        *
+        * @param string $catname The OPML outline category name.
+        */
+       $catname = apply_filters( 'link_category', $cat->name );
 
 ?>
 <outline type="category" title="<?php echo esc_attr($catname); ?>">
 <?php
        $bookmarks = get_bookmarks(array("category" => $cat->term_id));
        foreach ( (array)$bookmarks as $bookmark ) :
 
 ?>
 <outline type="category" title="<?php echo esc_attr($catname); ?>">
 <?php
        $bookmarks = get_bookmarks(array("category" => $cat->term_id));
        foreach ( (array)$bookmarks as $bookmark ) :
-               $title = apply_filters('link_title', $bookmark->link_name);
+               /**
+                * Filter the OPML outline link title text.
+                *
+                * @since 2.2.0
+                *
+                * @param string $title The OPML outline title text.
+                */
+               $title = apply_filters( 'link_title', $bookmark->link_name );
 ?>
        <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" />
 <?php
 ?>
        <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" />
 <?php