Changeset 786521
- Timestamp:
- 10/11/2013 05:34:49 PM (12 years ago)
- Location:
- woot-library
- Files:
-
- 7 added
- 8 edited
-
branches/1.x/aliases.php (modified) (2 diffs)
-
branches/1.x/readme.md (modified) (1 diff)
-
branches/1.x/readme.txt (modified) (3 diffs)
-
branches/1.x/woot-library.php (modified) (1 diff)
-
tags/1.2 (added)
-
tags/1.2/aliases.php (added)
-
tags/1.2/library.php (added)
-
tags/1.2/license.txt (added)
-
tags/1.2/readme.md (added)
-
tags/1.2/readme.txt (added)
-
tags/1.2/woot-library.php (added)
-
trunk/aliases.php (modified) (2 diffs)
-
trunk/readme.md (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/woot-library.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woot-library/branches/1.x/aliases.php
r785018 r786521 61 61 62 62 /** 63 * Determines if the current or specified product functions as an event ticket. 64 * 65 * @param null $product 66 * @return bool 67 */ 68 function woot_is_event_ticket($product = null) { 69 return (false === woot_get_event($product)) ? false : true; 70 } 71 72 /** 63 73 * Returns the event associated with the current product (this can explicitly 64 74 * be specified as either a post ID or object or else not be supplied, and … … 73 83 if (null === $product) $product = get_the_ID(); 74 84 return Woot_Library::get_event_from_product($product); 85 } 86 87 /** 88 * Returns the event start date associated with the current product (or a 89 * specific product ID/object can be explicitly passed in). It varies from 90 * tribe_get_event_date() in that it will by default return that date only 91 * and not the time (but see woot_get_event_time()). 92 * 93 * A specific date format string can optionally be passed. 94 * 95 * @param null $product 96 * @param string $format 97 * @return bool|string 98 */ 99 function woot_get_event_date($product = null, $format = '') { 100 $event = woot_get_event($product); 101 if (false === $event) return false; 102 return tribe_get_start_date($event, false, $format); 103 } 104 105 /** 106 * Returns the event start time associated with the current product (or a 107 * specific product ID/object can be explicitly passed in). 108 * 109 * A specific date format string can optionally be passed if there's a need 110 * to deviate from the default format. 111 * 112 * @param null $product 113 * @param string $format 114 * @return bool|string 115 */ 116 function woot_get_event_time($product = null, $format = '') { 117 $event = woot_get_event($product); 118 if (false === $event) return false; 119 if (empty($format)) return tribe_get_start_date($event, true, ' '); 120 else return tribe_get_start_date($event, false, ' ' . $format); 121 } 122 123 function woot_get_event_title($product = null) { 124 $event = woot_get_event($product); 125 if (false === $event) return false; 126 return apply_filters('the_title', $event->post_title, $event->ID); 75 127 } 76 128 -
woot-library/branches/1.x/readme.md
r784792 r786521 9 9 * WooCommerce 10 10 11 It is packaged as a plugin and must be installed and activated before the helper functions can be used. The advantage 12 of the plugin approach (as opposed to embedding the functions in your theme's functions.php file for instance - though 13 you are of course welcome to do so if you wish) is that if a problem is found and fixed, or new helpers are added, 14 you need only update the latest version of the plugin to benefit. 11 It is [packaged as a plugin](http://wordpress.org/plugins/woot-library/) and must be installed and activated before the 12 helper functions can be used. The advantage of the plugin approach (as opposed to embedding the functions in your 13 theme's functions.php file for instance - though you are of course welcome to do so if you wish) is that if a problem is 14 found and fixed, or new helpers are added, you need only update the latest version of the plugin to benefit. 15 16 Grab a copy 17 ----------- 18 19 You can obtain this [from the WordPress plugin directory](http://wordpress.org/plugins/woot-library/) (recommended, 20 since that will facilitate automated updates) or else download a release zip here on the GitHub repo. -
woot-library/branches/1.x/readme.txt
r785018 r786521 6 6 Requires at least: 3.6 7 7 Tested up to: 3.6.1 8 Stable tag: 1. 18 Stable tag: 1.2 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 23 23 * Pulling event details into catalog views 24 24 25 Dramatic, eh? 25 Dramatic, eh? Recipes for various tasks can be found 26 [on the project wiki](https://github.com/barryhughes/woot-library/wiki) 27 for those wanting some hints as to how to use this thang. 26 28 27 29 == Installation == … … 41 43 By itself, nothing. It simply provides a number of "helpers" to let people selling tickets with WooCommerce Tickets 42 44 build customizations just a little more easily than is normally possible. 45 46 = How on earth do I use it? = 47 48 Please go ahead and 49 [visit the project wiki](https://github.com/barryhughes/woot-library/wiki) - 50 this has a number of recipes to get you started and I will add more as time permits / in line with requests :-) 43 51 44 52 = How can I request a new helper? = -
woot-library/branches/1.x/woot-library.php
r785018 r786521 5 5 * Description: Simple helper library - to help you build customizations relating to your WooCommerce Tickets powered website. 6 6 * Author: Barry Hughes 7 * Version: 1. 17 * Version: 1.2 8 8 * Author URI: http://codingkills.me 9 9 */ -
woot-library/trunk/aliases.php
r785018 r786521 61 61 62 62 /** 63 * Determines if the current or specified product functions as an event ticket. 64 * 65 * @param null $product 66 * @return bool 67 */ 68 function woot_is_event_ticket($product = null) { 69 return (false === woot_get_event($product)) ? false : true; 70 } 71 72 /** 63 73 * Returns the event associated with the current product (this can explicitly 64 74 * be specified as either a post ID or object or else not be supplied, and … … 73 83 if (null === $product) $product = get_the_ID(); 74 84 return Woot_Library::get_event_from_product($product); 85 } 86 87 /** 88 * Returns the event start date associated with the current product (or a 89 * specific product ID/object can be explicitly passed in). It varies from 90 * tribe_get_event_date() in that it will by default return that date only 91 * and not the time (but see woot_get_event_time()). 92 * 93 * A specific date format string can optionally be passed. 94 * 95 * @param null $product 96 * @param string $format 97 * @return bool|string 98 */ 99 function woot_get_event_date($product = null, $format = '') { 100 $event = woot_get_event($product); 101 if (false === $event) return false; 102 return tribe_get_start_date($event, false, $format); 103 } 104 105 /** 106 * Returns the event start time associated with the current product (or a 107 * specific product ID/object can be explicitly passed in). 108 * 109 * A specific date format string can optionally be passed if there's a need 110 * to deviate from the default format. 111 * 112 * @param null $product 113 * @param string $format 114 * @return bool|string 115 */ 116 function woot_get_event_time($product = null, $format = '') { 117 $event = woot_get_event($product); 118 if (false === $event) return false; 119 if (empty($format)) return tribe_get_start_date($event, true, ' '); 120 else return tribe_get_start_date($event, false, ' ' . $format); 121 } 122 123 function woot_get_event_title($product = null) { 124 $event = woot_get_event($product); 125 if (false === $event) return false; 126 return apply_filters('the_title', $event->post_title, $event->ID); 75 127 } 76 128 -
woot-library/trunk/readme.md
r784792 r786521 9 9 * WooCommerce 10 10 11 It is packaged as a plugin and must be installed and activated before the helper functions can be used. The advantage 12 of the plugin approach (as opposed to embedding the functions in your theme's functions.php file for instance - though 13 you are of course welcome to do so if you wish) is that if a problem is found and fixed, or new helpers are added, 14 you need only update the latest version of the plugin to benefit. 11 It is [packaged as a plugin](http://wordpress.org/plugins/woot-library/) and must be installed and activated before the 12 helper functions can be used. The advantage of the plugin approach (as opposed to embedding the functions in your 13 theme's functions.php file for instance - though you are of course welcome to do so if you wish) is that if a problem is 14 found and fixed, or new helpers are added, you need only update the latest version of the plugin to benefit. 15 16 Grab a copy 17 ----------- 18 19 You can obtain this [from the WordPress plugin directory](http://wordpress.org/plugins/woot-library/) (recommended, 20 since that will facilitate automated updates) or else download a release zip here on the GitHub repo. -
woot-library/trunk/readme.txt
r785018 r786521 6 6 Requires at least: 3.6 7 7 Tested up to: 3.6.1 8 Stable tag: 1. 18 Stable tag: 1.2 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 23 23 * Pulling event details into catalog views 24 24 25 Dramatic, eh? 25 Dramatic, eh? Recipes for various tasks can be found 26 [on the project wiki](https://github.com/barryhughes/woot-library/wiki) 27 for those wanting some hints as to how to use this thang. 26 28 27 29 == Installation == … … 41 43 By itself, nothing. It simply provides a number of "helpers" to let people selling tickets with WooCommerce Tickets 42 44 build customizations just a little more easily than is normally possible. 45 46 = How on earth do I use it? = 47 48 Please go ahead and 49 [visit the project wiki](https://github.com/barryhughes/woot-library/wiki) - 50 this has a number of recipes to get you started and I will add more as time permits / in line with requests :-) 43 51 44 52 = How can I request a new helper? = -
woot-library/trunk/woot-library.php
r785018 r786521 5 5 * Description: Simple helper library - to help you build customizations relating to your WooCommerce Tickets powered website. 6 6 * Author: Barry Hughes 7 * Version: 1. 17 * Version: 1.2 8 8 * Author URI: http://codingkills.me 9 9 */
Note: See TracChangeset
for help on using the changeset viewer.