PHP 8.3.27
Preview: wp-links-opml.php Size: 2.44 KB
//home7/doctorbruno/www/taeionline.com/wp-links-opml.php
<?php
/**
 * Outputs the OPML XML format for getting the links defined in the link
 * administration. This can be used to export links from one blog over to
 * another. Links aren't exported by the WordPress export, so this file handles
 * that.
 *
 * This file is not added by default to WordPress theme pages when outputting
 * feed links. It will have to be added manually for browsers and users to pick
 * up that this file exists.
 *
 * @package WordPress
 */

require_once __DIR__ . '/wp-load.php';

header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
$link_cat = '';
if ( ! empty( $_GET['link_cat'] ) ) {
	$link_cat = $_GET['link_cat'];
	if ( ! in_array( $link_cat, array( 'all', '0' ), true ) ) {
		$link_cat = absint( (string) urldecode( $link_cat ) );
	}
}

echo '<?xml version="1.0"?' . ">\n";
?>
<opml version="1.0">
	<head>
		<title>
		<?php
			/* translators: %s: Site title. */
			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
		/**
		 * Fires in the OPML header.
		 *
		 * @since 3.0.0
		 */
		do_action( 'opml_head' );
		?>
	</head>
	<body>
<?php
if ( empty( $link_cat ) ) {
	$cats = get_categories(
		array(
			'taxonomy'     => 'link_category',
			'hierarchical' => 0,
		)
	);
} else {
	$cats = get_categories(
		array(
			'taxonomy'     => 'link_category',
			'hierarchical' => 0,
			'include'      => $link_cat,
		)
	);
}

foreach ( (array) $cats as $cat ) :
	/** This filter is documented in wp-includes/bookmark-template.php */
	$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 ) :
		/**
		 * Filters 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_url( $bookmark->link_rss ); ?>" htmlUrl="<?php echo esc_url( $bookmark->link_url ); ?>" updated="
							<?php
							if ( '0000-00-00 00:00:00' !== $bookmark->link_updated ) {
								echo $bookmark->link_updated;
							}
							?>
" />
		<?php
	endforeach; // $bookmarks
	?>
</outline>
	<?php
endforeach; // $cats
?>
</body>
</opml>

Directory Contents

Dirs: 6 × Files: 25
Name Size Perms Modified Actions
- drwxr-xr-x 2018-08-17 22:22:05
Edit Download
cgi-bin DIR
- drwxr-xr-x 2026-10-02 10:08:28
Edit Download
support DIR
- drwxr-xr-x 2026-10-02 10:08:28
Edit Download
wp-admin DIR
- drwxr-xr-x 2026-10-02 10:08:29
Edit Download
- drwxr-xr-x 2026-10-02 10:08:29
Edit Download
- drwxr-xr-x 2026-10-02 10:08:36
Edit Download
16 B lrw------- 2021-02-03 19:50:05
Edit Download
1017 B lrw-r--r-- 2026-10-03 04:11:10
Edit Download
878 B lrw-r--r-- 2025-09-18 01:04:14
Edit Download
313 B lrw-r--r-- 2025-09-24 00:16:55
Edit Download
58 B lrw-r--r-- 2020-06-30 06:07:11
Edit Download
1.12 MB lrw-r--r-- 2026-10-03 03:11:52
Edit Download
405 B lrw-r--r-- 2020-02-06 06:33:12
Edit Download
44 B lrw-r--r-- 2026-10-02 10:20:13
Edit Download
19.44 KB lrw-r--r-- 2025-03-06 14:24:24
Edit Download
7.25 KB lrw-r--r-- 2026-03-11 04:33:04
Edit Download
7.21 KB lrw-r--r-- 2024-02-13 14:19:10
Edit Download
803 B lrw-r--r-- 2026-09-26 16:13:39
Edit Download
351 B lrw-r--r-- 2020-02-06 06:33:12
Edit Download
2.27 KB lrw-r--r-- 2023-06-14 14:11:16
Edit Download
3.26 KB lrw-r--r-- 2024-10-15 15:24:18
Edit Download
2.70 KB lrw-r--r-- 2017-08-17 12:35:28
Edit Download
5.49 KB lrw-r--r-- 2024-08-02 19:40:16
Edit Download
2.44 KB lrw-r--r-- 2022-11-26 21:01:18
Edit Download
3.84 KB lrw-r--r-- 2024-03-11 10:05:16
Edit Download
50.21 KB lrw-r--r-- 2025-02-03 16:55:24
Edit Download
8.52 KB lrw-r--r-- 2025-02-08 16:00:20
Edit Download
29.38 KB lrw-r--r-- 2025-03-04 13:06:28
Edit Download
33.71 KB lrw-r--r-- 2025-03-10 18:16:28
Edit Download
4.98 KB lrw-r--r-- 2024-10-18 15:56:18
Edit Download
3.13 KB lrw-r--r-- 2024-11-08 15:52:18
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).