Skip to content

Instantly share code, notes, and snippets.

---Test A (TestClassA - hook:send_headers)---
Can't retrieve test var
Can't retrieve error var
---Test C (TestClassA - hook:send_header) ---
A Test
Can't retrieve error var <-- wordpress even blocks people from using $_GET['error']??
class ParentTest{
private $log;
public function __construct(){
$this->log=fopen('test.log','a+');
add_action('send_headers',array($this,'testA'));
add_filter('the_content',array($this,'testB'));
add_action('send_headers',array($this,'testC'));
add_filter('the_content',array($this,'testD'));
<?php
//assumes file already downloaded!
$local_file='feed.xml';
$result = file_get_contents($local_file);
$xml = simplexml_load_string($result);
$xml->registerXPathNamespace('yweather', 'http://xml.weather.yahoo.com/ns/rss/1.0');
$location = $xml->channel->xpath('yweather:location');