title: WordPress - Overriding a function in a plugin
body: <p>I've been wonder for some time what the best practice is for modifying a plugin created by a WordPress user?</p>
  
  <p>For example there are a couple lines of code I want to change within the <strong>Contact Form 7</strong> plugin.  The function is called <strong>function wpcf7_ajax_json_echo()</strong> and is located in:</p>
  
  <pre><code>wp-content &gt; plugins &gt; contact-form-7 &gt; includes &gt; controller.php
  </code></pre>
  
  <p>Of course I could just change the code right in that file and be done, but then I'm out of luck when I want to update that plugin as my modifications will probably get written over.</p>
  
  <p>I know I should be making this happen via my functions.php file, but I'm not sure how to go about achieving this. Also, that particular function is 100+ lines of code and I'm guessing I don't want to overwrite that whole function, because there is a good chance the author of the plugin may choose to update something in that function in the future.</p>
  
  <p>Does anyone know the cleanest way for me to modify a few lines within that function via my functions.php file?</p>
  
  <p>Thank you!</p>