Created
October 8, 2009 01:00
-
-
Save newism/204612 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 | |
make_embed_params_tag_params() | |
{ | |
// the valid params for the tag | |
$valid_params = array( | |
'entry_id', | |
'weblog_id', | |
'url_title' | |
); | |
// for each of the embedded params | |
foreach ($TMPL->embed_vars as $key => $value) | |
{ | |
// parse the param key | |
// embed: ... | |
$param_key = substr($key, 6); | |
if( | |
// is the tag param actually set? | |
isset($TMPL->tagparams[$param_key]) === FALSE | |
// is the embbed param in the valid params array? | |
&& in_array($param_key, $valid_params) | |
) | |
{ | |
// add the embed param to the tag param | |
$TMPL->tagparams[$real_key] = $value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment