0

i need to get the url wordpress site and the updates avaible on that site. after get these data use it. to test if i get them I tried to echo in the footer.

theoretically I should be able to echo $update

    //
 add_action( 'wp_footer', 'my_function' );

        function my_function() {
        $updates = wp_get_update_data();
         echo $updates['counts']['title'];
        echo get_site_url();
        echo 'hello world';
        }

but with it don't echo the number and what need update, but echo only url and hello world

1 Answer 1

1

First of all you should perform $updates = wp_get_update_data(); in the wp_footer() body because till then you don't have access to $updates variables.

add_action( 'wp_footer', 'my_function' );
function my_function() {
    $updates = wp_get_update_data();
    echo $updates['title'];
}
2
  • yes, i was just editing the question sorry
    – DevBeppe
    Feb 4, 2020 at 11:20
  • thank you, it's working without the 'count'
    – DevBeppe
    Feb 4, 2020 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.