Changeset 3254996
- Timestamp:
- 03/12/2025 07:45:24 PM (13 months ago)
- Location:
- spiffy-calendar/trunk
- Files:
-
- 5 edited
-
includes/admin/admin-settings-tab-settings.php (modified) (1 diff)
-
includes/admin/custom-posts.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
spiffy-calendar.php (modified) (6 diffs)
-
styles/default.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
spiffy-calendar/trunk/includes/admin/admin-settings-tab-settings.php
r3253386 r3254996 165 165 <tr> 166 166 <th scope="row"> 167 <?php _e('Exclude events from search','spiffy-calendar'); ?> 168 </th> 169 <td> 170 <input type="checkbox" name="exclude_from_search" <?php if ( $this->current_options['exclude_from_search'] == 'true') echo 'checked'; ?>> 171 </td> 172 </tr> 173 174 <tr> 175 <th scope="row"> 167 176 <?php _e('More details link text','spiffy-calendar'); ?> 168 177 </th> -
spiffy-calendar/trunk/includes/admin/custom-posts.php
r3254730 r3254996 65 65 66 66 add_action( 'admin_action_spiffy_copy_event', array( $this, 'copy_event' ) ); 67 add_action( 'pre_get_posts', array ( $this, 'remove_post_type_from_search_results') ); 67 68 } 68 69 … … 196 197 */ 197 198 function add_caps ($role, $limit) { 199 if ($role == null) return; 198 200 foreach ( $this->allowed_capabilities as $cap ) { 199 201 $role->add_cap( $cap ); … … 501 503 502 504 /* 505 ** Remove events from search results if configured 506 */ 507 function remove_post_type_from_search_results( $query ) { 508 global $spiffy_calendar; 509 510 if ( !$spiffy_calendar->current_options['exclude_from_search'] ) return; 511 512 /* check is front end main loop content */ 513 if(is_admin() || !$query->is_main_query()) return; 514 515 /* check is search result query */ 516 if($query->is_search()){ 517 518 $post_type_to_remove = 'spiffy_event'; 519 /* get all searchable post types */ 520 $searchable_post_types = get_post_types(array('exclude_from_search' => false)); 521 522 /* make sure you got the proper results, and that your post type is in the results */ 523 if(is_array($searchable_post_types) && in_array($post_type_to_remove, $searchable_post_types)){ 524 /* remove the post type from the array */ 525 unset( $searchable_post_types[ $post_type_to_remove ] ); 526 /* set the query to the remaining searchable post types */ 527 $query->set('post_type', $searchable_post_types); 528 } 529 } 530 } 531 532 /* 503 533 ** Event admin arrange custom columns 504 534 */ -
spiffy-calendar/trunk/readme.txt
r3254732 r3254996 4 4 Requires at least: 5.3 5 5 Tested up to: 6.8 6 Stable tag: 5.0. 26 Stable tag: 5.0.3 7 7 License: GPLv2 8 8 Tags: calendar,event,responsive,recurring,block … … 170 170 == Changelog == 171 171 172 = 5.0.3 (March 12, 2025) = 173 174 * New: option to exclude events from the global search 175 * New: restore the Spiffy shortcuts in the admin bar 176 * New: add CSS rule to hide featured image on Spiffy Event post display since it is output as part of the event 177 * Fix: handle another case where a standard WordPress role has been removed from an installation 178 172 179 = 5.0.2 (March 12, 2025) = 173 180 174 * Fix: handle the case where a WordPress role has been removed from an installation181 * Fix: handle the case where a standard WordPress role has been removed from an installation 175 182 176 183 = 5.0.1 (March 11, 2025) = -
spiffy-calendar/trunk/spiffy-calendar.php
r3254730 r3254996 4 4 Plugin URI: http://www.spiffyplugins.ca/spiffycalendar 5 5 Description: A full featured, simple to use Spiffy Calendar plugin for WordPress that allows you to manage and display your events and appointments. 6 Version: 5.0. 26 Version: 5.0.3 7 7 Author: Spiffy Plugins 8 8 Author URI: http://spiffyplugins.ca … … 74 74 add_action('init', array($this, 'calendar_init_action')); 75 75 add_action('admin_menu', array($this, 'admin_menu'), 10); 76 add_action('admin_bar_menu', array($this, 'admin_toolbar'), 999 ); 76 77 77 78 add_filter('spiffycal_settings_tabs_array', array($this, 'settings_tabs_array_default'), 9); … … 201 202 'category_key_above' => false, 202 203 'mini_popup' => 'right', 204 'exclude_from_search' => false, 203 205 'title_label' => '' 204 206 ); … … 337 339 338 340 /* 341 ** Add the menu shortcuts to the admin toolbar 342 */ 343 function admin_toolbar ($wp_admin_bar) { 344 345 // Check user permissions 346 $allowed_group = $this->current_options['can_manage_events']; 347 348 if (!current_user_can($allowed_group)) return; 349 350 $cat_name = ($this->current_options['category_plural'] == '') ? __('Categories', 'spiffy-calendar') : esc_html($this->current_options['category_plural']); 351 352 // Our own Spiffy node 353 $wp_admin_bar->add_node( array( 354 'id' => 'spiffy_main_node', 355 'title' => __('Spiffy Calendar', 'spiffy-calendar'), 356 'href' => admin_url('edit.php?post_type=spiffy_event') 357 ) ); 358 $wp_admin_bar->add_node( array( 359 'id' => 'spiffy_edit_events_node', 360 'title' => __('Manage Events', 'spiffy-calendar'), 361 'parent' => 'spiffy_main_node', 362 'href' => admin_url('edit.php?post_type=spiffy_event') 363 ) ); 364 $wp_admin_bar->add_node( array( 365 'id' => 'spiffy_add_event_node', 366 'title' => __('Add Event', 'spiffy-calendar'), 367 'parent' => 'spiffy_main_node', 368 'href' => admin_url('post-new.php?post_type=spiffy_event') 369 ) ); 370 if (current_user_can('manage_options')) { 371 $wp_admin_bar->add_node( array( 372 'id' => 'spiffy_categories_node', 373 'title' => $cat_name, 374 'parent' => 'spiffy_main_node', 375 'href' => admin_url('edit-tags.php?taxonomy=spiffy_categories&post_type=spiffy_event') 376 ) ); 377 } 378 } 379 380 /* 339 381 ** Add the default tabs to the settings tab array 340 382 */ … … 686 728 687 729 $this->current_options['mini_popup'] = sanitize_text_field($_POST['mini_popup']); 688 730 689 731 $this->current_options['responsive_width'] = abs((int)$_POST['responsive_width']); 690 732 … … 703 745 $this->current_options['category_text_color'] = sanitize_text_field($_POST['category_text_color']); 704 746 747 if (isset($_POST['exclude_from_search'])) { 748 $this->current_options['exclude_from_search'] = true; 749 } else { 750 $this->current_options['exclude_from_search'] = false; 751 } 752 705 753 // Check to see if we are removing custom styles 706 754 if (isset($_POST['reset_styles'])) { -
spiffy-calendar/trunk/styles/default.css
r3253386 r3254996 697 697 margin-top: 10px; 698 698 } 699 700 .single-spiffy_event .attachment-post-thumbnail, .single-spiffy_event .wp-block-post-featured-image { 701 display: none; 702 }
Note: See TracChangeset
for help on using the changeset viewer.