Last active
May 22, 2018 21:08
-
-
Save wpmudev-sls/c320997fab1972ec720c8366d93055a5 to your computer and use it in GitHub Desktop.
Fix Membership2 conflict with Impreza theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Fix Membership2 conflict with Impreza theme | |
* Plugin URI: https://premium.wpmudev.org/ | |
* Description: Fix Membership2 conflict with Impreza theme | |
* Author: Ariful Islam @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/profile/itsarifulislam | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
function remove_og_iamge_action( $data = null ) { | |
remove_action( 'save_post', 'us_save_post_add_og_image' ); | |
return $data; | |
} | |
function add_og_iamge_action( $data = null ) { | |
add_action( 'save_post', 'us_save_post_add_og_image' ); | |
return $data; | |
} | |
add_action('ms_model_before_save', 'remove_og_iamge_action'); | |
add_filter( 'ms_model_pages_get_page_types', 'remove_og_iamge_action', 10, 1 ); | |
add_action('ms_model_after_save', 'add_og_iamge_action'); | |
add_filter( 'ms_model_pages_create_missing_page', 'add_og_iamge_action', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment