Question

I only want to display it on all pages without the admin pages. How can? How to detect is it admin page or not?

My custom plugin file: ~/wp-content/plugins/mycplugin/mycplugin.php

if ( not admin page ) { // ?

    if ( defined ( 'WP_AUTO_UPDATE_CORE' ) ) {

        print '<div style="background-color: black; bottom: 0; color: white; font-family: monospace; font-size: 10px; opacity: 0.5; padding: 0.5em; position: fixed; width: 100%;">' . WP_AUTO_UPDATE_CORE . '</div>';

    } else {}

} else {}
Was it helpful?

Solution

Use is_admin() function. It will return true if it's wp-admin page and false on frontend. more here https://developer.wordpress.org/reference/functions/is_admin/

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top