Changeset 3412359
- Timestamp:
- 12/05/2025 03:30:42 PM (8 days ago)
- File:
-
- 1 edited
-
event-post/trunk/inc/deprecated/widget.search.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
event-post/trunk/inc/deprecated/widget.search.php
r3080998 r3412359 31 31 function widget($args, $local_instance) { 32 32 if(!defined('ALLOW_DEPRECATED') || !ALLOW_DEPRECATED) { 33 _deprecated_function(__FUNCTION__, '5.9.0', __('Legacy widgets have been deprecated. Consider using blocks instead.', 'event-post'));33 _deprecated_function(__FUNCTION__, '5.9.0', esc_html__('Legacy widgets have been deprecated. Consider using blocks instead.', 'event-post')); 34 34 } 35 35 extract( $args ); … … 59 59 } 60 60 61 echo $args['before_widget'];61 echo wp_kses($args['before_widget'], EventPost()->kses_tags); 62 62 if(!empty($instance['widgettitle'])){ 63 echo $args['before_title'];63 echo wp_kses($args['before_title'], EventPost()->kses_tags); 64 64 echo esc_html($instance['widgettitle']); 65 65 if(!empty($instance['cat']) && $instance['feed']){ 66 66 $rss_link = admin_url('admin-ajax.php') . '?action=EventPostFeed&cat=' . $instance['cat']; 67 echo' <a href="' . esc_url($rss_link) . '" title="'. sprintf(__('feed of %s', 'event-post'), esc_attr($instance['cat'])).'"><span class="dashicons dashicons-rss"></span></a>';67 echo' <a href="' . esc_url($rss_link) . '" title="'.esc_attr(sprintf(__('feed of %s', 'event-post'), $instance['cat'])).'"><span class="dashicons dashicons-rss"></span></a>'; 68 68 } 69 echo $args['after_title'];69 echo wp_kses($args['after_title'], EventPost()->kses_tags); 70 70 } 71 71 $atts=array( … … 77 77 'order' => $order 78 78 ); 79 echo $EventPost->list_events($atts, 'event_list', 'widget');80 echo $args['after_widget'];79 echo wp_kses($EventPost->list_events($atts, 'event_list', 'widget'), EventPost()->kses_tags); 80 echo wp_kses($args['after_widget'], EventPost()->kses_tags); 81 81 } 82 82 … … 93 93 $thumbnail_sizes = $EventPost->get_thumbnail_sizes(); 94 94 ?> 95 <input type="hidden" id="<?php echo $this->get_field_id('widgettitle'); ?>-title" value="<?php echo $instance['widgettitle']; ?>">95 <input type="hidden" id="<?php echo esc_attr($this->get_field_id('widgettitle')); ?>-title" value="<?php echo esc_attr($instance['widgettitle']); ?>"> 96 96 <p> 97 <label for="<?php echo $this->get_field_id('widgettitle'); ?>"><?php _e('Title','event-post'); ?> 98 <input class="widefat" id="<?php echo $this->get_field_id('widgettitle'); ?>" name="<?php echo $this->get_field_name('widgettitle'); ?>" type="text" value="<?php echo $instance['widgettitle']; ?>" /> 97 <label for="<?php echo esc_attr($this->get_field_id('widgettitle')); ?>"><?php esc_html_e('Title','event-post'); ?> 98 <input class="widefat" id="<?php echo esc_attr($this->get_field_id('widgettitle')); ?>" name="<?php echo esc_attr($this->get_field_name('widgettitle')); ?>" type="text" value="<?php echo esc_attr($instance['widgettitle']); ?>" /> 99 </label> 100 </p> 101 102 <p style="margin-top:10px;"> 103 <label for="<?php echo esc_attr($this->get_field_id('numberposts')); ?>"><?php esc_html_e('Number of posts','event-post'); ?> 104 <input id="<?php echo esc_attr($this->get_field_id('numberposts')); ?>" name="<?php echo esc_attr($this->get_field_name('numberposts')); ?>" type="number" value="<?php echo esc_attr($instance['numberposts']); ?>" /> 105 </label> <?php esc_html_e('(-1 is no limit)','event-post'); ?> 106 </p> 107 108 109 <p style="margin-top:10px;"> 110 <label for="<?php echo esc_attr($this->get_field_id('future')); ?>"> 111 <input id="<?php echo esc_attr($this->get_field_id('future')); ?>" name="<?php echo esc_attr($this->get_field_name('future')); ?>" type="checkbox" value="1" <?php checked($instance['future'], true, true); ?> /> 112 <?php esc_html_e('Display future events','event-post'); ?> 113 </label> 114 </p> 115 <p style="margin-top:10px;"> 116 <label for="<?php echo esc_attr($this->get_field_id('past')); ?>"> 117 <input id="<?php echo esc_attr($this->get_field_id('past')); ?>" name="<?php echo esc_attr($this->get_field_name('past')); ?>" type="checkbox" value="1" <?php checked($instance['past'], true, true); ?> /> 118 <?php esc_html_e('Display past events','event-post'); ?> 119 </label> 120 </p> 121 122 <p> 123 <label for="<?php echo esc_attr($this->get_field_id('cat')); ?>"> 124 <span class="dashicons dashicons-category"></span> 125 <?php esc_html_e('Only in:','event-post'); ?> 126 <select class="widefat" id="<?php echo esc_attr($this->get_field_id('cat')); ?>" name="<?php echo esc_attr($this->get_field_name('cat')); ?>"> 127 <option value=''><?php esc_html_e('All categories','event-post') ?></option> 128 <?php foreach($cats as $_cat){ ?> 129 <option value="<?php echo esc_attr($_cat->slug); ?>" <?php selected($_cat->slug, $instance['cat'], true); ?>><?php echo esc_html($_cat->cat_name); ?></option> 130 <?php } ?> 131 </select> 99 132 </label> 100 133 </p> 101 134 102 135 <p style="margin-top:10px;"> 103 <label for="<?php echo $this->get_field_id('numberposts'); ?>"><?php _e('Number of posts','event-post'); ?> 104 <input id="<?php echo $this->get_field_id('numberposts'); ?>" name="<?php echo $this->get_field_name('numberposts'); ?>" type="number" value="<?php echo $instance['numberposts']; ?>" /> 105 </label> <?php _e('(-1 is no limit)','event-post'); ?> 106 </p> 107 108 109 <p style="margin-top:10px;"> 110 <label for="<?php echo $this->get_field_id('future'); ?>"> 111 <input id="<?php echo $this->get_field_id('future'); ?>" name="<?php echo $this->get_field_name('future'); ?>" type="checkbox" value="1" <?php checked($instance['future'], true, true); ?> /> 112 <?php _e('Display future events','event-post'); ?> 113 </label> 114 </p> 115 <p style="margin-top:10px;"> 116 <label for="<?php echo $this->get_field_id('past'); ?>"> 117 <input id="<?php echo $this->get_field_id('past'); ?>" name="<?php echo $this->get_field_name('past'); ?>" type="checkbox" value="1" <?php checked($instance['past'], true, true); ?> /> 118 <?php _e('Display past events','event-post'); ?> 119 </label> 120 </p> 121 122 <p> 123 <label for="<?php echo $this->get_field_id('cat'); ?>"> 124 <span class="dashicons dashicons-category"></span> 125 <?php _e('Only in:','event-post'); ?> 126 <select class="widefat" id="<?php echo $this->get_field_id('cat'); ?>" name="<?php echo $this->get_field_name('cat'); ?>"> 127 <option value=''><?php _e('All categories','event-post') ?></option> 128 <?php foreach($cats as $_cat){ ?> 129 <option value="<?php echo $_cat->slug; ?>" <?php selected($_cat->slug, $instance['cat'], true); ?>><?php echo $_cat->cat_name; ?></option> 130 <?php } ?> 131 </select> 132 </label> 133 </p> 134 135 <p style="margin-top:10px;"> 136 <label for="<?php echo $this->get_field_id('feed'); ?>"> 137 <input id="<?php echo $this->get_field_id('feed'); ?>" name="<?php echo $this->get_field_name('feed'); ?>" type="checkbox" value="1" <?php checked($instance['feed'], true, true); ?> /> 138 <?php _e('Show category ICS link','event-post'); ?> 136 <label for="<?php echo esc_attr($this->get_field_id('feed')); ?>"> 137 <input id="<?php echo esc_attr($this->get_field_id('feed')); ?>" name="<?php echo esc_attr($this->get_field_name('feed')); ?>" type="checkbox" value="1" <?php checked($instance['feed'], true, true); ?> /> 138 <?php esc_html_e('Show category ICS link','event-post'); ?> 139 139 </label> 140 140 </p> … … 142 142 143 143 <p> 144 <label for="<?php echo $this->get_field_id('tag'); ?>">144 <label for="<?php echo esc_attr($this->get_field_id('tag')); ?>"> 145 145 <span class="dashicons dashicons-tag"></span> 146 <?php _e('Only in:','event-post'); ?>147 <select class="widefat" id="<?php echo $this->get_field_id('tag'); ?>" name="<?php echo $this->get_field_name('tag'); ?>">148 <option value=''><?php_e('All tags','event-post') ?></option>149 <?php foreach($tags as $_tag){?>150 <option value="<?php echo $_tag->slug; ?>" <?php selected($_tag->slug, $instance['tag'], true); ?>><?php echo $_tag->name; ?></option>151 <?php } ?>152 </select>146 <?php esc_html_e('Only in:','event-post'); ?> 147 <select class="widefat" id="<?php echo esc_attr($this->get_field_id('tag')); ?>" name="<?php echo esc_attr($this->get_field_name('tag')); ?>"> 148 <option value=''><?php esc_html_e('All tags','event-post') ?></option> 149 <?php foreach($tags as $_tag){?> 150 <option value="<?php echo esc_attr($_tag->slug); ?>" <?php selected($_tag->slug, $instance['tag'], true); ?>><?php echo esc_html($_tag->name); ?></option> 151 <?php } ?> 152 </select> 153 153 </label> 154 154 </p> … … 156 156 <hr> 157 157 <p style="margin-top:10px;"> 158 <label for="<?php echo $this->get_field_id('thumbnail'); ?>">159 <input id="<?php echo $this->get_field_id('thumbnail'); ?>" name="<?php echo $this->get_field_name('thumbnail'); ?>" type="checkbox" value="1" <?php checked($instance['thumbnail'], true, true); ?> />160 <?php_e('Show thumbnails','event-post'); ?>158 <label for="<?php echo esc_attr($this->get_field_id('thumbnail')); ?>"> 159 <input id="<?php echo esc_attr($this->get_field_id('thumbnail')); ?>" name="<?php echo esc_attr($this->get_field_name('thumbnail')); ?>" type="checkbox" value="1" <?php checked($instance['thumbnail'], true, true); ?> /> 160 <?php esc_html_e('Show thumbnails','event-post'); ?> 161 161 </label> 162 162 </p> 163 163 <p> 164 <label for="<?php echo $this->get_field_id('thumbnail_size'); ?>">165 <?php _e('Thumbnail size:','event-post'); ?>166 <select class="widefat" id="<?php echo $this->get_field_id('thumbnail_size'); ?>" name="<?php echo $this->get_field_name('thumbnail_size'); ?>">164 <label for="<?php echo esc_attr($this->get_field_id('thumbnail_size')); ?>"> 165 <?php esc_html_e('Thumbnail size:','event-post'); ?> 166 <select class="widefat" id="<?php echo esc_attr($this->get_field_id('thumbnail_size')); ?>" name="<?php echo esc_attr($this->get_field_name('thumbnail_size')); ?>"> 167 167 <option value=''></option> 168 168 <?php foreach($thumbnail_sizes as $size){?> 169 <option value="<?php echo $size; ?>" <?php selected($size, $instance['thumbnail_size'], true); ?>><?php echo $size; ?></option>169 <option value="<?php echo esc_attr($size); ?>" <?php selected($size, $instance['thumbnail_size'], true); ?>><?php echo esc_html($size); ?></option> 170 170 <?php } ?> 171 171 </select> … … 175 175 176 176 <p style="margin-top:10px;"> 177 <label for="<?php echo $this->get_field_id('excerpt'); ?>">178 <input id="<?php echo $this->get_field_id('excerpt'); ?>" name="<?php echo $this->get_field_name('excerpt'); ?>" type="checkbox" value="1" <?php checked($instance['excerpt'], true, true); ?> />179 <?php _e('Show excerpt','event-post'); ?>177 <label for="<?php echo esc_attr($this->get_field_id('excerpt')); ?>"> 178 <input id="<?php echo esc_attr($this->get_field_id('excerpt')); ?>" name="<?php echo esc_attr($this->get_field_name('excerpt')); ?>" type="checkbox" value="1" <?php checked($instance['excerpt'], true, true); ?> /> 179 <?php esc_html_e('Show excerpt','event-post'); ?> 180 180 </label> 181 181 </p> 182 182 183 183 <p> 184 <label for="<?php echo $this->get_field_id('order'); ?>">185 <?php _e('Order:','event-post'); ?>186 <select class="widefat" id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>">187 <option value='DESC' <?php selected('DESC', $instance['order'], true); ?>><?php_e('Reverse chronological','event-post') ?></option>188 <option value='ASC' <?php selected('ASC', $instance['order'], true); ?>><?php _e('Chronological','event-post') ?></option>189 </select>184 <label for="<?php echo esc_attr($this->get_field_id('order')); ?>"> 185 <?php esc_html_e('Order:','event-post'); ?> 186 <select class="widefat" id="<?php echo esc_attr($this->get_field_id('order')); ?>" name="<?php echo esc_attr($this->get_field_name('order')); ?>"> 187 <option value='DESC' <?php selected('DESC', $instance['order'], true); ?>><?php esc_html_e('Reverse chronological','event-post') ?></option> 188 <option value='ASC' <?php selected('ASC', $instance['order'], true); ?>><?php esc_html_e('Chronological','event-post') ?></option> 189 </select> 190 190 </label> 191 191 </p>
Note: See TracChangeset
for help on using the changeset viewer.