PHP 클래스 GitHubCustomFieldType

상속: extends AdminPageFramework_FieldType
파일 보기 프로젝트 열기: michaeluno/admin-page-framework 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_bAddedScriptToFooter
$aFieldTypeSlugs The slug is used for the type key in a field definition array. $this->addSettingFields( array( 'section_id' => '...', 'type' => 'github', // <--- THIS PART 'field_id' => '...', 'title' => '...', ) );

보호된 프로퍼티들

프로퍼티 타입 설명
$aDefaultKeys The keys are used for the field definition array. $this->addSettingFields( array( 'section_id' => '...', 'type' => '...', 'field_id' => '...', 'my_custom_key' => '...', // <-- THIS PART ) );

공개 메소드들

메소드 설명
_replyToAddScript ( )

보호된 메소드들

메소드 설명
construct ( ) User constructor.
getEnqueuingScripts ( ) Returns an array holding the urls of enqueuing scripts.
getEnqueuingStyles ( ) Returns an array holding the urls of enqueuing styles.
getField ( $aField ) Returns the output of the field type.
getIEStyles ( ) Returns IE specific CSS rules.
getScripts ( ) Returns the field type specific JavaScript script.
getStyles ( ) Returns the field type specific CSS rules.
setUp ( ) Loads the field type necessary components.

비공개 메소드들

메소드 설명
_getButtonLabelByType ( $sButtonType, $sUserName, $sValue )
_getCountAPIByType ( $sButtonType, $sUserName, $sRepository )
_getCountHrefByType ( $sButtonType, $sUserName, $sRepository )
_getGitHubAPICountSlugByType ( $sType ) Returns the API count slug used for the given type.
_getGitHubAPISlugByType ( $sType ) Returns the API slug used for the given type.
_getHrefByType ( $sButtonType, $sUserName, $sRepository )
_getIcontByType ( $sButtonType )

메소드 상세

_replyToAddScript() 공개 메소드

public _replyToAddScript ( )

construct() 보호된 메소드

Loaded at the end of the constructor.
protected construct ( )

getEnqueuingScripts() 보호된 메소드

The returning array should be composed with all numeric keys. Each element can be either a string( the url or the path of the source file) or an array of custom argument.

Custom Argument Array

  • src - ( required, string ) The url or path of the target source file
  • handle_id - ( optional, string ) The handle ID of the script.
  • dependencies - ( optional, array ) The dependency array. For more information, see codex.
  • version - ( optional, string ) The stylesheet version number.
  • translation - ( optional, array ) The translation array. The handle ID will be used for the object name.
  • in_footer - ( optional, boolean ) Whether to enqueue the script before < / head > or before < / body > Default: false.
  • arguments - ( optional, array ) [3.3.0+] argument array. array( 'async' => '', 'data-id' => '...' )

Example

array( 'src' => dirname( __FILE__ ) . '/asset/github-buttons/buttons.js', 'handle_id' => 'github-bjs', 'in_footer' => true, 'attributes' => array( 'async' => '', 'defer' => '', ), )
protected getEnqueuingScripts ( )

getEnqueuingStyles() 보호된 메소드

Custom Argument Array

  • src - ( required, string ) The url or path of the target source file
  • handle_id - ( optional, string ) The handle ID of the stylesheet.
  • dependencies - ( optional, array ) The dependency array. For more information, see codex.
  • version - ( optional, string ) The stylesheet version number.
  • media - ( optional, string ) the description of the field which is inserted into the after the input field tag.
  • arguments - ( optional, array ) [3.3.0+] argument array. array( 'data-id' => '...' )

Example

array( array( 'src' => dirname( __FILE__ ) . '/assets/css/main.css', 'handle_id' => 'custom_button_css', ), );
protected getEnqueuingStyles ( )

getField() 보호된 메소드

Returns the output of the field type.
protected getField ( $aField )

getIEStyles() 보호된 메소드

Returns IE specific CSS rules.
protected getIEStyles ( )

getScripts() 보호된 메소드

Returns the field type specific JavaScript script.
protected getScripts ( )

getStyles() 보호된 메소드

Returns the field type specific CSS rules.
protected getStyles ( )

setUp() 보호된 메소드

This method is triggered when a field definition array that calls this field type is parsed.
protected setUp ( )

프로퍼티 상세

$_bAddedScriptToFooter 공개적으로 정적으로 프로퍼티

public static $_bAddedScriptToFooter

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

The keys are used for the field definition array. $this->addSettingFields( array( 'section_id' => '...', 'type' => '...', 'field_id' => '...', 'my_custom_key' => '...', // <-- THIS PART ) );
protected $aDefaultKeys

$aFieldTypeSlugs 공개적으로 프로퍼티

The slug is used for the type key in a field definition array. $this->addSettingFields( array( 'section_id' => '...', 'type' => 'github', // <--- THIS PART 'field_id' => '...', 'title' => '...', ) );
public $aFieldTypeSlugs