Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save grafikchaos/1110455 to your computer and use it in GitHub Desktop.
Save grafikchaos/1110455 to your computer and use it in GitHub Desktop.
Patch for correctly naming the WPCF7_PLUGIN_NAME constant using the basename() function
diff --git a/wp-content/plugins/contact-form-7/wp-contact-form-7.php b/wp-content/plugins/contact-form-7/wp-contact-form-7.php
index ea9427f..b8549e2 100644
--- a/wp-content/plugins/contact-form-7/wp-contact-form-7.php
+++ b/wp-content/plugins/contact-form-7/wp-contact-form-7.php
@@ -30,8 +30,9 @@ define( 'WPCF7_VERSION', '2.4.6' );
if ( ! defined( 'WPCF7_PLUGIN_BASENAME' ) )
define( 'WPCF7_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
-if ( ! defined( 'WPCF7_PLUGIN_NAME' ) )
- define( 'WPCF7_PLUGIN_NAME', trim( dirname( WPCF7_PLUGIN_BASENAME ), '/' ) );
+if (!defined('WPCF7_PLUGIN_NAME')) {
+ define('WPCF7_PLUGIN_NAME', trim(basename(dirname(WPCF7_PLUGIN_BASENAME)), '/') );
+}
if ( ! defined( 'WPCF7_PLUGIN_DIR' ) )
define( 'WPCF7_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . WPCF7_PLUGIN_NAME );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment