'thk_qr_code', 'description' => __( 'QR Code', 'luxeritas' ) );
parent::__construct( 'thk_qr_code', '#9 ' . __( 'QR Code', 'luxeritas' ) . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops );
}
public function widget( $args, $instance ) {
global $_is;
$title = ( !empty( $instance['title'] ) ) ? $instance['title'] : '';
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
$width_height = isset( $instance['size'] ) ? (int)$instance['size'] : 250;
$margin = isset( $instance['margin'] ) ? (int)$instance['margin'] : 0;
$description = isset( $instance['description'] ) ? esc_attr( $instance['description'] ) : __( 'QR Code', 'luxeritas' );
$bgcolor = !empty( $instance['bgcolor'] ) && $instance['bgcolor'] !== '#ffffff' ? '&bgcolor=' . str_replace( '#', '', $instance['bgcolor'] ) : '';
$align = '';
if( $width_height < 40 ) $width_height = 40;
if( $margin < 0 ) $margin = 0;
if( isset( $instance['align'] ) ) {
if( $instance['align'] === 'center' ) {
$align = ' class="aligncenter"';
}
elseif( $instance['align'] === 'right' ) {
$align = ' class="alignright"';
}
}
//$format = '
'thk_recent_posts', 'description' => __( 'Recent posts', 'luxeritas' ) ); parent::__construct( 'thk_recent_posts', '#5 ' . __( 'Recent posts', 'luxeritas' ) . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); } public static function term_style() { // 横長サムネイル使用時の figure (.term) の style。AMP の時は thk_widget_concat で呼び出す return <<< TERM_STYLE float: none; overflow: hidden; margin: 0 0 16px; max-width: 388px; max-height: 218px; TERM_STYLE; } public static function img_style() { // 横長サムネイル使用時の img の style。AMP の時は thk_widget_concat で呼び出す return <<< IMG_STYLE margin: 0; padding: 0; border: 0; min-width: 100%; max-width: none; max-height: none; IMG_STYLE; } public function widget( $args, $instance ) { $title = !empty( $instance['title'] ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $cat = !empty( $instance['cat'] ) ? absint( $instance['cat'] ) : 0; $sort = !empty( $instance['sort'] ) && absint( $instance['sort'] ) === 1 ? 'modified' : 'date'; $number = !empty( $instance['number'] ) ? absint( $instance['number'] ) : 5; if( empty( $number ) ) $number = 5; $thumb_type = isset( $instance['thumb_type'] ) ? $instance['thumb_type'] : 'suqare'; $cat_tag = isset( $instance['cat_tag'] ) ? $instance['cat_tag'] : 'cat'; $date = isset( $instance['date'] ) ? $instance['date'] : 0; $excerpt = isset( $instance['excerpt'] ) ? $instance['excerpt'] : 0; $thumbnail = isset( $instance['thumbnail'] ) ? $instance['thumbnail'] : 0; echo $args['before_widget']; if( !empty( $title ) ) echo $args['before_title'], $title, $args['after_title']; if( $thumb_type === 'wide' ) { global $luxe; if( !isset( $luxe['amp'] ) ) { $term_style = '#' . $args['widget_id'] . ' .term {' . thk_recent_posts::term_style() . '}'; $img_style = '#' . $args['widget_id'] . ' .term img {' . thk_recent_posts::img_style() . '}'; ?>
| __( 'All Categories', 'luxeritas' ), 'id' => $this->get_field_id( 'cat' ), 'name' => $this->get_field_name( 'cat' ), 'selected' => $cat ) ) ?> | |
| /> |
| /> |
| /> |
/>
/>
/>
'thk_follow_button', 'description' => __( 'SNS Follow Button', 'luxeritas' ) ); parent::__construct( 'thk_follow_button', '#7 ' . __( 'SNS Follow Button', 'luxeritas' ) . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); } public function widget( $args, $instance ) { global $luxe, $awesome; $title = ( !empty( $instance['title'] ) ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if( !empty( $title ) ) echo $args['before_title'], $title, $args['after_title']; if( isset( $instance['twitter'] ) || isset( $instance['facebook'] ) || isset( $instance['instagram'] ) || isset( $instance['pinit'] ) || isset( $instance['hatena'] ) || isset( $instance['youtube'] ) || isset( $instance['line'] ) || isset( $instance['rss'] ) || isset( $instance['feedly'] ) ) { $publisher = 'Person'; if( $luxe['site_name_type'] === 'Organization' ) { $publisher = 'Organization'; } $author = ''; if( isset( $instance['twitter_id'] ) ) { $author = $instance['twitter_id']; } elseif( $luxe['site_name_type'] === 'Organization' ) { $author = get_bloginfo( 'name' ); } else { $auth = get_users(); $author = get_the_author_meta( 'user_nicename', $auth[0]->ID ); } ?>
/>
/>
/>
:
:
:
/>
/>
'thk_rss_feedly', 'description' => __( 'RSS / Feedly Button', 'luxeritas' ) ); parent::__construct( 'thk_rss_feedly', '#8 ' . __( 'RSS / Feedly Button', 'luxeritas' ) . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); } public function widget( $args, $instance ) { global $awesome; $title = ( !empty( $instance['title'] ) ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if( !empty( $title ) ) echo $args['before_title'], $title, $args['after_title']; ?>'thk_adsense_widget', 'description' => __( 'It's mainly for adsense, but you can write whatever you like text, HTML, shortcode etc.', 'luxeritas' ) . __( 'This widget can be switched between "show / hide" on the specified page.', 'luxeritas' ) ); parent::__construct( 'thk_adsense_widget', '#1 ' . __( 'Advertising / Adsense', 'luxeritas' ) . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); global $_is; if( $_is['admin'] === true ) { $this->_pages = array( 'preview' => __( 'Preview page', 'luxeritas' ), 'customize' => __( 'Customize preview page', 'luxeritas' ), 'is404' => __( '404 Not Found page', 'luxeritas' ), 'search' => __( 'Search result page', 'luxeritas' ), 'archive' => __( 'Archive', 'luxeritas' ), 'category' => __( 'Category', 'luxeritas' ), 'page' => __( 'Static page', 'luxeritas' ), 'single' => __( 'Post page', 'luxeritas' ), 'top' => __( 'Top page', 'luxeritas' ), 'specified' => __( 'Specified page', 'luxeritas' ) . ' ( ' . __( 'Specify post IDs separated by commas or line feeds', 'luxeritas' ) . ' )' ); $this->_adsense = array( 'none' => __( 'Not specified', 'luxeritas' ), 'ad-250-250' => '250x250px ( Square )', 'ad-300-250' => '300x250px ( Rectangle )', 'ad-336-280' => '336x280px ( Rectangle big )', 'ad-120-600' => '120x600px ( Skyscraper )', 'ad-160-600' => '160x600px ( Wide skyscraper )', 'ad-300-600' => '300x600px ( Large skyscraper )', 'ad-468-60' => '468x60px ( Banner )', 'ad-728-90' => '728x90px ( Big banner )', 'ad-970-90' => '970x90px ( Large big banner )', 'ad-970-250' => '970x250px ( Billboard )', 'ad-320-100' => '320x100px ( Mobile banner )', 'ad-336-280-col-2' => '336x280px ( Rectangle big ' . __( 'Dual Ad horizon', 'luxeritas' ) . ' )', 'ad-336-280-row-2' => '336x280px ( Rectangle big ' . __( 'Dual Ad vertical', 'luxeritas' ) . ' )', 'ad-300-250-col-2' => '300x250px ( Rectangle ' . __( 'Dual Ad horizon', 'luxeritas' ) . ' )', 'ad-300-250-row-2' => '300x250px ( Rectangle ' . __( 'Dual Ad vertical', 'luxeritas' ) . ' )', ); $this->_label = array( 'none' => __( 'None', 'luxeritas' ), 'sponsored-links' => __( 'Sponsored Links', 'luxeritas' ), 'advertisement' => __( 'Advertisement', 'luxeritas' ), ); } } public function widget( $args, $instance ) { global $_is; if( ( isset( $instance['preview'] ) && $_is['preview'] === true ) || ( isset( $instance['customize'] ) && $_is['customize_preview'] === true ) || ( isset( $instance['is404'] ) && $_is['404'] === true ) || ( isset( $instance['search'] ) && $_is['search'] === true ) || ( isset( $instance['archive'] ) && $_is['archive'] === true && $_is['category'] === false ) || ( isset( $instance['category'] ) && $_is['category'] === true ) || ( isset( $instance['page'] ) && $_is['page'] === true && $_is['front_page'] === false ) || ( isset( $instance['single'] ) && $_is['single'] === true ) || ( isset( $instance['top'] ) && ( $_is['home'] === true || $_is['front_page'] === true ) ) ) { return; } if( isset( $instance['specified'] ) && !empty( $instance['ids'] ) ) { $specifieds = array(); $arr = explode( ',', $instance['ids'] ); foreach( (array)$arr as $value ) { $specifieds = array_merge( $specifieds, explode( "\n", $value ) ); } foreach( (array)$specifieds as $val ) { if( (int)$val === get_the_ID() ) { return; } } } $title = ( !empty( $instance['title'] ) ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); if( !empty( $instance['text'] ) ) { $instance['text'] = shortcode_unautop( $instance['text'] ); $instance['text'] = do_shortcode( $instance['text'] ); } $headline = ''; $about = ''; $label = ''; $args['before_widget'] = str_replace( 'thk_adsense_', 'thk_ps_', $args['before_widget'] ); if( isset( $instance['center'] ) ) { $args['before_widget'] = str_replace( 'class="widget ', 'class="widget al-c ', $args['before_widget'] ); } if( isset( $instance['wpadblock'] ) ) { $args['before_widget'] = str_replace( '
' . __( 'Advertisement', 'luxeritas' ) . '
'; } else { $label = '' . __( 'Sponsored Links', 'luxeritas' ) . '
'; } } if( isset( $instance['text'] ) && stripos( $instance['text'], 'data-full-width-responsive' ) !== false ) { if( isset( $instance['fullwidth'] ) && (int)$instance['fullwidth'] === 0 ) { $instance['text'] = str_replace( "'", '"', $instance['text'] ); $instance['text'] = str_replace( 'data-full-width-responsive="true"', 'data-full-width-responsive="false"', $instance['text'] ); } } if( isset( $instance['adsense'] ) ) { if( $instance['adsense'] === 'ad-250-250' ) { $instance['text'] = preg_replace( '/data-ad-format=[\"|\'][a-z]+?[\"|\']/', 'data-ad-format="rectangle"', $instance['text'] ); echo str_replace( 'ps-wrap', 'ps-wrap ps-250-250', $wrap ), $label; ?>
:
_adsense as $key => $val ) { ?>/>
'; } } ?>/>
data-full-width-responsive :
/>
/>
:
_label as $key => $val ) { ?>/>
/>
:
/>
/>
/>
'thk_swiper_widget', 'description' => __( 'High feature carousel slider. This widget is not displayed in AMP.', 'luxeritas' ), ); parent::__construct( 'thk_swiper_widget', '#4 ' . __( 'Carousel Slider', 'luxeritas') . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); global $_is; if( $_is['admin'] === true ) { $this->_pages = array( 'top' => __( 'Top page', 'luxeritas' ), 'category' => __( 'Category', 'luxeritas' ), 'archive' => __( 'Archive', 'luxeritas' ), 'single' => __( 'Post page', 'luxeritas' ), 'page' => __( 'Static page', 'luxeritas' ), ); $this->_types = array( 'cat_list' => __( 'Latest list of categories to belong', 'luxeritas' ), 'tag_list' => __( 'Latest list of tags to belong', 'luxeritas' ), 'all_list' => __( 'Latest list of all posts', 'luxeritas' ), 'page_list' => __( 'Latest list of static pages', 'luxeritas' ), 'specified' => __( 'Specified page', 'luxeritas' ) . ' ( ' . __( 'Specify post IDs separated by commas or line feeds', 'luxeritas' ) . ' )' ); $sizes = array(); $image_sizes = get_intermediate_image_sizes(); foreach( $image_sizes as $size ) { if( in_array( $size, array( 'thumbnail', 'medium', 'large' ) ) ) { $sizes[$size] = get_option( $size . '_size_w' ); } } $this->_thumb = array( 'thumbnail' => 'thumbnail ( ' . $sizes['thumbnail'] . 'px )', 'medium' => 'medium ( ' . $sizes['medium'] . 'px )', 'thumb320' => '320x180px ( 320x180px )', 'large' => 'large ( ' . $sizes['large'] . 'px )', 'full' => 'full ( Original resolution )', ); $this->_nav = array( 'none' => __( 'None', 'luxeritas' ), 'bullets' => __( 'Bullets', 'luxeritas' ), 'fraction' => __( 'Fraction', 'luxeritas' ), 'progress' => __( 'Progress bar', 'luxeritas' ), ); $this->_nxt_prv = array( 'none' => __( 'None', 'luxeritas' ), 'always' => __( 'Always display', 'luxeritas' ), 'hover' => __( 'Displayed only when mouse hover', 'luxeritas' ), ); $this->_efect = array( 'none' => __( 'None', 'luxeritas' ), 'coverflow' => __( '3D animation', 'luxeritas' ) . ' ( 3D Cover Flow )', 'flip' => __( 'Rotate on mouse over', 'luxeritas' ), 'highlight' => __( 'Display active slide a little larger', 'luxeritas' ), ); $this->_center = array( 'post' => __( 'Display the displayed post in the center', 'luxeritas' ), 'new' => __( 'Display the latest post in the center', 'luxeritas' ), 'order' => __( 'Display in order of posting date / time', 'luxeritas' ), ); } $this->_defaults = array( 'title' => '', 'item_types' => 'cat_list', 'ids' => '', 'thumbnail' => 'medium', 'item_max' => 10, 'show_max' => 5, 'height' => 'auto', 'height_px' => 300, 'width' => 'auto', 'slide_bg' => '#ffffff', 'navigation' => 'bullets', 'next_prev' => 'hover', 'nav_color' => '#007aff', 'efect' => 'none', 'center_view' => 'post', 'darkness' => '', 'no_lazyload' => '', 'autoplay' => 0, 'bg_color' => '', ); } public function widget( $args, $instance ) { global $luxe, $_is; if( isset( $luxe['amp'] ) ) return; foreach( $this->_defaults as $key => $val ) { if( !isset( $instance[$key] ) ) { $instance[$key] = $val; } } if( ( $_is['home'] === true && $_is['front_page'] === false ) || ( $_is['home'] === false && $_is['front_page'] === false && $_is['archive'] === false && $_is['singular'] === false ) ) { return; } if( ( !isset( $instance['top'] ) && ( $_is['home'] === true || $_is['front_page'] === true ) ) || ( !isset( $instance['category'] ) && $_is['category'] === true ) || ( !isset( $instance['archive'] ) && $_is['archive'] === true && $_is['category'] === false ) || ( !isset( $instance['single'] ) && $_is['single'] === true ) || ( !isset( $instance['page'] ) && $_is['page'] === true && $_is['front_page'] === false ) ) { return; } $title = ( !empty( $instance['title'] ) ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); require_once( INC . 'thk-swiper.php' ); $autoplay = (int)$instance['autoplay'] * 1000; thk_swiper( $args, $title, $instance['item_types'], $instance['item_max'], $instance['show_max'], $instance['navigation'], $instance['next_prev'], $instance['nav_color'], $instance['ids'], $instance['thumbnail'], $instance['height'], $instance['height_px'], $instance['width'], $instance['slide_bg'], $instance['titleview'], $instance['efect'], $instance['darkness'], $instance['center_view'], $instance['no_lazyload'], $autoplay ); } public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = isset( $new_instance['title'] ) ? sanitize_text_field( $new_instance['title'] ) : null; $instance['item_types'] = isset( $new_instance['item_types'] ) ? $new_instance['item_types'] : null; $instance['ids'] = isset( $new_instance['ids'] ) ? wp_kses_post( $new_instance['ids'] ) : null; $instance['thumbnail'] = isset( $new_instance['thumbnail'] ) ? $new_instance['thumbnail'] : null; $instance['item_max'] = (int)$new_instance['item_max'] < 1 ? 1 : (int)$new_instance['item_max']; $instance['show_max'] = (int)$new_instance['show_max'] >= (int)$new_instance['item_max'] ? (int)$instance['item_max'] - 1 : (int)$new_instance['show_max']; $instance['show_max'] = (int)$instance['show_max'] < 1 ? 1 : (int)$instance['show_max']; $instance['height'] = isset( $new_instance['height'] ) ? $new_instance['height'] : null; $instance['height_px'] = isset( $new_instance['height_px'] ) ? (int)$new_instance['height_px'] : null; $instance['width'] = isset( $new_instance['width'] ) ? $new_instance['width'] : null; $instance['slide_bg'] = isset( $new_instance['slide_bg'] ) ? $new_instance['slide_bg'] : null; $instance['navigation'] = isset( $new_instance['navigation'] ) ? $new_instance['navigation'] : null; $instance['next_prev'] = isset( $new_instance['next_prev'] ) ? $new_instance['next_prev'] : null; $instance['nav_color'] = isset( $new_instance['nav_color'] ) ? $new_instance['nav_color'] : null; $instance['efect'] = isset( $new_instance['efect'] ) ? $new_instance['efect'] : null; $instance['center_view'] = isset( $new_instance['center_view'] ) ? $new_instance['center_view'] : null; $instance['titleview'] = isset( $new_instance['titleview'] ) ? $new_instance['titleview'] : null; $instance['darkness'] = isset( $new_instance['darkness'] ) ? $new_instance['darkness'] : null; $instance['no_lazyload'] = isset( $new_instance['no_lazyload'] ) ? $new_instance['no_lazyload'] : null; $instance['autoplay'] = isset( $new_instance['autoplay'] ) ? (int)$new_instance['autoplay'] : null; foreach( $this->_pages as $key => $val ) { $instance[$key] = $new_instance[$key]; } return $instance; } public function form( $instance ) { $title = isset( $instance['title'] ) ? sanitize_text_field( $instance['title'] ) : $this->_defaults['title']; $types = isset( $instance['item_types'] ) ? $instance['item_types'] : $this->_defaults['item_types']; $ids = isset( $instance['ids'] ) ? wp_kses_post( $instance['ids'] ) : $this->_defaults['ids']; $thumb = isset( $instance['thumbnail'] ) ? $instance['thumbnail'] : $this->_defaults['thumbnail']; $itemmax = isset( $instance['item_max'] ) ? (int)$instance['item_max'] : $this->_defaults['item_max']; $showmax = isset( $instance['show_max'] ) ? (int)$instance['show_max'] : $this->_defaults['show_max']; $height = isset( $instance['height'] ) ? $instance['height'] : $this->_defaults['height']; $heightpx= isset( $instance['height_px'] ) ? (int)$instance['height_px'] : $this->_defaults['height_px']; $width = isset( $instance['width'] ) ? $instance['width'] : $this->_defaults['width']; $nav = isset( $instance['navigation'] ) ? $instance['navigation'] : $this->_defaults['navigation']; $net_prv = isset( $instance['next_prev'] ) ? $instance['next_prev'] : $this->_defaults['next_prev']; $efect = isset( $instance['efect'] ) ? $instance['efect'] : $this->_defaults['efect']; $center = isset( $instance['center_view'] ) ? $instance['center_view'] : $this->_defaults['center_view']; $center = isset( $instance['center_view'] ) ? $instance['center_view'] : $this->_defaults['center_view']; $autoplay= isset( $instance['autoplay'] ) ? (int)$instance['autoplay'] : $this->_defaults['autoplay']; if( empty( $instance ) ) { $instance['top'] = 1; $instance['category'] = 1; $instance['archive'] = 1; $instance['single'] = 1; $instance['page'] = 1; $instance['slide_bg'] = $this->_defaults['slide_bg']; $instance['nav_color'] = $this->_defaults['nav_color']; $instance['titleview'] = 1; $instance['darkness'] = 0; $instance['no_lazyload'] = 0; } ?>:
_pages as $key => $val ) { ?>/>
:
_types as $key => $val ) { ?>/>
:
_thumb as $key => $val ) { ?>/>
/>
/>
/>
/>
/>
:
_nav as $key => $val ) { ?>/>
Next / Prev:
_nxt_prv as $key => $val ) { ?>/>
:
/>
/>
/>
/>
/>
'thk_toc_widget', 'description' => __( 'Insert table of contents.', 'luxeritas' ), ); parent::__construct( 'thk_toc_widget', '#3 ' . __( 'Table of Contents', 'luxeritas') . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); } public function widget( $args, $instance ) { global $luxe, $_is; if( ( $_is['single'] === true && isset( $luxe['toc_single_enable'] ) ) || ( $_is['page'] === true && isset( $luxe['toc_page_enable'] ) ) ) { global $wp_query; $title = ( !empty( $instance['title'] ) ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $post = get_post( $wp_query->post->ID ); $contents = $post->post_content; $toc_array = thk_create_toc( $contents, false ); if( !isset( $instance['no_contents'] ) || ( isset( $instance['no_contents'] ) && !empty( $toc_array[1] ) ) ) { echo $args['before_widget']; if( !empty( $title ) ) echo $args['before_title'], $title, $args['after_title']; } if( !empty( $toc_array[1] ) ) { echo ''; } if( !isset( $instance['no_contents'] ) || ( isset( $instance['no_contents'] ) && !empty( $toc_array[1] ) ) ) { echo $args['after_widget']; } } } public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = sanitize_text_field( $new_instance['title'] ); $instance['no_contents'] = isset( $new_instance['no_contents'] ) ? $new_instance['no_contents'] : null; return $instance; } public function form( $instance ) { $title = isset( $instance['title'] ) ? sanitize_text_field( $instance['title'] ) : __( 'Table of Contents', 'luxeritas' ); if( empty( $instance ) ) { $instance['no_contents'] = 1; } ?>
/>
'thk_reusable_blocks_widget', 'description' => __( 'Display selected reusable block.', 'luxeritas' ), ); parent::__construct( 'thk_reusable_blocks_widget', '#2 ' . __( 'Reusable Blocks', 'luxeritas' ) . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); } public function widget( $args, $instance ) { global $luxe; if( !empty( $instance['title'] ) ) { $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); $title = $args['before_title'] . $title . $args['after_title']; } else { $title = ''; } $objects = !empty( $instance['block_id'] ) ? get_post( $instance['block_id'], 'ARRAY_A', 'display' ) : ''; // 出力 if( empty( $objects['post_content'] ) ) { $block_contents = __( 'This content cannot be displayed in widgets.', 'luxeritas' ); } else { $block_contents = apply_filters( 'thk_content', $objects['post_content'] ); } echo $args['before_widget'], $title, $block_contents, $args['after_widget']; } public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = sanitize_text_field( $new_instance['title'] ); $instance['block_id'] = absint( $new_instance['block_id'] ); return $instance; } public function form( $instance ) { $title = isset( $instance['title'] ) ? sanitize_text_field( $instance['title'] ) : ''; $block_id = isset( $instance['block_id'] ) ? absint( $instance['block_id'] ) : ''; ?>
!empty( $block_id ) ? (int)$block_id : '', 'select_name' => $this->get_field_name( 'block_id' ), 'echo' => false, 'class' => 'widefat', 'post_type' => 'wp_block', 'show_option_none' => __( 'None', 'luxeritas' ), 'option_none_value' => '', )); } if( !empty( $dropdown_posts ) ) { echo $dropdown_posts; } else { echo ''; } ?>
'thk_pwa_install', 'description' => __( 'PWA install button', 'luxeritas' ) ); parent::__construct( 'thk_pwa_install', '#10 ' . __( 'PWA install button', 'luxeritas' ) . ' (' . __( 'by Luxeritas', 'luxeritas' ) . ')', $widget_ops ); } public function widget( $args, $instance ) { global $_is, $luxe, $awesome; $mobile = true; if( $_is['mobile'] === false && isset( $instance['mobile'] ) && (int)$instance['mobile'] === 1 ) { $mobile = false; } if( isset( $luxe['pwa_enable'] ) && isset( $luxe['pwa_offline_enable'] ) && isset( $luxe['pwa_install_widget'] ) && $mobile === true ) { $title = !empty( $instance['title'] ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $name = !empty( $instance['name'] ) ? $instance['name'] : ''; $description = !empty( $instance['description'] ) ? $instance['description'] : ''; $color = !empty( $instance['color'] ) ? $instance['color'] : '#333333'; $bg = !empty( $instance['bg'] ) ? $instance['bg'] : '#fef8ee'; $border = !empty( $instance['border'] ) ? $instance['border'] : '#f0b849'; $box_style = ''; if( $color !== '#333333' || $bg !== '#fef8ee' || $border !== '#f0b849' ) { $box_style .= ' style="'; if( $color !== '#333333' ) $box_style .= 'color:' . $color . ';'; if( $bg !== '#fef8ee' ) $box_style .= 'background:' . $bg . ';'; if( $border !== '#f0b849' ) $box_style .= 'border-color:' . $border . ';'; $box_style = rtrim( $box_style, ';' ); $box_style .= '"'; } echo str_replace( '