Skip to content

Instantly share code, notes, and snippets.

@michaeluno
Last active September 10, 2015 08:36
Show Gist options
  • Save michaeluno/2b4c2462527937476516 to your computer and use it in GitHub Desktop.
Save michaeluno/2b4c2462527937476516 to your computer and use it in GitHub Desktop.
Fixes a conflict of WR MegaMenu and Admin Page Framework.
<?php
/*
Plugin Name: Patch - WR MegaMenu & Admin Page Framework Conflict
*/
class FixConflict_WRMegaMenuAndAdminPageFramework {
public function __construct() {
add_action(
'wr_megamenu_init',
array( $this, 'storeGlobalPostVariable' ),
1
);
add_action(
'wr_megamenu_init',
array( $this, 'restoreGlobalPostVariable' ),
999
);
}
static public $post;
public function storeGlobalPostVariable() {
global $post;
self::$post = $post;
}
public function restoreGlobalPostVariable() {
global $post;
$post = self::$post;
}
}
new FixConflict_WRMegaMenuAndAdminPageFramework;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment