Permalink
Browse files

Stop using header image constants.

  • Loading branch information...
beastaugh committed Jun 6, 2012
1 parent a4fa464 commit f348ecda7fbbaa29b29e9f0b987b9396319de27d
Showing with 7 additions and 7 deletions.
  1. +1 −1 changelog.txt
  2. +2 −2 functions.php
  3. +2 −2 library/helpers/admin_helper.php
  4. +2 −2 library/helpers/template_helper.php
View
@@ -7,7 +7,7 @@
* Added POT file to theme files in `languages` directory.
* Removed uses of call-time pass-by-reference for compatibility with PHP 5.4.
* Replaced use of deprecated `add_custom_image_header` function.
- * Stop defining header image constants.
+ * Stop defining and using header image constants.
* Deprecated `tarski_doctitle` in favour of a filter on `wp_title`.
* Updated the author details per Theme Directory requirements.
* Updated theme description to explain more of its advantages.
View
@@ -159,13 +159,13 @@
add_theme_support('post-thumbnails');
if (get_tarski_option('featured_header')) {
- set_post_thumbnail_size(HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
+ set_post_thumbnail_size(get_custom_header()->width, get_custom_header()->height, true);
} else {
set_post_thumbnail_size($content_width, 300, false);
}
// Image size for large feature images, used in the header
-add_image_size('large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true);
+add_image_size('large-feature', get_custom_header()->width, get_custom_header()->height, true);
// Image size for featured posts if a large-feature doesn't exist
add_image_size('small-feature', $content_width, 300);
@@ -228,8 +228,8 @@ function tarski_admin() {
function tarski_admin_header_style() { ?>
<style type="text/css">
#headimg {
- height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
- width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
+ height: <?php echo get_custom_header()->height; ?>px;
+ width: <?php echo get_custom_header()->width; ?>px;
}
#headimg h1, #headimg #desc {
display: none;
@@ -291,11 +291,11 @@ function tarski_headerimage() {
if (get_tarski_option('featured_header') &&
is_singular($post) &&
has_post_thumbnail($post->ID)) {
- $image_size = array(HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH);
+ $image_size = array(get_custom_header()->width, get_custom_header()->width);
$image_id = get_post_thumbnail_id($post->ID);
$image = wp_get_attachment_image_src($image_id, $image_size);
- if ($image[1] >= HEADER_IMAGE_WIDTH) {
+ if ($image[1] >= get_custom_header()->width) {
$header_img_tag = get_the_post_thumbnail($post->ID, $image_size);
}
}

0 comments on commit f348ecd

Please sign in to comment.