本文整理汇总了PHP中SiteOrigin_Widget类的典型用法代码示例。如果您正苦于以下问题:PHP SiteOrigin_Widget类的具体用法?PHP SiteOrigin_Widget怎么用?PHP SiteOrigin_Widget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SiteOrigin_Widget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Get the form options and allow child widgets to modify that form.
*
* @param bool|SiteOrigin_Widget $parent
*
* @return mixed
*/
function form_options($parent = false)
{
$form_options = $this->modify_form($this->form_options);
if (!empty($parent)) {
$form_options = $parent->modify_child_widget_form($form_options, $this);
}
// Give other plugins a way to modify this form.
$form_options = apply_filters('siteorigin_widgets_form_options', $form_options, $this);
$form_options = apply_filters('siteorigin_widgets_form_options_' . $this->id_base, $form_options, $this);
return $form_options;
}
示例2: create_field
public function create_field($field_name, $field_options, SiteOrigin_Widget $for_widget, $for_repeater = array(), $is_template = false)
{
$element_id = $for_widget->so_get_field_id($field_name, $for_repeater, $is_template);
$element_name = $for_widget->so_get_field_name($field_name, $for_repeater);
$field_class = $this->get_field_class_name($field_options['type']);
if ($this->is_container_type($field_options['type'])) {
return new $field_class($field_name, $element_id, $element_name, $field_options, $for_widget, $for_repeater);
} else {
return new $field_class($field_name, $element_id, $element_name, $field_options);
}
}
示例3: create_field
public function create_field($field_name, $field_options, SiteOrigin_Widget $for_widget, $for_repeater = array(), $is_template = false)
{
$element_id = $for_widget->so_get_field_id($field_name, $for_repeater, $is_template);
$element_name = $for_widget->so_get_field_name($field_name, $for_repeater);
if (empty($field_options['type'])) {
$field_options['type'] = 'text';
$field_options['label'] = __('This field does not have a type. Please specify a type for it to be rendered correctly.', 'so-widgets-bundle');
}
$field_class = $this->get_field_class_name($field_options['type']);
// If we still don't have a class use the 'SiteOrigin_Widget_Field_Error' class to indicate this to the user.
if (!class_exists($field_class)) {
return new SiteOrigin_Widget_Field_Error('', '', '', array('type' => 'error', 'message' => 'The class \'' . $field_class . '\' could not be found. Please make sure you specified the correct field type and that the class exists.'));
}
return new $field_class($field_name, $element_id, $element_name, $field_options, $for_widget, $for_repeater);
}
示例4: create_field
public function create_field($field_name, $field_options, SiteOrigin_Widget $for_widget, $for_repeater = array(), $is_template = false)
{
$element_id = $for_widget->so_get_field_id($field_name, $for_repeater, $is_template);
$element_name = $for_widget->so_get_field_name($field_name, $for_repeater);
if (empty($field_options['type'])) {
$field_options['type'] = 'text';
$field_options['label'] = __('This field does not have a type. Please specify a type for it to be rendered correctly.', 'siteorigin-widgets');
}
$field_class = $this->get_field_class_name($field_options['type']);
if ($this->is_container_type($field_options['type'])) {
return new $field_class($field_name, $element_id, $element_name, $field_options, $for_widget, $for_repeater);
} else {
return new $field_class($field_name, $element_id, $element_name, $field_options);
}
}
示例5: array
function enqueue_frontend_scripts($instance)
{
wp_enqueue_script('iw-folio-js', siteorigin_widget_get_plugin_dir_url('ink-folio') . 'scripts/folio.js', array('iw-mixitup-js'), INKED_SO_WIDGETS);
wp_enqueue_script('ink-folio-init', siteorigin_widget_get_plugin_dir_url('ink-folio') . 'scripts/equalizer.init.js', array('iw-equalizer-js'), INKED_SO_WIDGETS, true);
wp_enqueue_style('iw-folio', siteorigin_widget_get_plugin_dir_url('ink-folio') . 'styles/folio.css', array(), INKED_SO_WIDGETS);
parent::enqueue_frontend_scripts($instance);
}
示例6: render_after_field
protected function render_after_field($value, $instance)
{
if (!empty($this->fallback)) {
$fallback_name = $this->get_fallback_field_name($this->base_name);
$fallback_url = !empty($instance[$fallback_name]) ? $instance[$fallback_name] : '';
?>
<input type="text" value="<?php
echo esc_url($fallback_url);
?>
"
placeholder="<?php
esc_attr_e('External URL', 'siteorigin-widgets');
?>
"
name="<?php
echo esc_attr($this->for_widget->so_get_field_name($this->base_name . '_fallback', $this->parent_repeater));
?>
"
class="media-fallback-external siteorigin-widget-input" />
<div class="clear"></div>
<?php
} else {
?>
<div class="clear"></div>
<?php
}
//Still want the default description, if there is one.
parent::render_after_field($value, $instance);
}
示例7: array
function enqueue_frontend_scripts($instance)
{
wp_register_script('iw-alert-js', siteorigin_widget_get_plugin_dir_url('ink-alert') . 'scripts/alert.js', array('iw-foundation-js'), INKED_SO_WIDGETS, true);
wp_enqueue_script('iw-alert-init', siteorigin_widget_get_plugin_dir_url('ink-alert') . 'scripts/alert.init.js', array('iw-alert-js'), INKED_SO_WIDGETS, true);
wp_enqueue_style('iw-alert', siteorigin_widget_get_plugin_dir_url('ink-alert') . 'styles/alert.css', array(), INKED_SO_WIDGETS);
parent::enqueue_frontend_scripts($instance);
}
示例8: array
function enqueue_frontend_scripts($instance)
{
parent::enqueue_frontend_scripts($instance);
wp_enqueue_style('magnific-popup', RESWP_THEME_URL . 'inc/siteorigin-widgets/assets/css/magnific-popup.css');
wp_enqueue_script('magnific-popup', RESWP_THEME_URL . 'inc/siteorigin-widgets/assets/js/jquery.magnific-popup.min.js', array('jquery'), '1.0.0', true);
wp_enqueue_script('erm-front', RESWP_THEME_URL . 'inc/siteorigin-widgets/assets/js/erm-front-scripts.js', array('jquery'), '', true);
}
示例9: array
function enqueue_frontend_scripts($instance)
{
wp_register_script('iw-accordion-js', siteorigin_widget_get_plugin_dir_url('ink-accordion') . 'scripts/accordion.js', array('iw-foundation-js'), INKED_SO_WIDGETS, true);
wp_enqueue_script('iw-filter-init', siteorigin_widget_get_plugin_dir_url('ink-filt-ardn') . 'scripts/filter.init.js', array('iw-accordion-js', 'iw-mixitup-js'), INKED_SO_WIDGETS, true);
wp_enqueue_style('iw-filt-ardn', siteorigin_widget_get_plugin_dir_url('ink-filt-ardn') . 'styles/accordion.css', array(), INKED_SO_WIDGETS);
parent::enqueue_frontend_scripts($instance);
}
示例10: array
function enqueue_frontend_scripts($instance)
{
if (isset($instance['visibility']) && $instance['visibility'] == 'yes') {
wp_enqueue_script('emptyspace', siteorigin_widget_get_plugin_dir_url('lrw-empty-space') . 'assets/js/jquery.emptyspace.js', array('jquery'), LRW_BUNDLE_VERSION);
}
parent::enqueue_frontend_scripts($instance);
}
示例11: array
function enqueue_frontend_scripts($instance)
{
if (!empty($instance['trigger'])) {
wp_enqueue_script('waypoints', plugin_dir_url(LRW_BASE_FILE) . 'inc/assets/js/waypoints.min.js', array('jquery'), LRW_BUNDLE_VERSION);
}
parent::enqueue_frontend_scripts($instance);
}
示例12: array
function enqueue_frontend_scripts($instance)
{
parent::enqueue_frontend_scripts($instance);
wp_enqueue_style('Google-MrDeHaviland-Font', '//fonts.googleapis.com/css?family=Mr+De+Haviland');
wp_enqueue_script('ResWP-Moment', RESWP_THEME_URL . 'inc/siteorigin-widgets/open-table/js/moment.js', array('jquery'), '2.10.6', true);
wp_enqueue_script('ResWP-Pikaday', RESWP_THEME_URL . 'inc/siteorigin-widgets/open-table/js/pikaday.js', array('ResWP-Moment'), '1.4.0', true);
}
示例13: array
function __construct()
{
parent::__construct(
'faqs',
__('Faqs', 'addon-so-widgets-bundle'),
array(
'description' => __('FAQs Component', 'addon-so-widgets-bundle'),
'panels_icon' => 'dashicons dashicons-exerpt-view',
'panels_groups' => array('addonso')
),
array(),
array(
'widget_title' => array(
'type' => 'text',
'label' => __('Widget Title.', 'addon-so-widgets-bundle'),
'default' => ''
),
'posts' => array(
'type' => 'posts',
'label' => __('Select FAQs', 'addon-so-widgets-bundle'),
),
'faqs_styling' => array(
'type' => 'section',
'label' => __( 'Widget styling' , 'widget-form-fields-text-domain' ),
'hide' => true,
'fields' => array(
'title_color' => array(
'type' => 'color',
'label' => __( 'Title color', 'widget-form-fields-text-domain' ),
'default' => ''
),
'title_hover_color' => array(
'type' => 'color',
'label' => __( 'Title Hover color', 'widget-form-fields-text-domain' ),
'default' => ''
),
'content_color' => array(
'type' => 'color',
'label' => __( 'Content color', 'widget-form-fields-text-domain' ),
'default' => ''
),
)
),
),
plugin_dir_path(__FILE__)
);
}
示例14: array
function enqueue_frontend_scripts($instance)
{
wp_enqueue_style('lsow-button', siteorigin_widget_get_plugin_dir_url('lsow-button') . 'css/style.css', array(), LSOW_VERSION);
$custom_css = $this->custom_css($instance);
if (!empty($custom_css)) {
wp_add_inline_style('lsow-button', $custom_css);
}
parent::enqueue_frontend_scripts($instance);
}
示例15: array
function enqueue_frontend_scripts($instance)
{
parent::enqueue_frontend_scripts($instance);
wp_enqueue_style('magnific-popup', RESWP_THEME_URL . 'inc/siteorigin-widgets/assets/css/magnific-popup.css');
wp_enqueue_script('magnific-popup', RESWP_THEME_URL . 'inc/siteorigin-widgets/assets/js/jquery.magnific-popup.min.js', array('jquery'), '', true);
wp_enqueue_script('erm-front', RESWP_THEME_URL . 'inc/siteorigin-widgets/assets/js/erm-front-scripts.js', array('jquery'), '', true);
wp_enqueue_script('jquery-mixitup', RESWP_THEME_URL . 'inc/siteorigin-widgets/filter-restaurant-menu/js/jquery.mixitup.min.js', array('jquery'), '2.1.11', true);
wp_enqueue_script('restaurant_wp_mixitup', RESWP_THEME_URL . 'inc/siteorigin-widgets/filter-restaurant-menu/js/restaurant_wp_mixitup.js', array('jquery-mixitup'), RESWP_THEME_VERSION, true);
}