Changeset 2075257
- Timestamp:
- 04/26/2019 10:12:49 AM (7 years ago)
- Location:
- event-codes
- Files:
-
- 8 edited
- 14 copied
-
tags/1.0.5 (copied) (copied from event-codes/trunk)
-
tags/1.0.5/event-codes.php (copied) (copied from event-codes/trunk/event-codes.php) (1 diff)
-
tags/1.0.5/events/class-event-codes-shortcode-helper.php (copied) (copied from event-codes/trunk/events/class-event-codes-shortcode-helper.php) (4 diffs)
-
tags/1.0.5/events/views/bootstrap/list-view-item.php (copied) (copied from event-codes/trunk/events/views/bootstrap/list-view-item.php)
-
tags/1.0.5/events/views/bootstrap/list-view.php (copied) (copied from event-codes/trunk/events/views/bootstrap/list-view.php) (2 diffs)
-
tags/1.0.5/events/views/bootstrap/tabular-view-item.php (copied) (copied from event-codes/trunk/events/views/bootstrap/tabular-view-item.php)
-
tags/1.0.5/events/views/bootstrap/tabular-view.php (copied) (copied from event-codes/trunk/events/views/bootstrap/tabular-view.php) (2 diffs)
-
tags/1.0.5/events/views/normal/list-view-item.php (copied) (copied from event-codes/trunk/events/views/normal/list-view-item.php)
-
tags/1.0.5/events/views/normal/list-view.php (copied) (copied from event-codes/trunk/events/views/normal/list-view.php) (2 diffs)
-
tags/1.0.5/events/views/normal/tabular-view-item.php (copied) (copied from event-codes/trunk/events/views/normal/tabular-view-item.php)
-
tags/1.0.5/events/views/normal/tabular-view.php (copied) (copied from event-codes/trunk/events/views/normal/tabular-view.php) (2 diffs)
-
tags/1.0.5/events/views/not-available.php (copied) (copied from event-codes/trunk/events/views/not-available.php)
-
tags/1.0.5/includes/class-event-codes.php (copied) (copied from event-codes/trunk/includes/class-event-codes.php) (2 diffs)
-
tags/1.0.5/readme.txt (copied) (copied from event-codes/trunk/readme.txt) (2 diffs)
-
trunk/event-codes.php (modified) (1 diff)
-
trunk/events/class-event-codes-shortcode-helper.php (modified) (4 diffs)
-
trunk/events/views/bootstrap/list-view.php (modified) (2 diffs)
-
trunk/events/views/bootstrap/tabular-view.php (modified) (2 diffs)
-
trunk/events/views/normal/list-view.php (modified) (2 diffs)
-
trunk/events/views/normal/tabular-view.php (modified) (2 diffs)
-
trunk/includes/class-event-codes.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
event-codes/tags/1.0.5/event-codes.php
r2075182 r2075257 16 16 * Plugin URI: http://wpdwarves.com/event-codes-shortcodes-that-work-with-other-event-plugins 17 17 * Description: EventCodes plugin provides a shortcode that can be used to display a list of events on home page, sidebar or any other part of the site. 18 * Version: 1.0. 418 * Version: 1.0.5 19 19 * Author: WPdwarves 20 20 * Author URI: http://wpdwarves.com -
event-codes/tags/1.0.5/events/class-event-codes-shortcode-helper.php
r2075179 r2075257 60 60 61 61 ob_start(); 62 include $this->ec_locate_template($template_name, $template_path, $default_path);62 include ec_locate_template($template_name, $template_path, $default_path); 63 63 return ob_get_clean(); 64 64 } … … 67 67 $shortcode_id = uniqid(); 68 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 69 72 70 ob_start(); 73 include $this->ec_locate_template($template_name, $template_path, $default_path);71 include ec_locate_template($template_name, '', '', $atts); 74 72 return ob_get_clean(); 75 73 } … … 77 75 function _return_load_more_events_markup_and_data($event_data,$atts) { 78 76 $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 77 82 78 ob_start(); 83 79 foreach ($event_data->events as $event) { 84 include $this->ec_locate_template($template_name, $template_path, $default_path);80 include ec_locate_template($template_name, '', '', $atts); 85 81 } 86 82 return ob_get_clean(); … … 96 92 return 'Event_Codes_Datasource_'.ucfirst($code_name); 97 93 } 98 99 100 function ec_locate_template( $template_name, $template_path = '', $default_path = '' ) {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 folder110 endif;111 112 // Search template file in theme folder.113 $template = locate_template( array(114 $template_path . $template_name,115 $template_name116 ));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 94 126 95 } -
event-codes/tags/1.0.5/events/views/bootstrap/list-view.php
r2075179 r2075257 28 28 $atts['style'] = 'complete'; 29 29 } 30 31 $template_name = 'list-view-item.php'; 30 32 ?> 31 33 <div class="aj"> … … 33 35 <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice"> 34 36 <?php foreach($event_data->events as $event) : ?> 35 <?php include (dirname( __FILE__ ) . '/list-view-item.php'); ?>37 <?php include ec_locate_template($template_name, '', '', $atts); ?> 36 38 <?php endforeach; ?> 37 39 </div> -
event-codes/tags/1.0.5/events/views/bootstrap/tabular-view.php
r2075179 r2075257 7 7 die; 8 8 } 9 10 $template_name = 'tabular-view-item.php'; 9 11 ?> 10 12 <!-- … … 29 31 </div> 30 32 <?php foreach($event_data->events as $event) : ?> 31 <?php include (dirname( __FILE__ ) . '/tabular-view-item.php'); ?>33 <?php include ec_locate_template($template_name, '', '', $atts); ?> 32 34 <?php endforeach; ?> 33 35 </div> -
event-codes/tags/1.0.5/events/views/normal/list-view.php
r2075179 r2075257 28 28 $atts['style'] = 'complete'; 29 29 } 30 31 $template_name = 'list-view-item.php'; 30 32 ?> 31 33 <div class="aj"> … … 33 35 <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice"> 34 36 <?php foreach($event_data->events as $event) : ?> 35 <?php include (dirname( __FILE__ ) . '/list-view-item.php'); ?>37 <?php include ec_locate_template($template_name, '', '', $atts); ?> 36 38 <?php endforeach; ?> 37 39 </div> -
event-codes/tags/1.0.5/events/views/normal/tabular-view.php
r2075179 r2075257 7 7 die; 8 8 } 9 10 $template_name = 'tabular-view-item.php'; 9 11 ?> 10 12 <!-- … … 29 31 </div> 30 32 <?php foreach($event_data->events as $event) : ?> 31 <?php include (dirname( __FILE__ ) . '/tabular-view-item.php'); ?>33 <?php include ec_locate_template($template_name, '', '', $atts); ?> 32 34 <?php endforeach; ?> 33 35 </div> -
event-codes/tags/1.0.5/includes/class-event-codes.php
r2075182 r2075257 69 69 70 70 $this->plugin_name = 'event-codes'; 71 $this->version = '1.0. 4';71 $this->version = '1.0.5'; 72 72 73 73 $this->load_dependencies(); … … 112 112 113 113 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-event-codes-common.php'; 114 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/event-codes-global.php'; 114 115 115 116 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-event-codes-admin.php'; -
event-codes/tags/1.0.5/readme.txt
r2075179 r2075257 4 4 Requires at least: 4.1 5 5 Tested up to: 5.1 6 Stable tag: 1.0. 46 Stable tag: 1.0.5 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.5 = 191 * Feature - bug fixes 192 190 193 = 1.0.4 = 191 194 * Feature - added custom template support -
event-codes/trunk/event-codes.php
r2075182 r2075257 16 16 * Plugin URI: http://wpdwarves.com/event-codes-shortcodes-that-work-with-other-event-plugins 17 17 * Description: EventCodes plugin provides a shortcode that can be used to display a list of events on home page, sidebar or any other part of the site. 18 * Version: 1.0. 418 * Version: 1.0.5 19 19 * Author: WPdwarves 20 20 * Author URI: http://wpdwarves.com -
event-codes/trunk/events/class-event-codes-shortcode-helper.php
r2075179 r2075257 60 60 61 61 ob_start(); 62 include $this->ec_locate_template($template_name, $template_path, $default_path);62 include ec_locate_template($template_name, $template_path, $default_path); 63 63 return ob_get_clean(); 64 64 } … … 67 67 $shortcode_id = uniqid(); 68 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 69 72 70 ob_start(); 73 include $this->ec_locate_template($template_name, $template_path, $default_path);71 include ec_locate_template($template_name, '', '', $atts); 74 72 return ob_get_clean(); 75 73 } … … 77 75 function _return_load_more_events_markup_and_data($event_data,$atts) { 78 76 $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 77 82 78 ob_start(); 83 79 foreach ($event_data->events as $event) { 84 include $this->ec_locate_template($template_name, $template_path, $default_path);80 include ec_locate_template($template_name, '', '', $atts); 85 81 } 86 82 return ob_get_clean(); … … 96 92 return 'Event_Codes_Datasource_'.ucfirst($code_name); 97 93 } 98 99 100 function ec_locate_template( $template_name, $template_path = '', $default_path = '' ) {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 folder110 endif;111 112 // Search template file in theme folder.113 $template = locate_template( array(114 $template_path . $template_name,115 $template_name116 ));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 94 126 95 } -
event-codes/trunk/events/views/bootstrap/list-view.php
r2075179 r2075257 28 28 $atts['style'] = 'complete'; 29 29 } 30 31 $template_name = 'list-view-item.php'; 30 32 ?> 31 33 <div class="aj"> … … 33 35 <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice"> 34 36 <?php foreach($event_data->events as $event) : ?> 35 <?php include (dirname( __FILE__ ) . '/list-view-item.php'); ?>37 <?php include ec_locate_template($template_name, '', '', $atts); ?> 36 38 <?php endforeach; ?> 37 39 </div> -
event-codes/trunk/events/views/bootstrap/tabular-view.php
r2075179 r2075257 7 7 die; 8 8 } 9 10 $template_name = 'tabular-view-item.php'; 9 11 ?> 10 12 <!-- … … 29 31 </div> 30 32 <?php foreach($event_data->events as $event) : ?> 31 <?php include (dirname( __FILE__ ) . '/tabular-view-item.php'); ?>33 <?php include ec_locate_template($template_name, '', '', $atts); ?> 32 34 <?php endforeach; ?> 33 35 </div> -
event-codes/trunk/events/views/normal/list-view.php
r2075179 r2075257 28 28 $atts['style'] = 'complete'; 29 29 } 30 31 $template_name = 'list-view-item.php'; 30 32 ?> 31 33 <div class="aj"> … … 33 35 <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice"> 34 36 <?php foreach($event_data->events as $event) : ?> 35 <?php include (dirname( __FILE__ ) . '/list-view-item.php'); ?>37 <?php include ec_locate_template($template_name, '', '', $atts); ?> 36 38 <?php endforeach; ?> 37 39 </div> -
event-codes/trunk/events/views/normal/tabular-view.php
r2075179 r2075257 7 7 die; 8 8 } 9 10 $template_name = 'tabular-view-item.php'; 9 11 ?> 10 12 <!-- … … 29 31 </div> 30 32 <?php foreach($event_data->events as $event) : ?> 31 <?php include (dirname( __FILE__ ) . '/tabular-view-item.php'); ?>33 <?php include ec_locate_template($template_name, '', '', $atts); ?> 32 34 <?php endforeach; ?> 33 35 </div> -
event-codes/trunk/includes/class-event-codes.php
r2075182 r2075257 69 69 70 70 $this->plugin_name = 'event-codes'; 71 $this->version = '1.0. 4';71 $this->version = '1.0.5'; 72 72 73 73 $this->load_dependencies(); … … 112 112 113 113 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-event-codes-common.php'; 114 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/event-codes-global.php'; 114 115 115 116 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-event-codes-admin.php'; -
event-codes/trunk/readme.txt
r2075179 r2075257 4 4 Requires at least: 4.1 5 5 Tested up to: 5.1 6 Stable tag: 1.0. 46 Stable tag: 1.0.5 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.5 = 191 * Feature - bug fixes 192 190 193 = 1.0.4 = 191 194 * Feature - added custom template support
Note: See TracChangeset
for help on using the changeset viewer.