Fix undefined static method - #45
This commit is contained in:
@ -317,10 +317,42 @@ class ContentWarning_v2 {
|
|||||||
$this->admin = new CWV2_Admin( $this );
|
$this->admin = new CWV2_Admin( $this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This plugin's directory
|
||||||
|
*
|
||||||
|
* @since 3.7
|
||||||
|
*
|
||||||
|
* @param string $path (optional) appended path
|
||||||
|
*
|
||||||
|
* @return string Directory and path
|
||||||
|
*/
|
||||||
|
public static function dir( $path = '' ) {
|
||||||
|
static $dir;
|
||||||
|
$dir = $dir ? $dir : trailingslashit( dirname( __FILE__ ) );
|
||||||
|
|
||||||
|
return $dir . $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This plugin's url
|
||||||
|
*
|
||||||
|
* @since 3.7
|
||||||
|
*
|
||||||
|
* @param string $path (optional) appended path
|
||||||
|
*
|
||||||
|
* @return string URL and path
|
||||||
|
*/
|
||||||
|
public static function url( $path = '' ) {
|
||||||
|
static $url;
|
||||||
|
$url = $url ? $url : trailingslashit( plugin_dir_url( __FILE__ ) );
|
||||||
|
|
||||||
|
return $url . $path;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include a file from the includes directory
|
* Include a file from the includes directory
|
||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 3.7
|
||||||
*
|
*
|
||||||
* @param string $filename Name of the file to be included
|
* @param string $filename Name of the file to be included
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user