Skip to content

Instantly share code, notes, and snippets.

@sivel
Created February 28, 2009 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivel/71796 to your computer and use it in GitHub Desktop.
Save sivel/71796 to your computer and use it in GitHub Desktop.
<?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