PHP 클래스 WPDKScripts

Very useful for view controller.
부터: 1.4.13
저자: =undo= ([email protected])
파일 보기 프로젝트 열기: wpxtreme/wpdk

보호된 프로퍼티들

프로퍼티 타입 설명
$scripts

공개 메소드들

메소드 설명
__construct ( ) : WPDKScripts Create an instance of WPDKScripts class
enqueue_script_page_templates ( array $page_templates, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false, boolean $in_footer = false ) : boolean Enqueue script for list of page template. Return FALSE if $page_templates is empty
enqueue_script_pages ( array $pages, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false, boolean $in_footer = false ) : boolean Enqueue script for list of page. Return FALSE if $pages is empty
enqueue_style_page_templates ( array $page_templates, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false ) : boolean Enqueue script for list of page template. Return FALSE if $page_templates is empty
enqueue_style_pages ( array $pages, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false ) : boolean Enqueue style for list of page. Return FALSE if $pages is empty
hasScripts ( string | array $handle, string $comp = '&' ) : boolean Return TRUE if a handle is registered
registerScripts ( array $scripts, string $path = '', string | array $deps = [], boolean | string $version = false, boolean $in_footer = true ) : boolean Register one or more script following the view controller standard

메소드 상세

__construct() 공개 메소드

Create an instance of WPDKScripts class
public __construct ( ) : WPDKScripts
리턴 WPDKScripts

enqueue_script_page_templates() 공개 정적인 메소드

Enqueue script for list of page template. Return FALSE if $page_templates is empty
public static enqueue_script_page_templates ( array $page_templates, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false, boolean $in_footer = false ) : boolean
$page_templates array Array of page slug template
$handle string | array The script handle or an array of handles
$src boolean Optional. Source URI
$deps array Optional. Array of other handle
$ver boolean Optional. Version to avoid cache
$in_footer boolean Optional. Load in footer
리턴 boolean

enqueue_script_pages() 공개 정적인 메소드

Enqueue script for list of page. Return FALSE if $pages is empty
public static enqueue_script_pages ( array $pages, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false, boolean $in_footer = false ) : boolean
$pages array Array of page slug
$handle string | array The script handle or an array of handles
$src boolean Optional. Source URI
$deps array Optional. Array of other handle
$ver boolean Optional. Version to avoid cache
$in_footer boolean Optional. Load in footer
리턴 boolean

enqueue_style_page_templates() 공개 정적인 메소드

Enqueue script for list of page template. Return FALSE if $page_templates is empty
public static enqueue_style_page_templates ( array $page_templates, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false ) : boolean
$page_templates array Array of page slug template
$handle string | array The script handle or andarray of handles
$src boolean Optional. Source URI
$deps array Optional. Array of other handle
$ver boolean Optional. Version to avoid cache
리턴 boolean

enqueue_style_pages() 공개 정적인 메소드

Enqueue style for list of page. Return FALSE if $pages is empty
public static enqueue_style_pages ( array $pages, string | array $handle, boolean $src = false, array $deps = [], boolean $ver = false ) : boolean
$pages array Array of page slug
$handle string | array The script handle or an array of handles
$src boolean Optional. Source URI
$deps array Optional. Array of other handle
$ver boolean Optional. Version to avoid cache
리턴 boolean

hasScripts() 공개 메소드

Return TRUE if a handle is registered
public hasScripts ( string | array $handle, string $comp = '&' ) : boolean
$handle string | array Handle or list of handles.
$comp string If $handle is an array or list of handles, use 'AND' or '&' to return TRUE wheter all handle exists use 'OR' or '|' to return TRUE if almost one handle exists
리턴 boolean

registerScripts() 공개 메소드

Register one or more script following the view controller standard
public registerScripts ( array $scripts, string $path = '', string | array $deps = [], boolean | string $version = false, boolean $in_footer = true ) : boolean
$scripts array List of scripts $scripts = array( 'wpxbz-preferences.js' => array( 'handle' => 'my-handle', // Optional -sanitize_titile( $key ) + remove '.js' 'path' => WPXBANNERIZE_URL_JAVASCRIPT, // Optional if set $path params 'deps' => array( 'jquery' ), // Optional if set $deps params 'version' => '1.2.3', // Optional if set $version 'footer' => false, // Optional override the $in_footer params, ) ); WPDKScripts::registerScripts( $scripts ); OR $scripts = array( 'wpxbz-preferences.js', 'wpxbz-admin.js', ); WPDKScripts::registerScripts( $scripts, $path, $version ); OR $scripts = array( 'wpxbz-preferences.js' => array( 'handle' => 'my-handle', // Optional -sanitize_titile( $key ) + remove '.js' 'path' => WPXBANNERIZE_URL_JAVASCRIPT, // Optional if set $path params 'version' => '1.2.3', // Optional if set $version 'footer' => false, // Optional override the $in_footer params ), 'wpxbz-admin.js', ); // $path and version will be used for 2th iten WPDKScripts::registerScripts( $scripts, $path, $version );
$path string Optional. If set all scripts will be loaded fron this url
$deps string | array Optional. One or more handle dependiences
$version boolean | string Optional. If set will apply to all script
$in_footer boolean Optional. Default all scripts are loaded in footer
리턴 boolean

프로퍼티 상세

$scripts 보호되어 있는 프로퍼티

protected $scripts