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
    Apr 15 '20 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
    Apr 16 '20 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.