Skip to:
Content
Pages
Categories
Search
Top
Bottom

"Remove action" code to get rid of code?


  • Robin W
    Moderator

    @robin-w

    Ok, so I have writen and got working my first plugin, I am adding some user info to the reply display

    BBpress has the following lines in loop-single-reply

    <?php do_action( 'bbp_theme_before_reply_author_details' ); ?>
    <?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true) ); ?>
    [...other lines of code here]
    				
    <?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>

    I worked out how to get a plugin to put the other stuff I need before ‘bbp_theme_before_reply_author_admin_details’ so it’s working fine

    BUT I want to change the line

    <?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true) ); ?>
    to
    <?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => false) ); ?>

    I think I do this with a “remove action” in my plugin, and then add the code line as I want it back into my plugin – in effect deleting all the code between the two “do actions” and replacing this with what I want.

    But I cannot fathom from the codex and other googles quite how you do this

    1) is my understanding correct?
    2) what would the code line be in my plugin?

  • You must be logged in to reply to this topic.
Skip to toolbar