File manager - Edit - C:/inetpub/vhosts/alsawaripharma.com/icte-dubai.com/wp-content/themes/springy/templatesell/widgets/ts-social-widget.php
Back
<?php /** * Springy Social Icons menu widget * * @since 1.0.0 */ if (!class_exists('Springy_Social_Widget')) : /** * Social widget class. */ class Springy_Social_Widget extends WP_Widget { private function defaults() { $defaults = array( 'title' => esc_html__( 'Follow Us', 'springy' ), ); return $defaults; } /** * Constructor. */ public function __construct() { $opts = array( 'classname' => 'springy-menu-social', 'description' => esc_html__('Social Menu Widget', 'springy'), ); parent::__construct('springy-social-icons', esc_html__('Springy Social', 'springy'), $opts); } /** * Widget content. */ public function widget($args, $instance) { $instance = wp_parse_args( (array) $instance, $this->defaults() ); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); echo $args['before_widget']; if (!empty($title)) { echo $args['before_title'] . esc_html( $title ) . $args['after_title']; } if (has_nav_menu('social')) { wp_nav_menu(array('theme_location' => 'social', 'menu_class' => 'social-menu')); } echo $args['after_widget']; } /** * Update */ public function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = sanitize_text_field($new_instance['title']); return $instance; } /** * Form */ public function form($instance) { $instance = wp_parse_args( (array )$instance, $this->defaults() ); ?> <p> <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'springy'); ?></label> <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>"/> </p> <?php if (!has_nav_menu('social')) : ?> <p> <?php esc_html_e('Go to Appearance > Customize > Menus and create a menu and assign to Social.', 'springy'); ?> </p> <?php endif; ?> <?php } } endif;
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.09 |
proxy
|
phpinfo
|
Settings