Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bring custom header code in line with current best practice.

This commit brings two changes: replacing the use of the deprecated
add_custom_image_header function, and no longer defining header
image constants, as these are now defined by the add_theme_support
function when called with the 'custom-header' argument.
  • Loading branch information...
commit 8d5bc781c1e2c1661fccfd351c03757362410a45 1 parent f9ae2ce
Benedict Eastaugh beastaugh authored

Showing 2 changed files with 18 additions and 13 deletions. Show diff stats Hide diff stats

  1. +2 0  changelog.txt
  2. +16 13 functions.php
2  changelog.txt
@@ -4,6 +4,8 @@
4 4
5 5 * Moved language files to `/languages` directory.
6 6 * Added POT file to theme files in `languages` directory.
  7 + * Replaced use of deprecated `add_custom_image_header` function.
  8 + * Stop defining header image constants.
7 9 * Deprecated `tarski_doctitle` in favour of a filter on `wp_title`.
8 10 * Updated the author details per Theme Directory requirements.
9 11 * Updated theme description to explain more of its advantages.
29 functions.php
@@ -78,19 +78,22 @@
78 78 // Localisation
79 79 load_theme_textdomain('tarski', get_template_directory() . '/languages');
80 80
81   -// Custom header image
82   -if (!defined('HEADER_TEXTCOLOR'))
83   - define('HEADER_TEXTCOLOR', '');
84   -if (!defined('HEADER_IMAGE')) // %s is theme directory URI
85   - define('HEADER_IMAGE', '%s/headers/' . get_tarski_option('header'));
86   -if (!defined('HEADER_IMAGE_WIDTH'))
87   - define('HEADER_IMAGE_WIDTH', 720);
88   -if (!defined('HEADER_IMAGE_HEIGHT'))
89   - define('HEADER_IMAGE_HEIGHT', 180);
90   -if (!defined('NO_HEADER_TEXT'))
91   - define('NO_HEADER_TEXT', true);
92   -
93   -add_custom_image_header('', 'tarski_admin_header_style');
  81 +// Custom header support
  82 +add_theme_support('custom-header', array(
  83 + 'default-image' => '%s/headers/' . get_tarski_option('header'),
  84 + 'random-default' => false,
  85 + 'width' => 720,
  86 + 'height' => 180,
  87 + 'flex-height' => false,
  88 + 'flex-width' => false,
  89 + 'default-text-color' => '',
  90 + 'header-text' => false,
  91 + 'uploads' => true,
  92 + 'wp-head-callback' => '',
  93 + 'admin-head-callback' => 'tarski_admin_header_style',
  94 + 'admin-preview-callback' => ''
  95 +));
  96 +
94 97 register_default_headers(_tarski_list_header_images());
95 98
96 99 // Content width; set this in a plugin or child theme if you want to change

0 comments on commit 8d5bc78

Please sign in to comment.
Something went wrong with that request. Please try again.