/**
  * test method
  */
 public function testGetMethod()
 {
     $helper = WD_Helper_Page::getInstance();
     update_option('key', 'myvalue');
     $this->assertEquals(get_option('key'), $helper->get('key'));
 }
Exemplo n.º 2
0
/**
 * Returns a instance of WD_Helper_Page
 * 
 * This class helps the user retrieve data saved by the page creator
 * 
 * @return WD_Helper_Page
 */
function wd_opt()
{
    return WD_Helper_Page::getInstance();
}
 /**
  * Singleton
  * 
  * @return self
  */
 public static function getInstance()
 {
     return self::$instance ? self::$instance : (self::$instance = new self());
 }