Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can only read acf datas with this plugin.

    Here is a simple solution for read write acf data:

    add_action( 'rest_api_init', 'register_rest_acf_field' );
    function register_rest_acf_field() {
      register_rest_field( 'post_type', 'acf_field_name', [
        'get_callback'    => read_acf_field',
        'update_callback' => update_acf_field',
        'schema'          => null,
      ] );
    }
    
    function read_acf_field( $object, $field_name, $request ) {
      return get_field( $field_name, $object[ 'id' ] );
    }
    
    function update_acf_field( $value, $object, $field_name ) {
      if ( ! $value || ! is_string( $value ) ) {
        return;
      }
    
      return update_field( $field_name, strip_tags( $value ), $object->ID );
    }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    you should add this css code to /includes/library/icon-picker/css/icon-picker.min.css

    or

    you can create a css file in your theme with this css code and add this function to functions.php

    function my_admin_theme_style() {
    wp_enqueue_style(‘my-admin-style’, get_template_directory_uri() . ‘/path/to/admin/style.css’);
    }
    add_action(‘admin_enqueue_scripts’, ‘my_admin_theme_style’);

    for me it solved the problem

    .icon-picker-fonts-browser {position: absolute !important;}

Viewing 3 replies - 1 through 3 (of 3 total)