Created
June 5, 2020 11:00
-
-
Save danfisher85/339fa61922fc45fbfc91102a3794e60a to your computer and use it in GitHub Desktop.
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
/** | |
* Escapium - Instagram Feed deprecation | |
**/ | |
function df_admin_notice_esc_instagram_feed() { | |
global $current_user; | |
$user_id = $current_user->ID; | |
$plugin_url = 'https://wordpress.org/plugins/instagram-feed/'; | |
if ( ! get_user_meta( $user_id, 'df_admin_notice_user_meta')) { | |
echo '<div class="notice notice-warning" style="position: relative;"><p style="padding-right: 100px;">'; | |
printf( | |
__( 'As of March 31, 2020, Instagram will no longer offer access to its old API which is used to display feeds from Instagram accounts. It\'s recommended to use %1$s plugin instead of <strong>Escapium - Instagram Feed</strong> widget which is deprecated and will be removed with <strong>Escapium 1.6.2</strong> theme update.', 'escapium' ), | |
sprintf( | |
'<a href="%s" target="_blank">%s</a>', | |
$plugin_url, | |
esc_html__( 'Smash Balloon Social Photo Feed', 'escapium' ) | |
) | |
); | |
echo '<a href="?df-admin-notice-esc-instagram-feed" class="close" style="position: absolute; right: 14px; top: 10px;">' . esc_html__( 'Dismiss X', 'escapium' ) . '</a>'; | |
echo '</p></div>'; | |
} | |
} | |
add_action( 'admin_notices', 'df_admin_notice_esc_instagram_feed' ); | |
function df_admin_notice_ignore() { | |
global $current_user; | |
$user_id = $current_user->ID; | |
if ( isset( $_GET['df-admin-notice-esc-instagram-feed'] ) ) { | |
add_user_meta($user_id, 'df_admin_notice_user_meta', 'true', true); | |
} | |
} | |
add_action( 'admin_init', 'df_admin_notice_ignore' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment