Advertisement:

Call a custom function inside BBC

Aloittaja Neo_TE, heinäkuu 10, 2013, 11:16:48 AP

« edellinen - seuraava »

Neo_TE

Hi,

I'm want to call a custom function inside a BBC, pass the value of $data to that function and send the return value from that function to content $1.



array(
'tag' => 'flickr',
'type' => 'unparsed_content',
'content' => '<iframe style="border:0;" width="600" height="400" src="http://www.flickr.com/slideShow/index.gne?user_id=$1" allowfullscreen></iframe>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'flickr\']))
$tag[\'content\'] = \'$1\';
$pattern = \'~photos/[^/]+/(?<img>[0-9]+)~i\';
if (preg_match($pattern, $data, $matches))
$data = $matches[1];'),                             ==> Have to call the custom function here and pass the value of $data <==
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),



live627

Have you checked the code tag for an example?

Neo_TE


Advertisement: