Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
Created June 11, 2011 20:54
Show Gist options
  • Save alexkingorg/1020947 to your computer and use it in GitHub Desktop.
Save alexkingorg/1020947 to your computer and use it in GitHub Desktop.
Check for standard WP admin page before attaching action.
<?php
/*
Plugin Name: Standard WP Admin Page Check
Description: Example code.
Version: 1.0
Author: Alex King
Author URI: http://alexking.org
*/
function ak_wp_admin_standard_page_test() {
?>
<script type="text/javascript">
alert('This is a standard WP admin page.');
</script>
<?php
}
if ( !defined( 'IFRAME_REQUEST' ) ) {
add_action( 'admin_head', 'ak_wp_admin_standard_page_test' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment