Plugin Directory

Changeset 3246718


Ignore:
Timestamp:
02/25/2025 08:16:28 PM (13 months ago)
Author:
themifyme
Message:

update

Location:
themify-event-post
Files:
87 added
7 edited

Legend:

Unmodified
Added
Removed
  • themify-event-post/trunk/includes/functions.php

    r3064185 r3246718  
    10211021    $post = get_post( $post );
    10221022
    1023     $start_date = get_post_meta( $post->ID, 'start_date', true );
    10241023    $end_date = get_post_meta( $post->ID, 'end_date', true );
    10251024    $time = time();
    1026     if (
    1027         ( ! $start_date || $time > strtotime( $start_date ) )
    1028         && ( ! $end_date || $time < strtotime( $end_date ) )
    1029     ) {
    1030         return true;
     1025    if ( $end_date && $time > strtotime( $end_date ) ) {
     1026        return false;
    10311027    }
    10321028
    1033     return false;
     1029    return true;
    10341030}
    10351031
  • themify-event-post/trunk/includes/system.php

    r3037797 r3246718  
    5252        add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
    5353        add_filter( 'template_include', array( $this, 'template_include' ) );
     54        add_filter( 'post_class', array( $this, 'post_class' ) );
    5455
    5556        if ( current_user_can( 'publish_posts' ) && get_user_option( 'rich_editing' ) === 'true' ) {
     
    267268
    268269    public function locate_template( $name ) {
    269         if( is_child_theme() && is_file( trailingslashit( get_stylesheet_directory() ) . trailingslashit( $this->pid ) . "{$name}.php" ) ) {
     270        if ( str_contains( $name, '../' ) ) {
     271            return false;
     272        } else if ( is_child_theme() && is_file( trailingslashit( get_stylesheet_directory() ) . trailingslashit( $this->pid ) . "{$name}.php" ) ) {
    270273            return trailingslashit( get_stylesheet_directory() ) . trailingslashit( $this->pid ) . "{$name}.php";
    271274        } else if( is_file( trailingslashit( get_template_directory() ) . trailingslashit( $this->pid ) . "{$name}.php" ) ) {
     
    352355        }
    353356    }
     357
     358    function post_class( $classes ) {
     359        if ( get_post_type() === 'event' ) {
     360            $classes[] = themify_event_is_visible() ? 'tep_upcoming_event' : 'tep_past_event';
     361        }
     362
     363        return $classes;
     364    }
    354365}
  • themify-event-post/trunk/readme.txt

    r3095360 r3246718  
    44Tags: event, post, date, post-type
    55Requires at least: 5.2
    6 Tested up to: 6.5.3
    7 Stable tag: 1.3.2
     6Tested up to: 6.7.2
     7Stable tag: 1.3.3
     8License: GPL v2
     9License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    810
    911This plugin will add Event post type.
  • themify-event-post/trunk/templates/shortcode.php

    r2944781 r3246718  
    3939);
    4040$args = shortcode_atts( $defaults, $atts, 'themify_event_post' );
    41 extract( $args );
    4241
    4342if ( ! empty( $args['id'] ) ) {
     
    4544}
    4645
    47 if ( empty( $template_before ) )
    48     $template_before = '<div class="themify_event_post_loop ' . $args['style'] . '">';
    49 if ( empty( $template_after ) )
    50     $template_after = '</div>';
     46if ( empty( $args['template_before'] ) )
     47    $args['template_before'] = '<div class="themify_event_post_loop ' . esc_attr( $args['style'] ) . '">';
     48if ( empty( $args['template_after'] ) )
     49    $args['template_after'] = '</div>';
    5150
    5251// Event Query Setup
    5352$events = array();
    5453
    55 if ( $show === 'upcoming' || $show === 'tabbed' ) { // show only future events
     54if ( $args['show'] === 'upcoming' || $args['show'] === 'tabbed' ) { // show only future events
    5655    $query = new WP_Query();
    5756    $args['show'] = 'upcoming';
    5857    $events[] = $query->query( apply_filters( 'themify_event_shortcode_args', themify_event_post_parse_query( $args ) ) );
    5958}
    60 if ( 'past' === $show || 'tabbed' === $show ) {
     59if ( 'past' === $args['show'] || 'tabbed' === $args['show'] ) {
    6160    $query = new WP_Query();
    6261    $args['show'] = 'past';
    6362    $events[] = $query->query( apply_filters( 'themify_event_shortcode_args', themify_event_post_parse_query( $args ) ) );
    6463}
    65 if ( 'mix' === $show ) {
     64if ( 'mix' === $args['show'] ) {
    6665    $query = new WP_Query();
    6766    $events[] = $query->query( apply_filters( 'themify_event_shortcode_args', themify_event_post_parse_query( $args ) ) );
     
    6968
    7069ob_start();
    71 if ( $show === 'tabbed' ) {
     70if ( $args['show'] === 'tabbed' ) {
    7271    ?>
    7372    <div class="themify-events-tabs">
     
    7776        </ul>
    7877        <div id="themify-events-upcoming-<?php echo $instance; ?>">
    79             <?php echo $template_before . $this->get_shortcode_template( $events[0], $template, $args ) . $template_after; ?>
     78            <?php echo $args['template_before'] . $this->get_shortcode_template( $events[0], $args['template'], $args ) . $args['template_after']; ?>
    8079        </div>
    8180        <div id="themify-events-past-<?php echo $instance; ?>">
    82             <?php echo $template_before . $this->get_shortcode_template( $events[1], $template, $args ) . $template_after; ?>
     81            <?php echo $args['template_before'] . $this->get_shortcode_template( $events[1], $args['template'], $args ) . $args['template_after']; ?>
    8382        </div>
    8483    </div>
     
    8685} else {
    8786
    88     $output = $this->get_shortcode_template( $events[0], $template, $args );
     87    $output = $this->get_shortcode_template( $events[0], $args['template'], $args );
    8988    if ( $output !== '' ) {
    90         echo $template_before . $output . $template_after;
    91         if ( $hide_page_nav === 'no' ) {
     89        echo $args['template_before'] . $output . $args['template_after'];
     90        if ( $args['hide_page_nav'] === 'no' ) {
    9291            echo themify_event_post_pagenav( array(
    9392                'total_posts' => $query->found_posts,
    9493                'paged' => themify_event_post_get_paged_query(),
    95                 'offset' => (int) $offset,
    96                 'posts_per_page' => (int) $limit,
     94                'offset' => (int) $args['offset'],
     95                'posts_per_page' => (int) $args['limit'],
    9796            ) );
    9897        }
  • themify-event-post/trunk/templates/single.php

    r3064185 r3246718  
    99$post_id = get_the_id();
    1010?>
    11 <div class="themify_event_post">
     11<div <?php post_class( 'themify_event_post' ); ?>>
    1212
    1313    <?php
  • themify-event-post/trunk/themify-event-post.php

    r3095360 r3246718  
    33Plugin Name:  Themify Event Post
    44Plugin URI:   https://themify.me/event-post
    5 Version:      1.3.2
     5Version:      1.3.3
    66Author:       Themify
    77Author URI:   https://themify.me
     
    4545        'url' => trailingslashit( plugin_dir_url( __FILE__ ) ),
    4646        'dir' => trailingslashit( plugin_dir_path( __FILE__ ) ),
    47         'version' => '1.3.2'
     47        'version' => '1.3.3'
    4848    ) );
    4949}
Note: See TracChangeset for help on using the changeset viewer.