url.'assets/'.$name; } /** * Detect if this post type is allowed * * @param string $post_type * * @return bool */ public function is_allowed($post_type){ return false !== array_search($post_type, $this->option['post_type']); } /** * Getter * * @param string $key * * @return mixed */ public function __get($key){ switch( $key ){ case 'input': return Input::get_instance(); break; case 'dir': return dirname(dirname(dirname(__FILE__))); break; case 'url': return plugin_dir_url(dirname(dirname(__FILE__))); break; case 'i18n': return i18n::get_instance(); break; case 'feedbacks': return FeedBacks::get_instance(); break; case 'option': $option = get_option('afb_setting', array()); $default = array( "style" => 0, "post_types" => array(), "comment" => 0, "controller" => '', 'ga' => false, ); foreach( $default as $key => $val){ if( !isset($option[$key]) ){ $option[$key] = $val; } } return $option; break; default: return null; break; } } }