bobbingwide / field-block-for-acf-pro

Field block for ACF PRO
https://www.oik-plugins.com/oik-plugins/field-block-for-acf-pro/
GNU General Public License v2.0
3 stars 0 forks source link

Cater for ACF field type `message` #2

Open bobbingwide opened 1 year ago

bobbingwide commented 1 year ago

When I tried to use the ACF field type of message the response from render() was :288eh? This output is produced when the request to get_field_object() returns null.

2 things:

  1. Cater for the fact that ACF fields of type message do not get assigned a field name.
  2. Improve the debug information... display an Error of some kind in place of the existing code
echo $this->field_name;
print_r($this->field_info);
echo ':';
echo $this->post_id;
echo 'eh?';
bobbingwide commented 1 year ago

Note: In acf_field_block_get_possible_field_names() we can see that the "Message" field is registered as:

        [ID] => (integer) 379
        [key] => (string) "field_648729d7cffd8"
        [label] => (string) "Message"
        [name] => (string) ""
        [aria-label] => (string) ""
        [prefix] => (string) "acf"
        [type] => (string) "message"
        [value] => (boolean) 
        [menu_order] => (integer) 27
        [instructions] => (string) ""
        [required] => (integer) 0
        [id] => (string) ""
        [class] => (string) ""
        [conditional_logic] => (integer) 0
        [parent] => (integer) 56
        [wrapper] => *RECURSION* wrapper 1
        [message] => (string) "This is a message."
        [new_lines] => (string) "wpautop"
        [esc_html] => (integer) 0
        [_name] => (string) "message"
        [_valid] => (integer) 1