X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/76aea3697c6043c1613370f172395b4f65ee71f0..refs/tags/wordpress-3.4.2-scripts:/wp-links-opml.php diff --git a/wp-links-opml.php b/wp-links-opml.php index f536d616..e30869bd 100644 --- a/wp-links-opml.php +++ b/wp-links-opml.php @@ -12,54 +12,48 @@ * @package WordPress */ -if (empty($wp)) { - require_once('./wp-load.php'); - wp(); -} +require_once('./wp-load.php'); header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); -$link_cat = $_GET['link_cat']; -if ((empty ($link_cat)) || ($link_cat == 'all') || ($link_cat == '0')) { - $link_cat = ''; -} else { // be safe - $link_cat = '' . urldecode($link_cat) . ''; - $link_cat = intval($link_cat); +$link_cat = ''; +if ( !empty($_GET['link_cat']) ) { + $link_cat = $_GET['link_cat']; + if ( !in_array($link_cat, array('all', '0')) ) + $link_cat = absint( (string)urldecode($link_cat) ); } -?>\n"; ?> - + +echo '\n"; +?> - Links for <?php echo attribute_escape(get_bloginfo('name', 'display').$cat_name); ?> + <?php printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); ?> GMT + 'link_category', 'hierarchical' => 0)); else - $cats = get_categories('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); ?> - + term_id}"); - foreach ((array) $bookmarks as $bookmark) { - $title = attribute_escape(apply_filters('link_title', $bookmark->link_name)); + $bookmarks = get_bookmarks(array("category" => $cat->term_id)); + foreach ( (array)$bookmarks as $bookmark ) : + $title = apply_filters('link_title', $bookmark->link_name); ?> - + - + \ No newline at end of file