static function get_redirect_url($requested_redirect_to) { global $wpdb, $rul_db_addresses; $redirect_to = false; $rul_all = $wpdb->get_var('SELECT rul_url FROM ' . $rul_db_addresses . ' WHERE rul_type = \'register\' LIMIT 1'); if ($rul_all) { $redirect_to = rulRedirectFunctionCollection::rul_replace_variable($rul_all, false); return $redirect_to; } // No rule exists return $redirect_to; }
function rul_replace_variable($string, $user) { preg_match_all("/\\[variable\\](.*?)\\[\\/variable\\]/is", $string, $out); foreach ($out[0] as $instance => $full_match) { $replaced_variable = rulRedirectFunctionCollection::rul_get_variable($out[1][$instance], $user); $string = str_replace($full_match, $replaced_variable, $string); } return $string; }