la funcion se fija si en el codigo estan estos parametros [dm]*[/dm] o [dmc]*[/dmc]
Código PHP:
function spm_codereplace($content) {
global $wpdb, $table_prefix;
$action = get_query_var('action');
if($action == 'descargar'){
preg_match("/\[dm\](\d+)\[\/dm\]/ise", $content, $array);
return $content = dm_download($array[1]);
} elseif ( $action == 'imagenes' ) {
return $content = '[gallery]';
} elseif ( stristr( $content, '[dmc]' )) {
return $content = preg_replace("/\[dmc\](\d+)\[\/dmc\]/ise", "dm_category('\\1')", $content);
} elseif ( stristr( $content, '[dm]' )){
preg_match("/\[dm\](\d+)\[\/dm\]/ise", $content, $array);
$content = preg_replace("/\[dm\](\d+)\[\/dm\]/ise", '', $content);
$content = str_replace('[gallery]', '', $content);
return $content = dm_embedded($array[1],$content);
} else {
return $content;
}
}