How hide update notifications and get updates_data wordpress?

i have hidden notifications of plugin and theme updates (I have tried several define and actions, and they all worked). at the same time i need to get the data of what updates the website need, and i used wp_get_update_data() and worked alone. my problem is to use both at the same time, but it don’t work.

i did this to try it

//it echo only https….Hello world
add_action( ‘wp_footer’, ‘my_function’ );
function my_function() {
$updates = wp_get_update_data();
echo $updates[‘title’];
echo get_site_url();
echo ‘hello world’;
}

//this is the last one I tried to hide
// hide update notifications
function remove_core_updates(){
global $wp_version;return(object) array(‘last_checked’=> time(),’version_checked’=> $wp_version,);
}
add_filter(‘pre_site_transient_update_plugins’,’remove_core_updates’); //plugins
add_filter(‘pre_site_transient_update_themes’,’remove_core_updates’); //themes

i need to get the data and at the same time hide all notification of update

Read more here:: How hide update notifications and get updates_data wordpress?

Leave a Reply

Your email address will not be published. Required fields are marked *