PHP 클래스 APF_Demo_CustomFieldType_Select2

부터: 3.8.6
파일 보기 프로젝트 열기: michaeluno/admin-page-framework

공개 프로퍼티들

프로퍼티 타입 설명
$oFactory
$sClassName
$sPageSlug
$sTabSlug

공개 메소드들

메소드 설명
__construct ( $oFactory, $sPageSlug )
createTerm ( $aQueries, $aFieldset ) : array Returns the created item with the format of select2 AJAX response data strucute.
getPosts ( $aQueries, $aFieldset ) : array Retrieves and return posts with the array structure of select2 AJAX format.
getTerms ( $aQueries, $aFieldset ) : array
replyToDoTab ( )
replyToLoadTab ( $oAdminPage ) Triggered when the tab starts loading.
validate ( $aInputs, $aOldInputs, $oAdminPage, $aSubmitInfo )

메소드 상세

__construct() 공개 메소드

public __construct ( $oFactory, $sPageSlug )

createTerm() 공개 정적인 메소드

Structure of Response Array

It must be an associative array with the element keys of id and text, and optionally error/ array( 'id' => 223, 'text' => 'WordPress' ) array( 'error' => 'Something went wrong' )
public static createTerm ( $aQueries, $aFieldset ) : array
리턴 array

getPosts() 공개 정적인 메소드

Structure of Response Array

It must be an associative array with the element keys of results and pagination. In the results element must be a numerically index array holding an array with the kes of id and text. The pagination element can be optional and shouold be an array holding an element named more which accepts a boolean value. array( 'results' => array( array( 'id' => 223, 'text' => 'Title of 223' ), array( 'id' => 665, 'text' => 'Title of 665' ), array( 'id' => 9355, 'text' => 'Title of 9355' ), ... ), 'pagination' => array( 'more' => true, // (boolean) or false - whether the next paginated item exists or not. ) ) Or the pagination element can be omitted. array( 'results' => array( array( 'id' => 223, 'text' => 'Title of 223' ), array( 'id' => 665, 'text' => 'Title of 665' ), array( 'id' => 9355, 'text' => 'Title of 9355' ), ... ), )
또한 보기: https://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters
또한 보기: https://select2.github.io/examples.html#data-ajax
public static getPosts ( $aQueries, $aFieldset ) : array
리턴 array

getTerms() 공개 정적인 메소드

public static getTerms ( $aQueries, $aFieldset ) : array
리턴 array An array holding the search result of taxonomy terms.

replyToDoTab() 공개 메소드

public replyToDoTab ( )

replyToLoadTab() 공개 메소드

Triggered when the tab starts loading.
public replyToLoadTab ( $oAdminPage )

validate() 공개 메소드

public validate ( $aInputs, $aOldInputs, $oAdminPage, $aSubmitInfo )

프로퍼티 상세

$oFactory 공개적으로 프로퍼티

public $oFactory

$sClassName 공개적으로 프로퍼티

public $sClassName

$sPageSlug 공개적으로 프로퍼티

public $sPageSlug

$sTabSlug 공개적으로 프로퍼티

public $sTabSlug