PHP Класс APF_Demo_CustomFieldType_Select2

С версии: 3.8.6
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$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