Skip to content

Commit

Permalink
Merge pull request reduxframework#2328 from Enchiridion/master
Browse files Browse the repository at this point in the history
Updated render actions to pass arguments by reference so hooks can update data. Thanks @Enchiridion
  • Loading branch information
dovy committed May 15, 2015
2 parents b2fb765 + 65f3728 commit 6e15725
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions ReduxCore/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
// );
// }
Expand Down Expand Up @@ -3246,15 +3246,15 @@ 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'
*
* @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 );

Expand All @@ -3275,15 +3275,16 @@ 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'
*
* @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;
}
Expand Down Expand Up @@ -3344,15 +3345,15 @@ 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'
*
* @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'] = "";
Expand Down Expand Up @@ -3413,15 +3414,15 @@ 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}'
*
* @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 = '';
Expand Down Expand Up @@ -3464,15 +3465,15 @@ 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}'
*
* @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 ) );
}
}
}
Expand Down

0 comments on commit 6e15725

Please sign in to comment.