WordPress.org

Support

Support » Plugins and Hacks » Hacks » Add $_GET data to the end of all generated links

Add $_GET data to the end of all generated links

  • I posted this in the wrong forum before so sorry for the double post…

    Basically i need to display a different theme when my site is viewed through a facebook iframe. The initial $_REQUEST[signed_request] that facebook sends is easy to use with an add_filter to the template and stylesheet. Problem is that once you click on any link it goes back to the default template because the $_REQUEST isnt there any more.

    I figure adding some $_GET data to the end of the urls could work from that point on, but an easy way to add it is hard to come by. adding a filter to the_permalink works on some things, but not all (like wp_list_pages) so i figured something in the rewrite rules may work… but i am stuck on the specific coding because i am not trying to decode the pretty permalink – i am trying to add some ugly get data :/

    Anybody have any ideas? i am at a loss when the code below didnt work.

    add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' );
    
    function my_insert_rewrite_rules( $rules )
    {
    	$newrules = array();
    	$newrules[''] = 'index.php?in_facebook=true';
    	return $newrules + $rules;
    }

    oh, and yes i do know about this plugin but it is so clunky using javascript to redirect that i couldnt handle it… i am hoping there is a better way.

Viewing 1 replies (of 1 total)
  • i am surprised that no one has run into this before – especially with the new iframes on facebook… or am i being too clever and outsmarting myself?

    opinions are good if you dont have answers 😀

Viewing 1 replies (of 1 total)
  • The topic ‘Add $_GET data to the end of all generated links’ is closed to new replies.
Skip to toolbar