Skip to content

Instantly share code, notes, and snippets.

@newism
Created October 8, 2009 01:00
Show Gist options
  • Save newism/204612 to your computer and use it in GitHub Desktop.
Save newism/204612 to your computer and use it in GitHub Desktop.
<?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