Skip to content

Instantly share code, notes, and snippets.

@wpmudev-sls
Last active May 22, 2018 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmudev-sls/c320997fab1972ec720c8366d93055a5 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/c320997fab1972ec720c8366d93055a5 to your computer and use it in GitHub Desktop.
Fix Membership2 conflict with Impreza theme
<?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