%2$s',
esc_url( DEPRECATION_NOTICE ),
esc_html__( 'Deprecation Notice', 'airstory' )
);
}
return $links;
}
add_filter( 'plugin_row_meta', __NAMESPACE__ . '\plugin_screen_deprecation_link', 10, 2 );
/**
* Show site admins and/or connected users a notice about the deprecation.
*/
function render_sunset_notice() {
$user_id = wp_get_current_user()->ID;
// Don't show this message if the user has already dismissed it.
if ( Settings\get_user_data( $user_id, 'sunset_notice_dismissed', false ) ) {
return;
}
if ( current_user_can( 'activate_plugins' ) ) {
$message = __( 'On this date, users will no longer be able to import posts from Airstory. Please plan on deactivating/removing the Airstory plugin ahead of this date.', 'airstory' );
} elseif ( Connection\has_connection( $user_id ) ) {
$message = __( 'On this date, you will no longer be able to import posts from Airstory. Please import any posts you wish to save into WordPress (or otherwise export from Airstory) ahead of this date.', 'airstory' );
} else {
// No connection or power to change things, so there's no message.
return;
}
// Ensure the necessary script is loaded.
wp_enqueue_script( 'airstory-sunset' );
// phpcs:disable Generic.WhiteSpace.ScopeIndent
?>
ID, 'sunset_notice_dismissed', true );
}
add_action( 'wp_ajax_airstory-dismiss-sunset-notice', __NAMESPACE__ . '\dismiss_notice' );
/**
* Display a notice above the user settings.
*/
function render_settings_page_sunset_notice() {
// phpcs:disable Generic.WhiteSpace.ScopeIndent
?>
Reminder: Airstory documents are being deprecated on January 15, 2019. Please export all content from Airstory by this date!', 'airstory' ) ); ?>