Changeset 2075179
- Timestamp:
- 04/26/2019 07:06:16 AM (7 years ago)
- Location:
- event-codes
- Files:
-
- 22 edited
- 1 copied
-
tags/1.0.4 (copied) (copied from event-codes/trunk)
-
tags/1.0.4/events/class-event-codes-shortcode-helper.php (modified) (3 diffs)
-
tags/1.0.4/events/views/bootstrap/list-view-item.php (modified) (1 diff)
-
tags/1.0.4/events/views/bootstrap/list-view.php (modified) (1 diff)
-
tags/1.0.4/events/views/bootstrap/tabular-view-item.php (modified) (1 diff)
-
tags/1.0.4/events/views/bootstrap/tabular-view.php (modified) (1 diff)
-
tags/1.0.4/events/views/normal/list-view-item.php (modified) (1 diff)
-
tags/1.0.4/events/views/normal/list-view.php (modified) (1 diff)
-
tags/1.0.4/events/views/normal/tabular-view-item.php (modified) (1 diff)
-
tags/1.0.4/events/views/normal/tabular-view.php (modified) (1 diff)
-
tags/1.0.4/events/views/not-available.php (modified) (2 diffs)
-
tags/1.0.4/readme.txt (modified) (2 diffs)
-
trunk/events/class-event-codes-shortcode-helper.php (modified) (3 diffs)
-
trunk/events/views/bootstrap/list-view-item.php (modified) (1 diff)
-
trunk/events/views/bootstrap/list-view.php (modified) (1 diff)
-
trunk/events/views/bootstrap/tabular-view-item.php (modified) (1 diff)
-
trunk/events/views/bootstrap/tabular-view.php (modified) (1 diff)
-
trunk/events/views/normal/list-view-item.php (modified) (1 diff)
-
trunk/events/views/normal/list-view.php (modified) (1 diff)
-
trunk/events/views/normal/tabular-view-item.php (modified) (1 diff)
-
trunk/events/views/normal/tabular-view.php (modified) (1 diff)
-
trunk/events/views/not-available.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
event-codes/tags/1.0.4/events/class-event-codes-shortcode-helper.php
r1688336 r2075179 55 55 56 56 function _return_no_events_markup() { 57 $template_name = 'not-available.php'; 58 $template_path = 'event-codes/events/views/'; 59 $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/'; 60 57 61 ob_start(); 58 include plugin_dir_path(dirname(__FILE__)) . '/events/views/not-available.php';62 include $this->ec_locate_template($template_name, $template_path, $default_path); 59 63 return ob_get_clean(); 60 64 } … … 62 66 function _return_events_markup_and_data($event_data,$atts) { 63 67 $shortcode_id = uniqid(); 64 ob_start(); 65 include plugin_dir_path(dirname(__FILE__)) . '/events/views/' . $atts['template'] . '/' . $atts['view'] . '-view.php'; 68 $template_name = $atts['view'] . '-view.php'; 69 $template_path = 'event-codes/events/views/' . $atts['template'] . '/'; 70 $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/'; 71 72 ob_start(); 73 include $this->ec_locate_template($template_name, $template_path, $default_path); 66 74 return ob_get_clean(); 67 75 } 68 76 69 77 function _return_load_more_events_markup_and_data($event_data,$atts) { 70 ob_start(); 78 $template_name = $atts['view'] . '-view-item.php'; 79 $template_path = 'event-codes/events/views/' . $atts['template'] . '/'; 80 $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/'; 81 82 ob_start(); 71 83 foreach ($event_data->events as $event) { 72 include plugin_dir_path(dirname(__FILE__)) . '/events/views/' . $atts['template'] . '/' . $atts['view'] . '-view-item.php';84 include $this->ec_locate_template($template_name, $template_path, $default_path); 73 85 } 74 86 return ob_get_clean(); … … 84 96 return 'Event_Codes_Datasource_'.ucfirst($code_name); 85 97 } 98 99 100 function ec_locate_template( $template_name, $template_path = '', $default_path = '' ) { 86 101 102 // Set variable to search in the templates folder of theme. 103 if ( ! $template_path ) : 104 $template_path = 'event-codes/'; 105 endif; 106 107 // Set default plugin templates path. 108 if ( ! $default_path ) : 109 $default_path = plugin_dir_path( __FILE__ ); // Path to the template folder 110 endif; 111 112 // Search template file in theme folder. 113 $template = locate_template( array( 114 $template_path . $template_name, 115 $template_name 116 )); 117 118 // Get plugins template file. 119 if ( ! $template ) : 120 $template = $default_path . $template_name; 121 endif; 122 123 return apply_filters( 'ec_locate_template', $template, $template_name, $template_path, $default_path ); 124 } 125 87 126 } -
event-codes/tags/1.0.4/events/views/bootstrap/list-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/list-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/bootstrap/list-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/list-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/bootstrap/tabular-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/tabular-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/bootstrap/tabular-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/tabular-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/normal/list-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/list-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/normal/list-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/list-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/normal/tabular-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/tabular-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/normal/tabular-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/tabular-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/tags/1.0.4/events/views/not-available.php
r1688336 r2075179 1 1 <?php 2 // If this file is called directly, abort. 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/not-available.php 4 * 5 * If this file is called directly, abort. 6 */ 7 3 8 if ( ! defined( 'WPINC' ) ) { 4 9 die; … … 7 12 <div class="aj__no-events"> 8 13 No events available :( 9 </div> '14 </div> -
event-codes/tags/1.0.4/readme.txt
r2022783 r2075179 3 3 Tags: event shortcode, event calendar shortcode, shortcodes, event, events, calendar, modern tribe 4 4 Requires at least: 4.1 5 Tested up to: 4.96 Stable tag: 1.0. 35 Tested up to: 5.1 6 Stable tag: 1.0.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 188 188 == Changelog == 189 189 190 = 1.0.4 = 191 * Feature - added custom template support 192 190 193 = 1.0.3 = 191 194 * Feature - New shortcode option "skip-cat" added -
event-codes/trunk/events/class-event-codes-shortcode-helper.php
r1688336 r2075179 55 55 56 56 function _return_no_events_markup() { 57 $template_name = 'not-available.php'; 58 $template_path = 'event-codes/events/views/'; 59 $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/'; 60 57 61 ob_start(); 58 include plugin_dir_path(dirname(__FILE__)) . '/events/views/not-available.php';62 include $this->ec_locate_template($template_name, $template_path, $default_path); 59 63 return ob_get_clean(); 60 64 } … … 62 66 function _return_events_markup_and_data($event_data,$atts) { 63 67 $shortcode_id = uniqid(); 64 ob_start(); 65 include plugin_dir_path(dirname(__FILE__)) . '/events/views/' . $atts['template'] . '/' . $atts['view'] . '-view.php'; 68 $template_name = $atts['view'] . '-view.php'; 69 $template_path = 'event-codes/events/views/' . $atts['template'] . '/'; 70 $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/'; 71 72 ob_start(); 73 include $this->ec_locate_template($template_name, $template_path, $default_path); 66 74 return ob_get_clean(); 67 75 } 68 76 69 77 function _return_load_more_events_markup_and_data($event_data,$atts) { 70 ob_start(); 78 $template_name = $atts['view'] . '-view-item.php'; 79 $template_path = 'event-codes/events/views/' . $atts['template'] . '/'; 80 $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/'; 81 82 ob_start(); 71 83 foreach ($event_data->events as $event) { 72 include plugin_dir_path(dirname(__FILE__)) . '/events/views/' . $atts['template'] . '/' . $atts['view'] . '-view-item.php';84 include $this->ec_locate_template($template_name, $template_path, $default_path); 73 85 } 74 86 return ob_get_clean(); … … 84 96 return 'Event_Codes_Datasource_'.ucfirst($code_name); 85 97 } 98 99 100 function ec_locate_template( $template_name, $template_path = '', $default_path = '' ) { 86 101 102 // Set variable to search in the templates folder of theme. 103 if ( ! $template_path ) : 104 $template_path = 'event-codes/'; 105 endif; 106 107 // Set default plugin templates path. 108 if ( ! $default_path ) : 109 $default_path = plugin_dir_path( __FILE__ ); // Path to the template folder 110 endif; 111 112 // Search template file in theme folder. 113 $template = locate_template( array( 114 $template_path . $template_name, 115 $template_name 116 )); 117 118 // Get plugins template file. 119 if ( ! $template ) : 120 $template = $default_path . $template_name; 121 endif; 122 123 return apply_filters( 'ec_locate_template', $template, $template_name, $template_path, $default_path ); 124 } 125 87 126 } -
event-codes/trunk/events/views/bootstrap/list-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/list-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/bootstrap/list-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/list-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/bootstrap/tabular-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/tabular-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/bootstrap/tabular-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/bootstrap/tabular-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/normal/list-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/list-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/normal/list-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/list-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/normal/tabular-view-item.php
r1688336 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/tabular-view-item.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/normal/tabular-view.php
r1747763 r2075179 1 1 <?php 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/normal/tabular-view.php 4 */ 2 5 // If this file is called directly, abort. 3 6 if ( ! defined( 'WPINC' ) ) { -
event-codes/trunk/events/views/not-available.php
r1688336 r2075179 1 1 <?php 2 // If this file is called directly, abort. 2 /* 3 * This template can be overridden by copying it to yourtheme/event-codes/events/views/not-available.php 4 * 5 * If this file is called directly, abort. 6 */ 7 3 8 if ( ! defined( 'WPINC' ) ) { 4 9 die; … … 7 12 <div class="aj__no-events"> 8 13 No events available :( 9 </div> '14 </div> -
event-codes/trunk/readme.txt
r2022783 r2075179 3 3 Tags: event shortcode, event calendar shortcode, shortcodes, event, events, calendar, modern tribe 4 4 Requires at least: 4.1 5 Tested up to: 4.96 Stable tag: 1.0. 35 Tested up to: 5.1 6 Stable tag: 1.0.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 188 188 == Changelog == 189 189 190 = 1.0.4 = 191 * Feature - added custom template support 192 190 193 = 1.0.3 = 191 194 * Feature - New shortcode option "skip-cat" added
Note: See TracChangeset
for help on using the changeset viewer.