Php filter how to replace a bit of code with something else?

Hi guys I want to learn to use php filters in wp enviroment to perform this: filter on

<?php do_action( 'glow_credits' ); ?> 

to remove this credits and add just a copyright message… how can I do this?

Read More
<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the id=main div and all content after
 */
?>

    </div><!-- #main .site-main -->

    <?php get_sidebar(); ?>

    <footer id="colophon" class="site-footer" role="contentinfo">
        <div class="social-menu">
            <?php if ( has_nav_menu( 'social' ) ) {
                wp_nav_menu( array( 'theme_location' => 'social', 'container' => 'false', 'menu_class' => 'menu-social' ));
            } ?>
        </div><!-- .social-menu -->
        <div class="site-info">
            <?php do_action( 'glow_credits' ); ?>
            <a href="http://wordpress.org/" title="<?php esc_attr_e( 'A Semantic Personal Publishing Platform', 'glow' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'glow' ), 'WordPress' ); ?></a>.
            <?php printf( __( 'Theme: %1$s by %2$s.', 'glow' ), 'Snaps', '<a href="http://glow.com/" rel="designer">glow</a>' ); ?>
        </div><!-- .site-info -->
    </footer><!-- #colophon .site-footer -->
</div><!-- #page .hfeed .site -->

<?php wp_footer(); ?>

</body>
</html>

I know how to do this:

function test_new_action() {
  echo 'Howdy';
}
add_action('glow_credits','test_new_action');

but doesnt replace…

Related posts

Leave a Reply

1 comment

  1. You can unhook the existing function using remove_filter() – you just need to find out the name of the function that is displaying the credits.

    EG: If the function is called display_credits then you could use this in your function before hooking your own:

    remove_filter( 'glow_credits', 'display_credits' );