Index: functions.php
===================================================================
--- functions.php (revision 5760)
+++ functions.php (working copy)
@@ -823,20 +823,29 @@
return wp_specialchars(add_query_arg('_wpnonce', wp_create_nonce($action), $actionurl));
}
-function wp_nonce_field($action = -1, $name = "_wpnonce", $referer = true) {
+function wp_nonce_field($action = -1, $name = "_wpnonce", $referer = true, $echo = true) {
$name = attribute_escape($name);
- echo '';
+ $nonce_field = '';
+ if ( $echo )
+ echo $nonce_field;
+
if ( $referer )
- wp_referer_field();
+ wp_referer_field($echo);
+
+ return $nonce_field;
}
-function wp_referer_field() {
+function wp_referer_field( $echo = true ) {
$ref = attribute_escape($_SERVER['REQUEST_URI']);
- echo '';
+ $referer_field = '';
if ( wp_get_original_referer() ) {
$original_ref = attribute_escape(stripslashes(wp_get_original_referer()));
- echo '';
+ $referer_field .= '';
}
+
+ if ( $echo )
+ echo $referer_field;
+ return $referer_field;
}
function wp_original_referer_field() {