Skip to content

Commit

Permalink
Trying to override 404 status of feed
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrymala committed May 1, 2015
1 parent fa71ae4 commit 7d47ea7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion site-list-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if ( ! class_exists( 'Multisite_Site_Feed' ) ) {
class Multisite_Site_Feed {
var $version = '0.1';
var $dbversion = '2015-05-01/08:00:00';
var $dbversion = '2015-05-01/12:00:00';

/**
* Construct our Multisite_Site_Feed object
Expand All @@ -24,6 +24,7 @@ function __construct() {
$dbv = get_option( '_multisite_site_feed_db_version', false );

add_action( 'init', array( $this, 'add_feed' ) );
/*add_filter( 'status_header', array( $this, 'status_header' ), 99, 4 );*/

if ( $dbv != $this->dbversion ) {
add_action( 'init', array( $this, 'flush_rules' ) );
Expand Down Expand Up @@ -131,9 +132,18 @@ function get_site_list() {
* @return void
*/
function site_list() {
status_header( 200 );
header( 'Content-Type: application/javascript' );
echo $this->get_site_list();
die();
}

/**
* Attempt to override the fact that WordPress sets 404 as the status
*/
function status_header( $status, $code, $description, $protocol ) {
return "$protocol 200 OK";
}
}
/* End Class Definition */

Expand Down

0 comments on commit 7d47ea7

Please sign in to comment.