Support

Account

Home Forums Feature Requests Options page input used as field label for other custom fields Reply To: Options page input used as field label for other custom fields

  • Put it in your functions.php file

    
    // this adds a filter for the field that you want
    // to dynamically set the label for
    // it can be used in several ways
    // https://www.advancedcustomfields.com/resources/acfload_field/
    add_filter('acf/load_field/key=field_0123456789abc', 'set_my_field_label');
    
    // this is the function that is called for the filter
    function set_my_field_label($field) {
      // get the value from the field you want to use for the label
      $label = get_field('field_label_option', 'option');
      if ($label) {
        // if the option is set then change the field label
        // almost any field argument can be changed dyamically
        $field['label'] = $label;
      }
      return $field;
    }