Skip to content

Instantly share code, notes, and snippets.

@soramugi
Last active October 21, 2015 01:53
Show Gist options
  • Save soramugi/e24c3327f4abffa0d54b to your computer and use it in GitHub Desktop.
Save soramugi/e24c3327f4abffa0d54b to your computer and use it in GitHub Desktop.
wordpressのルート直下に置けばBroken Link Checkerでのリンク切れ記事が解るwebapiファイル
<?php
require_once(dirname(__FILE__) . '/wp-load.php');
$results = $wpdb->get_results( '
select instances.container_id from wp_blc_links AS links
LEFT JOIN wp_blc_instances AS instances
ON (links.link_id = instances.link_id)
where links.http_code="404"
' );
header("Content-Type: application/json; charset=utf-8");
echo json_encode($results);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment