Created
February 28, 2009 00:20
-
-
Save sivel/71796 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: multi-arg-script | |
Plugin URI: http://sivel.net/wordpress/ | |
Description: multi-arg-script | |
Version: 10 | |
Author: Matt Martz | |
Author URI: http://sivel.net | |
*/ | |
if ( defined('ABSPATH') ) { | |
function multi_arg_script() { | |
wp_enqueue_script('multi-arg-script', WP_PLUGIN_URL . '/' . plugin_basename(__FILE__) . '?arg1=one&arg2=two'); | |
} | |
if ( ! is_admin() ) | |
add_action('wp_print_scripts', 'multi_arg_script'); | |
} else { | |
if ( ! empty($_GET['arg1']) && ! empty($_GET['arg2']) ) | |
echo "window.onload = function(){ alert('IT WORKED! I got 2 args, ARG1: {$_GET['arg1']}, ARG2: {$_GET['arg2']}'); }"; | |
else | |
echo "window.onload = function(){ alert('IT DIDN'T WORK! I only saw this as my query_string: {$_SERVER['QUERY_STRING']}'); }"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment