Make function graphene_ie_css3 pluggable

  • Rob

    #1122

    Dear Syahir,

    could you please make the function graphene_ie_css3 (in functions.php) pluggable?

    I made this function pluggable myself in v1.2.1 by checking if the functions exists in the original functions.php:

    if ( ! function_exists( 'graphene_ie_css3' ) {
    function graphene_ie_css3(){ ?>
    <!--[if lte IE 8]>
    <style type="text/css" media="screen">
    #footer, div.sidebar-wrap, .block-button, .featured_slider, #slider_root, #comments li.bypostauthor, .pie{behavior: url(<?php echo get_template_directory_uri(); ?>/js/PIE.php);}
    .featured_slider{margin-top:0 !important;}
    </style>
    <![endif]-->
    <?php
    }
    }
    add_action('wp_head', 'graphene_ie_css3');

    I declared a extended version (added CSS classes and ID’s) of the function in my child functions.php.

    But unfortunately, I completely forgot to do this in the new v1.3.1. The result was a white screen of death because of PHP trying to redeclare the function.

    It would be nice if this could be added in future version of the theme!

    Kind regards,

    Roy

    Admin

    Syahir Hakim

    #14639

    The function is already pluggable. Basically any function that’s added using the add_action() is pluggable, since you can just remove the action and add your own action.

    See these WP Codex pages:

    http://codex.wordpress.org/Function_Reference/add_action

    http://codex.wordpress.org/Function_Reference/remove_action

    RvL

    #14640

    Ah, I never knew that. Now you explain it, it sounds rather logical 😉

    Thanks for your reply and keep up the good work!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.