0

I would like to modfify function.php and other files. There's no filter hook. How can I change functions without filter hook? I thought,

if ( ! function_exists( 'function_name' ) {
       function_name () {
              ...
       }
}

Could you recommend the way to rewrite the function? Many thanks.

2
  • 1
    please be more specific. your idea would only work if the original function is defined that way already. see 'pluggable functions'
    – Michael
    Commented Apr 15, 2020 at 14:41
  • Thank you for your comment @Michael I read this git regarding rewriting wp_mail function: github.com/humanmade/aws-ses-wp-mail/blob/master/… I was wondering how this works with, and as you stated, it may be related with 'pluggable functions'. I'm searching about that. Thank you so much! So, if I would like to change functions in Wordpress, filter hook is the only way without pluggable functions? :)
    – hiyo
    Commented Apr 16, 2020 at 3:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.