Plugin Directory

Changeset 3254996


Ignore:
Timestamp:
03/12/2025 07:45:24 PM (13 months ago)
Author:
spiffyplugins
Message:

Version 5.0.3

Location:
spiffy-calendar/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • spiffy-calendar/trunk/includes/admin/admin-settings-tab-settings.php

    r3253386 r3254996  
    165165<tr>
    166166    <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">
    167176        <?php _e('More details link text','spiffy-calendar'); ?>
    168177    </th>
  • spiffy-calendar/trunk/includes/admin/custom-posts.php

    r3254730 r3254996  
    6565       
    6666        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') );
    6768    }
    6869   
     
    196197    */
    197198    function add_caps ($role, $limit) {
     199        if ($role == null) return;
    198200        foreach ( $this->allowed_capabilities as $cap ) {
    199201            $role->add_cap( $cap );
     
    501503
    502504    /*
     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    /*
    503533    ** Event admin arrange custom columns
    504534    */
  • spiffy-calendar/trunk/readme.txt

    r3254732 r3254996  
    44Requires at least: 5.3
    55Tested up to: 6.8
    6 Stable tag: 5.0.2
     6Stable tag: 5.0.3
    77License: GPLv2
    88Tags:  calendar,event,responsive,recurring,block
     
    170170== Changelog ==
    171171
     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
    172179= 5.0.2 (March 12, 2025) =
    173180
    174 * Fix: handle the case where a WordPress role has been removed from an installation
     181* Fix: handle the case where a standard WordPress role has been removed from an installation
    175182
    176183= 5.0.1 (March 11, 2025) =
  • spiffy-calendar/trunk/spiffy-calendar.php

    r3254730 r3254996  
    44Plugin URI:  http://www.spiffyplugins.ca/spiffycalendar
    55Description: 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.2
     6Version:     5.0.3
    77Author:      Spiffy Plugins
    88Author URI:  http://spiffyplugins.ca
     
    7474        add_action('init', array($this, 'calendar_init_action'));
    7575        add_action('admin_menu', array($this, 'admin_menu'), 10);
     76        add_action('admin_bar_menu', array($this, 'admin_toolbar'), 999 );
    7677
    7778        add_filter('spiffycal_settings_tabs_array', array($this, 'settings_tabs_array_default'), 9);
     
    201202                        'category_key_above' => false,
    202203                        'mini_popup' => 'right',
     204                        'exclude_from_search' => false,
    203205                        'title_label' => ''
    204206                    );
     
    337339   
    338340    /*
     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    /*
    339381    ** Add the default tabs to the settings tab array
    340382    */
     
    686728       
    687729        $this->current_options['mini_popup'] = sanitize_text_field($_POST['mini_popup']);
    688        
     730
    689731        $this->current_options['responsive_width'] = abs((int)$_POST['responsive_width']);
    690732
     
    703745        $this->current_options['category_text_color'] = sanitize_text_field($_POST['category_text_color']);
    704746       
     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           
    705753        // Check to see if we are removing custom styles
    706754        if (isset($_POST['reset_styles'])) {
  • spiffy-calendar/trunk/styles/default.css

    r3253386 r3254996  
    697697    margin-top: 10px;
    698698}
     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.