本文整理汇总了PHP中TitanFrameworkOption类的典型用法代码示例。如果您正苦于以下问题:PHP TitanFrameworkOption类的具体用法?PHP TitanFrameworkOption怎么用?PHP TitanFrameworkOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TitanFrameworkOption类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createOption
public function createOption($settings)
{
if (!apply_filters('tf_create_option_continue_' . $this->owner->owner->optionNamespace, true, $settings)) {
return null;
}
$obj = TitanFrameworkOption::factory($settings, $this);
$this->options[] = $obj;
do_action('tf_create_option_' . $this->owner->owner->optionNamespace, $obj);
return $obj;
}
示例2: createOption
public function createOption($settings)
{
$obj = TitanFrameworkOption::factory($settings, $this);
// $obj = new TitanFrameworkOption( $settings, $this );
$this->options[] = $obj;
if (!empty($obj->settings['id'])) {
$this->owner->optionsUsed[$obj->settings['id']] = $obj;
}
do_action('tf_create_option', $obj);
return $obj;
}
示例3: init_group_options
/**
* Creates the options contained in the group. Mimics how Admin pages
* create options.
*
* @return void
*/
public function init_group_options()
{
if (!empty($this->settings['options'])) {
if (is_array($this->settings['options'])) {
foreach ($this->settings['options'] as $settings) {
if (!apply_filters('tf_create_option_continue_' . $this->getOptionNamespace(), true, $settings)) {
continue;
}
$obj = TitanFrameworkOption::factory($settings, $this->owner);
$this->options[] = $obj;
do_action('tf_create_option_' . $this->getOptionNamespace(), $obj);
}
}
}
}
示例4: insertOptionBefore
public function insertOptionBefore($settings, $index = null, $overwrite = false)
{
if (is_null($index)) {
return $this->createOption($settings);
}
if (!apply_filters('tf_create_option_continue_' . $this->owner->optionNamespace, true, $settings)) {
return null;
}
$obj = TitanFrameworkOption::factory($settings, $this);
$count = count($this->options);
if (!$overwrite) {
for ($i = $count - 1; $i >= $index; $i--) {
$this->options[$i + 1] = $this->options[$i];
}
}
$this->options[$index] = $obj;
do_action('tf_create_option_' . $this->owner->optionNamespace, $obj);
return $obj;
}
示例5: addSubSection
/**
* Store Subsection
*
* @return void
*/
public function addSubSection($settings)
{
$this->subID = $settings['id'];
$settings['capability'] = 'edit_theme_options';
if (!apply_filters('tf_create_option_continue_' . $this->owner->optionNamespace, true, $settings)) {
return null;
}
$objx = TitanFrameworkOption::factory($settings, $this);
$this->subSec[] = $objx;
do_action('tf_create_option_' . $this->owner->optionNamespace, $objx);
return $objx;
}
示例6: array
/**
* Constructor
*
* @since 1.4
*/
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
add_action('admin_enqueue_scripts', array($this, 'enqueueSlider'));
add_action('customize_controls_enqueue_scripts', array($this, 'enqueueSlider'));
add_action('admin_head', array(__CLASS__, 'createSliderScript'));
}
示例7: array
/**
* Constructor
*
* @return void
* @since 1.5
*/
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
add_filter('tf_generate_css_upload_' . $this->getOptionNamespace(), array($this, 'generateCSS'), 10, 2);
add_action('tf_livepreview_pre_' . $this->getOptionNamespace(), array($this, 'preLivePreview'), 10, 3);
add_action('tf_livepreview_post_' . $this->getOptionNamespace(), array($this, 'postLivePreview'), 10, 3);
}
示例8: array
/**
* Constructor
*
* @param array $settings Option settings
* @param string $owner Namespace
*
* @since 1.9.3
*/
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
tf_add_action_once('admin_enqueue_scripts', array($this, 'load_select_scripts'));
tf_add_action_once('customize_controls_enqueue_scripts', array($this, 'load_select_scripts'));
tf_add_action_once('admin_head', array($this, 'init_select_script'));
tf_add_action_once('customize_controls_print_footer_scripts', array($this, 'init_select_script'));
}
示例9: array
/**
* Constructor
*
* @return void
* @since 1.4
*/
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
add_action('admin_enqueue_scripts', array($this, "loadAdminScripts"));
add_action('customize_controls_enqueue_scripts', array($this, 'loadAdminScripts'));
add_action('admin_head', array(__CLASS__, 'createFontScript'));
add_action('tf_create_option_' . $this->getOptionNamespace(), array($this, "rememberGoogleFonts"));
add_action('wp_enqueue_scripts', array($this, "enqueueGooglefonts"));
add_filter('tf_generate_css_font_' . $this->getOptionNamespace(), array($this, 'generateCSS'), 10, 2);
}
示例10: array
/**
* Constructor
*
* @since 1.4
*/
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
add_action('admin_enqueue_scripts', array($this, 'enqueueDatepicker'));
add_action('customize_controls_enqueue_scripts', array($this, 'enqueueDatepicker'));
add_action('admin_head', array(__CLASS__, 'createCalendarScript'));
if (empty(self::$date_epoch)) {
self::$date_epoch = date('Y-m-d', 0);
}
}
示例11: array
/**
* Constructor
*
* @since 1.4
*/
function __construct($settings, $owner)
{
if (defined('WP_DEBUG')) {
if (WP_DEBUG == true) {
// Warn about deprecation, refer to `font` option
TitanFramework::displayFrameworkError(sprintf(__('%s has been deprecated and will be removed in version %s! Please use %s instead to avoid errors in the future.', TF_I18NDOMAIN), '<code>select-googlefont</code>', '<code>1.5</code>', '<code>font</code>'));
}
}
parent::__construct($settings, $owner);
add_filter('tf_generate_css_select-googlefont_' . $this->getOptionNamespace(), array($this, 'generateCSS'), 10, 2);
}
示例12: array
/**
* Constructor
*
* @since 1.3
*/
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
add_action('admin_enqueue_scripts', array($this, "loadAdminScripts"));
add_action('customize_controls_enqueue_scripts', array($this, 'loadAdminScripts'));
// CSS generation for CSS code langs
add_filter('tf_generate_css_code_' . $this->getOptionNamespace(), array($this, "generateCSSCode"), 10, 2);
add_filter('wp_head', array($this, "printCSSForPagesAndPosts"), 100);
// JS inclusion for Javascript code langs
add_filter('wp_footer', array($this, "printJS"), 100);
add_filter('wp_footer', array($this, "printJSForPagesAndPosts"), 101);
}
示例13: array
/**
* Constructor
*
* @return void
* @since 1.4
*/
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
tf_add_action_once('admin_enqueue_scripts', array($this, 'loadAdminScripts'));
tf_add_action_once('customize_controls_enqueue_scripts', array($this, 'loadAdminScripts'));
tf_add_action_once('admin_head', array(__CLASS__, 'createFontScript'));
tf_add_action_once('wp_enqueue_scripts', array($this, 'enqueueGooglefonts'));
add_filter('tf_generate_css_font_' . $this->getOptionNamespace(), array($this, 'generateCSS'), 10, 2);
// Customizer preview handling
tf_add_action_once('tf_generate_customizer_preview_js', array($this, 'generateCustomizerPreviewJS'));
tf_add_filter_once('tf_generate_customizer_preview_css_' . $this->getOptionNamespace(), array($this, 'generateCustomizerPreviewCSS'));
if ($this->settings['enqueue']) {
self::$optionsToEnqueue[] = $this;
}
}
示例14: array
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
add_action('tf_livepreview_pre_' . $this->getOptionNamespace(), array($this, 'preLivePreview'), 10, 3);
}
示例15: array
function __construct($settings, $owner)
{
parent::__construct($settings, $owner);
add_action("admin_enqueue_scripts", array($this, 'enqueueScripts'));
}