Changeset 734578
- Timestamp:
- 07/01/2013 10:42:54 AM (12 years ago)
- Location:
- wp-tiles
- Files:
-
- 3 added
- 3 edited
- 15 copied
Legend:
- Unmodified
- Added
- Removed
-
wp-tiles/tags/0.5.1/readme.txt
r730881 r734578 6 6 Requires at least: 3.4.2 7 7 Tested up to: 3.5.1 8 Stable tag: 0.5 8 Stable tag: 0.5.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 158 158 == Changelog == 159 159 160 = 0.5.1 = 161 162 * Made all template functions pluggable 163 * Fixed dates showing date of parent post 164 160 165 = 0.5 = 166 161 167 * Updated to new version of Tiles.js 162 168 * Added customizable cellpadding option -
wp-tiles/tags/0.5.1/wp-tiles.class.php
r730881 r734578 277 277 break; 278 278 case 'date1' : 279 $byline = get_the_date();279 $byline = $this->get_the_date( $post ); 280 280 break; 281 281 case 'date2' : 282 $byline = get_the_date('d-m-Y');282 $byline = $this->get_the_date( $post, 'd-m-Y' ); 283 283 break; 284 284 case 'date3' : 285 $byline = get_the_date('m-d-Y');285 $byline = $this->get_the_date( $post, 'm-d-Y' ); 286 286 break; 287 287 case 'cats' : … … 309 309 } 310 310 311 private function get_the_date( $post, $d = '' ) { 312 $the_date = ''; 313 314 if ( '' == $d ) 315 $the_date .= mysql2date(get_option('date_format'), $post->post_date); 316 else 317 $the_date .= mysql2date($d, $post->post_date); 318 319 return apply_filters('get_the_date', $the_date, $d); 320 } 321 311 322 private function HexToRGB($hex) { 312 323 $hex = ereg_replace("#", "", $hex); … … 433 444 } 434 445 435 /**436 * Show the WP Tiles. Use as template tag.437 * *438 * @param string|array $atts439 */440 function the_wp_tiles ( $atts = array() ) {441 442 // Allow $atts to be just the post_query as a string or object443 $atts = wp_tiles()->parse_post_query_string( $atts );444 445 // Backward compatibility - this is going out! Use the_category_wp_tiles instead446 if ( ( is_category() || is_single() ) && ! isset ( $atts['posts_query']['category'] ) ) {447 $categories = get_the_category();448 $cats = array();449 foreach ( $categories as $category ) {450 $cats[] = $category->term_id;451 }452 453 $atts['posts_query']['category'] = implode ( ', ', $cats );454 455 }456 457 wp_tiles()->show_tiles ( $atts );458 }459 460 /**461 * Show the WP Tiles for the current category462 *463 * @since 0.4.2464 */465 function the_category_wp_tiles( $atts ) {466 $atts = wp_tiles()->parse_post_query_string( $atts );467 468 // If is single and no cat is given, use posts from current categories469 if ( ! is_category() && ! is_single() )470 _doing_it_wrong( 'the_wp_tiles', "Only use the_category_wp_tiles on category pages or single posts/pages", '0.4.2' );471 else if ( isset ( $atts['posts_query']['category'] ) && ! empty ( $atts['posts_query']['category'] ) ) {472 _doing_it_wrong( 'the_wp_tiles', "Don't pass a category into the_category_wp_tiles(), use the_wp_tiles() instead.", '0.4.2' );473 } else {474 $categories = get_the_category();475 $cats = array();476 foreach ( $categories as $category ) {477 $cats[] = $category->term_id;478 }479 480 $atts['posts_query']['category'] = implode ( ', ', $cats );481 }482 483 wp_tiles()->show_tiles ( $atts );484 485 }486 487 /**488 * Show the posts in the current query.489 *490 * Can be used to replace the loop.491 *492 * @since 0.4.2493 */494 function the_loop_wp_tiles() {495 496 global $wp_query;497 $posts = $wp_query->get_posts();498 499 wp_tiles()->show_tiles ( $posts );500 }501 502 446 endif; -
wp-tiles/tags/0.5.1/wp-tiles.php
r730881 r734578 1 1 <?php 2 2 3 /* 3 Plugin Name: WP Tiles4 Plugin URI: http://trenvo.com/wp-tiles/5 Description: Add fully customizable dynamic tiles to your WordPress posts and pages.6 Version: 0.5 7 Author: Mike Martel8 Author URI: http://trenvo.com4 Plugin Name: WP Tiles 5 Plugin URI: http://trenvo.com/wp-tiles/ 6 Description: Add fully customizable dynamic tiles to your WordPress posts and pages. 7 Version: 0.5.1 8 Author: Mike Martel 9 Author URI: http://trenvo.com 9 10 */ 10 11 11 12 // Exit if accessed directly 12 if ( !defined('ABSPATH'))13 if ( !defined( 'ABSPATH' ) ) 13 14 exit; 14 15 … … 18 19 * @since 0.1 19 20 */ 20 define( 'WPTILES_VERSION', '0.5');21 define( 'WPTILES_VERSION', '0.5.1' ); 21 22 22 23 /** … … 25 26 * @since 0.1 26 27 */ 27 define( 'WPTILES_DIR', plugin_dir_path(__FILE__));28 define( 'WPTILES_URL', plugin_dir_url(__FILE__));29 define( 'WPTILES_TEMPLATES_DIR', WPTILES_DIR . 'templates/');30 define( 'WPTILES_TEMPLATES_URL', WPTILES_URL . 'templates/');31 define( 'WPTILES_INC_URL', WPTILES_URL . '_inc/');28 define( 'WPTILES_DIR', plugin_dir_path( __FILE__ ) ); 29 define( 'WPTILES_URL', plugin_dir_url( __FILE__ ) ); 30 define( 'WPTILES_TEMPLATES_DIR', WPTILES_DIR . 'templates/' ); 31 define( 'WPTILES_TEMPLATES_URL', WPTILES_URL . 'templates/' ); 32 define( 'WPTILES_INC_URL', WPTILES_URL . '_inc/' ); 32 33 33 34 /** … … 39 40 if ( is_admin() ) 40 41 require_once ( WPTILES_DIR . '/wp-tiles-admin.php' ); 42 43 add_action( 'plugins_loaded', 'wptiles_load_pluggables' ); 44 function wptiles_load_pluggables() { 45 require_once( WPTILES_DIR . '/wp-tiles-pluggables.php' ); 46 } -
wp-tiles/trunk/readme.txt
r730881 r734578 6 6 Requires at least: 3.4.2 7 7 Tested up to: 3.5.1 8 Stable tag: 0.5 8 Stable tag: 0.5.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 158 158 == Changelog == 159 159 160 = 0.5.1 = 161 162 * Made all template functions pluggable 163 * Fixed dates showing date of parent post 164 160 165 = 0.5 = 166 161 167 * Updated to new version of Tiles.js 162 168 * Added customizable cellpadding option -
wp-tiles/trunk/wp-tiles.class.php
r730881 r734578 277 277 break; 278 278 case 'date1' : 279 $byline = get_the_date();279 $byline = $this->get_the_date( $post ); 280 280 break; 281 281 case 'date2' : 282 $byline = get_the_date('d-m-Y');282 $byline = $this->get_the_date( $post, 'd-m-Y' ); 283 283 break; 284 284 case 'date3' : 285 $byline = get_the_date('m-d-Y');285 $byline = $this->get_the_date( $post, 'm-d-Y' ); 286 286 break; 287 287 case 'cats' : … … 309 309 } 310 310 311 private function get_the_date( $post, $d = '' ) { 312 $the_date = ''; 313 314 if ( '' == $d ) 315 $the_date .= mysql2date(get_option('date_format'), $post->post_date); 316 else 317 $the_date .= mysql2date($d, $post->post_date); 318 319 return apply_filters('get_the_date', $the_date, $d); 320 } 321 311 322 private function HexToRGB($hex) { 312 323 $hex = ereg_replace("#", "", $hex); … … 433 444 } 434 445 435 /**436 * Show the WP Tiles. Use as template tag.437 * *438 * @param string|array $atts439 */440 function the_wp_tiles ( $atts = array() ) {441 442 // Allow $atts to be just the post_query as a string or object443 $atts = wp_tiles()->parse_post_query_string( $atts );444 445 // Backward compatibility - this is going out! Use the_category_wp_tiles instead446 if ( ( is_category() || is_single() ) && ! isset ( $atts['posts_query']['category'] ) ) {447 $categories = get_the_category();448 $cats = array();449 foreach ( $categories as $category ) {450 $cats[] = $category->term_id;451 }452 453 $atts['posts_query']['category'] = implode ( ', ', $cats );454 455 }456 457 wp_tiles()->show_tiles ( $atts );458 }459 460 /**461 * Show the WP Tiles for the current category462 *463 * @since 0.4.2464 */465 function the_category_wp_tiles( $atts ) {466 $atts = wp_tiles()->parse_post_query_string( $atts );467 468 // If is single and no cat is given, use posts from current categories469 if ( ! is_category() && ! is_single() )470 _doing_it_wrong( 'the_wp_tiles', "Only use the_category_wp_tiles on category pages or single posts/pages", '0.4.2' );471 else if ( isset ( $atts['posts_query']['category'] ) && ! empty ( $atts['posts_query']['category'] ) ) {472 _doing_it_wrong( 'the_wp_tiles', "Don't pass a category into the_category_wp_tiles(), use the_wp_tiles() instead.", '0.4.2' );473 } else {474 $categories = get_the_category();475 $cats = array();476 foreach ( $categories as $category ) {477 $cats[] = $category->term_id;478 }479 480 $atts['posts_query']['category'] = implode ( ', ', $cats );481 }482 483 wp_tiles()->show_tiles ( $atts );484 485 }486 487 /**488 * Show the posts in the current query.489 *490 * Can be used to replace the loop.491 *492 * @since 0.4.2493 */494 function the_loop_wp_tiles() {495 496 global $wp_query;497 $posts = $wp_query->get_posts();498 499 wp_tiles()->show_tiles ( $posts );500 }501 502 446 endif; -
wp-tiles/trunk/wp-tiles.php
r730881 r734578 1 1 <?php 2 2 3 /* 3 Plugin Name: WP Tiles4 Plugin URI: http://trenvo.com/wp-tiles/5 Description: Add fully customizable dynamic tiles to your WordPress posts and pages.6 Version: 0.5 7 Author: Mike Martel8 Author URI: http://trenvo.com4 Plugin Name: WP Tiles 5 Plugin URI: http://trenvo.com/wp-tiles/ 6 Description: Add fully customizable dynamic tiles to your WordPress posts and pages. 7 Version: 0.5.1 8 Author: Mike Martel 9 Author URI: http://trenvo.com 9 10 */ 10 11 11 12 // Exit if accessed directly 12 if ( !defined('ABSPATH'))13 if ( !defined( 'ABSPATH' ) ) 13 14 exit; 14 15 … … 18 19 * @since 0.1 19 20 */ 20 define( 'WPTILES_VERSION', '0.5');21 define( 'WPTILES_VERSION', '0.5.1' ); 21 22 22 23 /** … … 25 26 * @since 0.1 26 27 */ 27 define( 'WPTILES_DIR', plugin_dir_path(__FILE__));28 define( 'WPTILES_URL', plugin_dir_url(__FILE__));29 define( 'WPTILES_TEMPLATES_DIR', WPTILES_DIR . 'templates/');30 define( 'WPTILES_TEMPLATES_URL', WPTILES_URL . 'templates/');31 define( 'WPTILES_INC_URL', WPTILES_URL . '_inc/');28 define( 'WPTILES_DIR', plugin_dir_path( __FILE__ ) ); 29 define( 'WPTILES_URL', plugin_dir_url( __FILE__ ) ); 30 define( 'WPTILES_TEMPLATES_DIR', WPTILES_DIR . 'templates/' ); 31 define( 'WPTILES_TEMPLATES_URL', WPTILES_URL . 'templates/' ); 32 define( 'WPTILES_INC_URL', WPTILES_URL . '_inc/' ); 32 33 33 34 /** … … 39 40 if ( is_admin() ) 40 41 require_once ( WPTILES_DIR . '/wp-tiles-admin.php' ); 42 43 add_action( 'plugins_loaded', 'wptiles_load_pluggables' ); 44 function wptiles_load_pluggables() { 45 require_once( WPTILES_DIR . '/wp-tiles-pluggables.php' ); 46 }
Note: See TracChangeset
for help on using the changeset viewer.