foreach ($data as $key => $values) { if (KT::arrayIssetAndNotEmpty($values)) { $schedule = KT::arrayTryGetValue($values, "schedule"); //$interval = KT::arrayTryGetValue($values, "interval"); $date = date("H:i:s", $time); echo "<li><b>{$name}</b> - <i>{$schedule}</i> @ {$date}</li>"; } } } } } } echo "</ol>"; } } $intervalsMetabox = KT_Metabox::createCustom(KT_WP_Configurator::WP_CRON_PAGE_SLUG . "-intervals-metabox", __("Zavedené intervaly", "KT_CORE_DOMAIN"), KT_WP_Configurator::getWpCronSlug(), "kt_cron_schedules_metabox_callback", false); $intervalsMetabox->setContext(KT_MetaBox::CONTEXT_SIDE)->register(); function kt_cron_schedules_metabox_callback() { $schedules = wp_get_schedules(); if (KT::arrayIssetAndNotEmpty($schedules)) { echo "<ol>"; foreach ($schedules as $key => $values) { if (KT::arrayIssetAndNotEmpty($values)) { $interval = KT::arrayTryGetValue($values, "interval"); $display = KT::arrayTryGetValue($values, "display"); echo "<li><b>{$key}</b> (<i>{$display}</i>) - {$interval} [s]</li>"; } } echo "</ol>"; }
<?php $config = new KT_WP_Configurator(); $config->setDisplayLogo()->setPostArchiveMenu()->setAllowCookieStatement()->setAllowSession(); $config->addThemeSupport(KT_WP_THEME_SUPPORT_POST_THUMBNAILS_KEY); $config->addPostTypeSupport(KT_WP_POST_TYPE_SUPPORT_EXCERPT_KEY, array(KT_WP_PAGE_KEY)); $config->removePostTypeSupport(KT_WP_POST_TYPE_SUPPORT_THUMBNAIL_KEY, array(KT_WP_PAGE_KEY)); $config->setPostsArchiveSlug("blog"); $config->setExcerptText("..."); $config->pageRemover()->removeComments()->removeTools()->removeSubPage("edit.php", "edit-tags.php")->removeSubPage("edit.php", "edit-tags.php?taxonomy=post_tag")->removeSubPage("themes.php", "theme-editor.php"); $config->metaboxRemover()->removePostTagMetabox()->removeMetabox("tagsdiv-news-type", KT_WP_POST_KEY, "normal")->removeRevisionsMetabox(); // --- images ------------------------------ $config->addImageSize(KT_ZZZ_IMAGE_SIZE_SLIDER, 1200, 250, true); $config->addImageSize(KT_ZZZ_IMAGE_SIZE_REFERENCE_GALLERY, 768, 480, true); $config->setImagesLazyLoading(true)->setImagesLinkClasses(true); // --- styly --------------------------- $config->assetsConfigurator()->addStyle(KT_MAGNIFIC_POPUP_STYLE)->setEnqueue(); //$config->assetsConfigurator()->addStyle("kt-zzz-bootstrap-style", KT_ZZZ_CSS_URL . "/bootstrap.min.css")->setEnqueue(); /* * Bylo by dobré používat pouze jeden styl, spojený a minifikovaný do jednoho souboru, * pak předchozí registrace nejsou třeba a stačí pouze následující: */ $config->assetsConfigurator()->addStyle("kt-zzz-style", get_template_directory_uri() . "/style.css")->setDeps(array(KT_MAGNIFIC_POPUP_STYLE))->setEnqueue(); $config->assetsConfigurator()->addStyle("kt-zzz-font-open-sans", "http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,700,800&subset=latin,latin-ext")->setEnqueue(); // --- scripty ------------------------------ $config->assetsConfigurator()->addScript(KT_JQUERY_UNVEIL_SCRIPT)->setInFooter(true)->setEnqueue(); $config->assetsConfigurator()->addScript(KT_MAGNIFIC_POPUP_SCRIPT)->setInFooter(true)->setEnqueue(); //$config->assetsConfigurator() // ->addScript("kt-zzz-bootstrap-script", KT_ZZZ_JS_URL . "/bootstrap.min.js") // ->setInFooter(true) // ->setEnqueue();
/** * Provede echo HTML s tlačítkem pro odeslání formuláře * * Před buttonem se se volá akce do_action("kt_theme_setting_box_appearance_page_kt-theme-setting); * * USED : renderSaveMetabox(); * * @author Tomáš Kocifaj * @link http://www.ktstudio.cz * */ public function saveMetaboxCallback() { do_action("kt_theme_setting_box_" . KT_WP_Configurator::getThemeSettingSlug()); echo "<button type=\"submit\" class=\"button button-primary button-large\">" . __('Uložit nastavení', KT_DOMAIN) . "</button>"; }
<?php // --- theme ------------------------ KT_MetaBox::createMultiple(KT_ZZZ_Theme_Config::getAllNormalFieldsets(), KT_WP_Configurator::getThemeSettingSlug(), KT_MetaBox_Data_Type_Enum::OPTIONS); $themeSideMetaboxes = KT_MetaBox::createMultiple(KT_ZZZ_Theme_Config::getAllSideFieldsets(), KT_WP_Configurator::getThemeSettingSlug(), KT_MetaBox_Data_Type_Enum::OPTIONS, false); foreach ($themeSideMetaboxes as $themeSideMetabox) { $themeSideMetabox->setContext(KT_MetaBox::CONTEXT_SIDE); $themeSideMetabox->register(); } // --- post ------------------------ KT_MetaBox::createMultiple(KT_ZZZ_Post_Config::getAllGenericFieldsets(), KT_WP_POST_KEY, KT_MetaBox_Data_Type_Enum::POST_META); // --- page ------------------------ KT_MetaBox::createMultiple(KT_ZZZ_Page_Config::getAllGenericFieldsets(), KT_WP_PAGE_KEY, KT_MetaBox_Data_Type_Enum::POST_META); // --- reference ------------------------ KT_MetaBox::createMultiple(KT_ZZZ_Reference_Config::getAllGenericFieldsets(), KT_ZZZ_REFERENCE_KEY, KT_MetaBox_Data_Type_Enum::POST_META); // --- competitive advantage ------------------------ KT_Metabox::createCrud(KT_ZZZ_Competitive_Advantage_Config::getDetailFieldset(), KT_Custom_Metaboxes_Page::getCustomMetaboxPageScreenName(KT_ZZZ_Competitive_Advantage_Model::PREFIX), "KT_ZZZ_Competitive_Advantage_Model", KT_ZZZ_Competitive_Advantage_Model::ID_COLUMN); // --- content ------------------------ foreach (array(KT_WP_POST_KEY, KT_WP_PAGE_KEY) as $postType) { $pageShortcodesMetabox = KT_MetaBox::createCustom("kt-zzz-{$postType}-shortcodes-metabox", __("Obsahové zktratky", "ZZZ_ADMIN_DOMAIN"), $postType, "kt_zzz_content_shortcodes_metabox_callback", false); $pageShortcodesMetabox->setContext(KT_MetaBox::CONTEXT_SIDE); $pageShortcodesMetabox->setPriority(KT_MetaBox::PRIORITY_LOW); $pageShortcodesMetabox->register(); } function kt_zzz_content_shortcodes_metabox_callback() { echo "<ol>"; echo "<li><b>[zzz_row_start]</b> - <i>začátek řádku</i></li>"; echo "<li><b>[zzz_column_start]</b> - <i>začátek sloupce</i></li>"; echo "<li><b>[zzz_column_end]</b> - <i>konec sloupce</i></li>"; echo "<li><b>[zzz_row_end]</b> - <i>konec řádku</i></li>";
/** * Funce zajistí načtení, resp. vrácení cookie statement obsahu ajaxem * * @author Martin Hlaváč * @link http://www.ktstudio.cz */ function kt_load_cookie_statement_content_callback() { die(KT_WP_Configurator::getCookieStatementHtml()); }