From 65f37288c4a0abb1ee958a0ad9ad2db969bfa006 Mon Sep 17 00:00:00 2001 From: Shannon Little Date: Fri, 15 May 2015 17:13:39 -0600 Subject: [PATCH] Updated redux/field/.../render actions to pass arguments by reference so hooks can update data --- ReduxCore/framework.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/ReduxCore/framework.php b/ReduxCore/framework.php index f12033644..bc727ba4d 100644 --- a/ReduxCore/framework.php +++ b/ReduxCore/framework.php @@ -1671,14 +1671,14 @@ public function _enqueue() { // if ($this->args['sass']['enabled']) { // $ret = reduxSassCompiler::compile_sass($this); -// +// // if ($ret == reduxSassCompiler::SASS_FILE_COMPILE || $ret == reduxSassCompiler::SASS_NO_COMPILE) { // if (file_exists(ReduxFramework::$_upload_dir . $this->args['opt_name'] . '-redux.css')) { // wp_enqueue_style( -// 'redux-fields-css', -// ReduxFramework::$_upload_url . $this->args['opt_name'] . '-redux.css', -// array(), -// $timestamp, +// 'redux-fields-css', +// ReduxFramework::$_upload_url . $this->args['opt_name'] . '-redux.css', +// array(), +// $timestamp, // 'all' // ); // } @@ -3246,7 +3246,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field.id */ - do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/callback/before", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/{$field['type']}/callback/before", array( &$field, &$value ) ); /** * action 'redux/field/{opt_name}/callback/before' @@ -3254,7 +3254,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field.id */ - do_action( "redux/field/{$this->args['opt_name']}/callback/before", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/callback/before", array( &$field, &$value ) ); call_user_func( $field['callback'], $field, $value ); @@ -3275,7 +3275,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field.id */ - do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/callback/after", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/{$field['type']}/callback/after", array( &$field, &$value ) ); /** * action 'redux/field/{opt_name}/callback/after' @@ -3283,7 +3283,8 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field.id */ - do_action( "redux/field/{$this->args['opt_name']}/callback/after", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/callback/after", array( &$field, &$value ) ); + return; } @@ -3344,7 +3345,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field id */ - do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/render/before", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/{$field['type']}/render/before", array( &$field, &$value ) ); /** * action 'redux/field/{$this->args['opt_name']}/render/before' @@ -3352,7 +3353,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field id */ - do_action( "redux/field/{$this->args['opt_name']}/render/before", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/render/before", array( &$field, &$value ) ); if ( ! isset ( $field['name_suffix'] ) ) { $field['name_suffix'] = ""; @@ -3413,7 +3414,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field id */ - do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/fieldset/before/{$this->args['opt_name']}", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/{$field['type']}/fieldset/before/{$this->args['opt_name']}", array( &$field, &$value ) ); /** * action 'redux/field/{opt_name}/fieldset/before/{opt_name}' @@ -3421,7 +3422,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field id */ - do_action( "redux/field/{$this->args['opt_name']}/fieldset/before/{$this->args['opt_name']}", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/fieldset/before/{$this->args['opt_name']}", array( &$field, &$value ) ); //if ( ! isset( $field['fields'] ) || empty( $field['fields'] ) ) { $hidden = ''; @@ -3464,7 +3465,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field id */ - do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/fieldset/after/{$this->args['opt_name']}", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/{$field['type']}/fieldset/after/{$this->args['opt_name']}", array( &$field, &$value ) ); /** * action 'redux/field/{opt_name}/fieldset/after/{opt_name}' @@ -3472,7 +3473,7 @@ public function _field_input( $field, $v = null ) { * @param array $field field data * @param string $value field id */ - do_action( "redux/field/{$this->args['opt_name']}/fieldset/after/{$this->args['opt_name']}", $field, $value ); + do_action_ref_array( "redux/field/{$this->args['opt_name']}/fieldset/after/{$this->args['opt_name']}", array( &$field, &$value ) ); } } }