PHP 7.4.33
Preview: wp-links-opml.php Size: 2.43 KB
/home/zcziejy/ryadselyen/wp-content/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( 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: 17 × Files: 32
Name Size Perms Modified Actions
.tmb DIR
- drwxr-xr-x 2026-01-12 19:13:31
Edit Download
aa8f5ead DIR
- drwxr-xr-x 2026-01-12 19:14:23
Edit Download
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
- drwxr-xr-x 2026-01-27 19:33:19
Edit Download
cache DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
languages DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
litespeed DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
plugins DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
themes DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
upgrade DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
uploads DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
wp-admin DIR
- drwxr-xr-x 2026-01-12 19:16:18
Edit Download
- drwxr-xr-x 2026-01-27 19:11:38
Edit Download
- drwxr-xr-x 2026-01-12 19:17:31
Edit Download
wpo-cache DIR
- drwxr-xr-x 2026-01-09 04:01:53
Edit Download
420 B lrw-r--r-- 2026-01-09 04:01:53
Edit Download
498 B lrw-r--r-- 2026-01-13 03:53:28
Edit Download
880 B lrw-r--r-- 2023-11-20 18:29:21
Edit Download
62 B lrw-r--r-- 2026-01-09 02:43:03
Edit Download
52 B lrw-r--r-- 2026-01-09 03:53:08
Edit Download
47 B lrw-r--r-- 2023-11-21 11:23:29
Edit Download
47 B lrw-r--r-- 2023-11-21 11:23:29
Edit Download
107 B lrw-r--r-- 2023-01-10 22:58:35
Edit Download
53 B lrw-r--r-- 2025-11-28 07:43:18
Edit Download
53 B lrw-r--r-- 2025-12-24 19:26:18
Edit Download
2.65 KB lrw-r--r-- 2026-01-11 14:38:53
Edit Download
2.65 KB lrw-r--r-- 2026-01-11 14:38:53
Edit Download
19.44 KB lrw-r--r-- 2025-12-02 22:36:59
Edit Download
7.25 KB lrw-r--r-- 2025-12-02 22:36:58
Edit Download
98 B lrw-r--r-- 2023-11-21 11:23:29
Edit Download
2.14 KB lrw-r--r-- 2023-11-21 11:11:37
Edit Download
0 B lrw-r--r-- 2021-10-31 03:14:20
Edit Download
0 B lrw-r--r-- 2021-10-31 03:14:20
Edit Download
7.18 KB lrw-r--r-- 2025-12-02 22:36:59
Edit Download
351 B lrw-r--r-- 2023-01-10 22:38:25
Edit Download
3.06 KB lrw-r--r-- 2023-08-08 23:44:46
Edit Download
28.90 KB lrw-r--r-- 2025-12-02 22:36:59
Edit Download
3.15 KB lrw-r--r-- 2023-11-21 11:55:52
Edit Download
5.49 KB lrw-r--r-- 2024-11-12 22:37:31
Edit Download
2.43 KB lrw-r--r-- 2025-12-02 22:36:59
Edit Download
3.88 KB lrw-r--r-- 2024-07-16 23:33:53
Edit Download
50.23 KB lrw-r--r-- 2025-12-02 22:36:59
Edit Download
8.52 KB lrw-r--r-- 2025-12-02 22:36:58
Edit Download
30.33 KB lrw-r--r-- 2025-12-02 22:36:59
Edit Download
33.71 KB lrw-r--r-- 2025-04-15 23:35:18
Edit Download
5.09 KB lrw-r--r-- 2025-12-02 22:36:58
Edit Download
3.13 KB lrw-r--r-- 2025-04-15 23:35:17
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).