ThemeShaper Forums » Thematic


Bug: Overriding action hook calls

(5 posts)
  • Started 10 years ago by de_ce
  • Latest reply from Jonny Janiero
  • This topic is resolved
  1. There are many actions hooks that are not called if a ovverriding function in a child theme is used.


    // Create the blog description
    // In the header div
    if (function_exists('childtheme_override_blogdescription')) {
    function thematic_blogdescription() {
    } else {
    function thematic_blogdescription() {
    $blogdesc = '"blog-description">' . get_bloginfo('description');
    if (is_home() || is_front_page()) {
    echo "\t\t<h1 id=$blogdesc</h1>\n\n";
    } else {
    echo "\t\t<div id=$blogdesc</div>\n\n";

    The action hook is called before the end of the if clause. It's kinda unintuitive to make a override function and call an action for the default function after it.


    function childtheme_override_blogdescription() { ?>
    <p><?php get_bloginfo('description'); ?></p>

    For some functions, the hooks are calld, but for other aren't. It's messy. A consitent rule would be nice.

    Posted 10 years ago #
  2. Thanks for pointing this out. This has been corrected in the latest svn branch.

    You can download the latest stable development version here :
    The sometimes experimental svn branch is here:
    And bug reports are best made here: and in the forums ;)

    Thanks again,

    Posted 10 years ago #
  3. @de_ce good find
    @em hr many thanks for the corrections.

    can i ask,
    for example...


    without using the 'add_action' part, is there a way you can still specify its position within the override



    or do you just have to use the override, then remove/add new action to change position.

    hope any of this makes sense?

    Posted 10 years ago #
  4. Jonny,

    Yes, you have to override and then remove the action in a function that is hooked into init and then add again to change the priority parameter of the add_action hook. If you do not remove_action from the original priority the override will execute twice.


    Posted 10 years ago #
  5. thanks for clearing that up Gene

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.