本文整理汇总了PHP中KT类的典型用法代码示例。如果您正苦于以下问题:PHP KT类的具体用法?PHP KT怎么用?PHP KT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMetas
/**
* Vrátí pole s metas
*
* @return array
*/
public final function getMetas()
{
if (KT::notIssetOrEmpty($this->metas)) {
$this->initMetas();
}
return $this->metas;
}
示例2: getOptionsData
/**
* @return array
*/
public function getOptionsData()
{
if (KT::issetAndNotEmpty($this->dataManager)) {
return $this->getDataManager()->getData();
}
return array();
}
示例3: removeMetabox
/**
* Zruší metabox na základě názvu, stránky a contextu
*
* @param string $metaboxId
* @param string $postType
* @param string $context
* @return \KT_WP_Metabox_Remover_Configurator
*/
public function removeMetabox($metaboxId, $postType, $context)
{
if (KT::issetAndNotEmpty($metaboxId) && KT::issetAndNotEmpty($postType) && KT::issetAndNotEmpty($context)) {
array_push($this->data, array($metaboxId, $postType, $context));
}
return $this;
}
示例4: removeWidget
/**
* Zruší widget na základě názvu
*
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
*
* @param string $widgetName
* @return \KT_WP_Widget_Remover_Configurator
*/
public function removeWidget($widgetName)
{
if (KT::issetAndNotEmpty($widgetName)) {
array_push($this->data, $widgetName);
}
return $this;
}
示例5: renderPrevReferenceLink
public function renderPrevReferenceLink()
{
$adjacent = get_adjacent_post(false, "", true);
if (KT::issetAndNotEmpty($adjacent)) {
$url = get_permalink($adjacent->ID);
echo "<a href=\"{$url}\" title=\"Předchozí naše práce\" class=\"prev\">Předchozí reference</a>";
}
}
示例6: kt_zzz_load_more_posts_callback
function kt_zzz_load_more_posts_callback()
{
if (KT::arrayIssetAndNotEmpty($_REQUEST)) {
$presenter = new KT_ZZZ_Posts_Presenter();
die($presenter->getPostsOutput());
}
die(false);
}
示例7: __construct
/**
* @param string $action - WP nonce akce
* @param string $name - hash v poli
* @param string $label - popisek v HTML
*/
public function __construct($action, $name, $label)
{
parent::__construct($name, $label);
if (KT::issetAndNotEmpty($action)) {
$this->action = $action;
} else {
throw new KT_Not_Supported_Exception("Empty Nonce Action");
}
}
示例8: getNameAttribute
protected function getNameAttribute()
{
$afterNameString = static::getAfterNameValue();
if (KT::issetAndNotEmpty($this->getPostPrefix())) {
return "{$this->getPostPrefix()}[{$this->getName()}]{$afterNameString}";
} else {
return "{$this->getName()}{$afterNameString}";
}
}
示例9: pageQueryArgsInit
/**
* Objektu automaticky nastaví query po selekci stránek
*
* @return \KT_Page_Field
*/
private function pageQueryArgsInit()
{
$args = array("post_type" => KT_WP_PAGE_KEY, "posts_per_page" => self::DEFAUL_PAGE_COUNT, "post_status" => "publish", "orderby" => "parent title", "order" => KT_Repository::ORDER_ASC);
if (KT::issetAndNotEmpty($this->getParentPage())) {
$args["post_parent"] = $this->getParentPage();
}
$dataManager = new KT_Custom_Post_Data_Manager();
$dataManager->setQueryArgs($args);
$this->setDataManager($dataManager);
}
示例10: getAllTermsByTaxonomy
/**
* Vytažení všech termů pro zadané taxonomy vlastním způsobem ve formátu [ID, slug, name]
*
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
* @link http://codeblow.com/questions/wordpress-get-terms-function-no-longer-working-during-my-wordpress-plugin/
*
* @global $wpdb
* @param string $taxonomyName
* @return array
* @throws KT_Not_Set_Argument_Exception
*/
public static function getAllTermsByTaxonomy($taxonomyName)
{
if (KT::issetAndNotEmpty($taxonomyName)) {
global $wpdb;
$query = "SELECT DISTINCT {$wpdb->terms}.term_id as ID, {$wpdb->terms}.slug as slug, {$wpdb->terms}.name as name\n\t\t\t\t\t FROM {$wpdb->terms}\n\t\t\t\t\t LEFT JOIN {$wpdb->term_taxonomy}\n\t\t\t\t\t ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id\n\t\t\t\t\t WHERE {$wpdb->term_taxonomy}.taxonomy = '%s'\n\t\t\t\t\t ORDER BY {$wpdb->terms}.name";
$results = $wpdb->get_results($wpdb->prepare($query, $taxonomyName), ARRAY_A);
return $results;
}
throw new KT_Not_Set_Argument_Exception("taxonomy");
}
示例11: getField
/**
* Vrátí HTML strukturu pro zobrazní fieldu
*
* @author Tomáš Kocifaj
* @link http://www.ktstudio.cz
*
* @return string
*/
public function getField()
{
$html = "";
$html .= "<textarea " . $this->getBasicHtml() . ">";
$html .= KT::stringHtmlDecode($this->getValue());
$html .= "</textarea>";
if ($this->hasErrorMsg()) {
$html .= parent::getHtmlErrorMsg();
}
return $html;
}
示例12: getParamsFieldset
public static function getParamsFieldset()
{
$fieldset = new KT_Form_Fieldset(self::PARAMS_FIELDSET, __("Parametry", "ZZZ_ADMIN_DOMAIN"));
$fieldset->setPostPrefix(self::PARAMS_FIELDSET);
$referenceTypes = new KT_ZZZ_Reference_Type_Enum();
$referenceOptions = KT::arrayRemoveByKey($referenceTypes->getTranslates(), KT_ZZZ_Reference_Type_Enum::NONE);
$fieldset->addText(self::PARAMS_DATE, __("Datum:", "ZZZ_ADMIN_DOMAIN"));
$fieldset->addText(self::PARAMS_CLIENT, __("Klient:", "ZZZ_ADMIN_DOMAIN"));
$fieldset->addCheckbox(self::PARAMS_TYPES, __("Typy:", "ZZZ_ADMIN_DOMAIN"))->setOptionsData($referenceOptions);
return $fieldset;
}
示例13: getList
/**
* Na základě odřádkování (tzn. po řádcích) rozdělí zadaný text a vrátí jako HTML seznam zadaného tagu
*
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
*
* @param string $format @see sprintf()
* @return string (HTML)
*/
public function getList($format = "%s", $unsafe = false)
{
$lines = $this->getLinesArray($unsafe);
if (!KT::arrayIssetAndNotEmpty($lines)) {
return;
}
$output = "";
foreach ($lines as $line) {
$output .= sprintf($format, $line);
}
return $output;
}
示例14: kt_edit_sorting_crud_list_callback
/**
* Funkce obslouží ajax dotaz, který má provést uložení pořadí itemů po Sortable
*
* @author Tomáš Kocifaj
* @link http://www.ktstudio.cz
*/
function kt_edit_sorting_crud_list_callback()
{
$itemCollection = $_REQUEST["data"];
$className = $_REQUEST["class_name"];
if (KT::arrayIssetAndNotEmpty($itemCollection)) {
foreach ($itemCollection as $index => $itemId) {
$crudClassObject = new $className($itemId);
if ($crudClassObject->isInDatabase()) {
$crudClassObject->setMenuOrder($index)->saveRow();
}
}
}
}
示例15: initPosts
private function initPosts()
{
$args = array("post_type" => KT_WP_POST_KEY, "post_status" => "publish", "posts_per_page" => self::DEFAULT_COUNT, "orderby" => "date", "order" => KT_Repository::ORDER_DESC, "cat" => KT_ZZZ::getThemeModel()->getCategoryNewsId());
$query = new WP_Query();
$posts = $query->query($args);
if (KT::arrayIssetAndNotEmpty($posts)) {
$this->posts = $posts;
$this->postsCount = count($posts);
} else {
$this->posts = array();
$this->postsCount = 0;
}
}