Follow us on

Codestar Support Forum » WordPress Plugins » Codestar Framework

Anyway to pass value through callback field?

  1. Hello, I am creating a group of fields. and there is a callback field, I want to pass a value from another field but under the same group, is there any way to do this?
    thank you

    Posted 1 year ago #

  2. Codestar


    It can be possible with "sanitize" feature:

      'id'       => 'opt-group',
      'type'     => 'group',
      'title'    => 'Group',
      'sanitize' => 'tuyenvandovn_pass_values',
      'fields'    => array(
    function tuyenvandovn_pass_values( $value ) {
      // uncomment below code and see all values. ( disable ajax save for see all values later you can enable ajax save again )
      // var_dump( $value ); exit;
      $value[2]['title'] = $value[1]['title']; // for eg. it will update "group 1 title field" to "group 2 title field"
      return $value;

    Regards, Codestar

    Posted 1 year ago #
  3. it works. thank you

    Posted 1 year ago #

  4. Codestar

    You're welcome

    Posted 1 year ago #