Support

Account

Home Forums Search Search Results for 'q'

Search Results for 'q'

topic

  • Solving

    How to change “Add to Gallery” button text?

    How do I change the wording of the “Add to Gallery” button in the admin? I see online that there have been a couple of requests for this over the years, but I can not find an answer.

  • Unread

    Color Picker Palette(s) more than three colors breaks ui

    When using the ACF color picker with a dynamically loaded color palette from theme.json, everything works — but if you pass more than three colors, the color swatches break the layout in the admin UI. The swatches wrap poorly or appear misaligned, making the interface look cluttered and hard to use.


    <script type="text/javascript">
    (function ($) {
    acf.add_filter('color_picker_args', function (args, field) {
    args.hide = false;
    args.palettes = <?php echo json_encode($colors); ?>;
    return args;
    });
    })(jQuery);
    </script>

    💥 Example Screenshot:
    breaking colors

  • Unread

    University of Oxford Fees and Programs – ApplyBuds

    Dreaming of studying at a globally top-ranked university? Our new blog explores the University of Oxford, boasting #1 in Geography, #2 in History, and #3 in Physics (QS). Learn about tuition, living costs (approx. £45,000 annually), and exciting programs like Computer Science & Philosophy. Your Oxford journey starts here – https://applybuds.com/blog/university-of-oxford-fees-and-programs/

  • Unread

    Nirma University Fees and Programs – ApplyBuds

    Unlock your academic potential at Nirma University! This blog post provides a comprehensive guide to this prestigious institution in Gujarat, covering everything from tuition fees (INR 3.2L – 5.7L annually) to its impressive QS Engineering ranking (#251-300). Learn more and plan your future.

  • Unread

    Commercial HVAC Dallas TX – XD Contractors

    XD Contractors is Dallas’s go-to for dependable commercial HVAC services. Recognizing the crucial link between a comfortable, safe environment and business success, our skilled technicians deliver customized HVAC solutions. We ensure your commercial space benefits from efficient heating, cooling, and ventilation.

    Our comprehensive offerings cover everything from new installations and replacements to routine upkeep and necessary repairs, all tailored to your specific business demands. We also prioritize boosting energy efficiency and indoor air quality, aiming to lower expenses while maximizing comfort. With 24/7 availability, we’re ready for emergencies and offer complimentary consultations to discuss your HVAC needs.

  • Solved

    WP 6.8 Gutenberg blocks won’t register

    Hi,

    I’m just testing the WP 6.8 update and noticed the following error:

    
    acf-pro-blocks.min.js?lfr=Ni40LjAuMQ%3D%3D:1 Uncaught TypeError: Cannot read properties of undefined (reading 'attributes')
        at E (acf-pro-blocks.min.js?lfr=Ni40LjAuMQ%3D%3D:1:25129)
        at Array.map (<anonymous>)
        at acf-pro-blocks.min.js?lfr=Ni40LjAuMQ%3D%3D:1:40591
        at o (acf.min.js?lfr=Ni40LjAuMQ%3D%3D:1:1403)
        at Object.doAction (acf.min.js?lfr=Ni40LjAuMQ%3D%3D:1:573)
        at n.doAction (acf.min.js?lfr=Ni40LjAuMQ%3D%3D:1:14776)
        at post-new.php?post_type=page:2472:5
    

    This is coming from this bit of code:

    
    const u = wp.blocks.registerBlockType(t.name, t);
    return u.attributes.anchor && (u.attributes.anchor = {
      type: "string"
    }),
    

    registerBlockType has a return type of

    WPBlockType | undefined: The block, if it has been successfully registered; otherwise undefined

    Seems like something changed in 6.8 making the block registration fail in JS.
    None of my custom blocks are registered after the update. I’m using the latest ACF PRO version (6.4)

  • Solved

    Can I get the return value of a post object that is itself a post object?

    For example, I have 3 field groups for 3 Post Types: LOCATION, CALENDAR and EVENTS. CALENDER has a Post-Object field “location” with the Post Type LOCATION. EVENT has a Post-Object field “calender” with Post Type CALENDER. How do I display the name of a location for an EVENTS template that is returned in CALENDAR?
    I hope the question is clear.

  • Unread

    Repeater Field Returns Null

    I know I’m not the first person to ask this but I’ve been trying to resolve this on and off for a while and I can’t find a resolution so any help is appreciated. I’ve built a few sites in the past using ACF Pro for much of my theme development but after a long stint with Magento I can’t figure out what I’m doing wrong.

    I have a Field Group with a Repeater Field which is populated on the page dashboard in WP. Trying to display repearter field values like this:


    if( have_rows('homepage_cta') ):

    // Loop through rows.
    while( have_rows('homepage_cta') ) : the_row();

    // Load sub field value.
    the_sub_field('cta_title');
    // Do something, but make sure you escape the value if outputting directly...

    // End loop.
    endwhile;

    // No value.
    else :
    echo("bloop");
    endif;

    And I’m getting this echoed onto the page and for the life of me I’m not able to figure out why:


    (function() { var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)'); request = true; b[c] = b[c].replace( rcs, ' ' ); // The customizer requires postMessage and CORS (if the site is cross domain). b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs; }());

  • Unread

    Importing data to ACF Google Maps field

    Hi, I’ve created a CPT called ‘projects’ which has a Google Maps field called ‘location’. This works fine for creating new ‘projects’ however I have a CSV file with records that I need to import. Each record has a post name, LAT and LNG value. I wrote a script to create a WordPress XML import file. The post meta looks like this;

    
    ...
    <wp:postmeta>
    	<wp:meta_key><![CDATA[location]]></wp:meta_key>
    	<wp:meta_value>
    <![CDATA[
    a:4:{
    s:7:"address";s:0:"";
    s:3:"lat";d:50.0000000;
    s:3:"lng";d:-1.0000000;
    s:4:"zoom";i:9;
    }
    ]]></wp:meta_value>
    </wp:postmeta>
    ...
    

    When I import the XML file the pin is properly located on the map in post edit screen… however when I click to ‘save’ the post, the field is cleared.

    I’ve tried to set all of the optional fields too in the database like…

    a:12:{
    s:7:"address";s:0:"";
    s:3:"lat";d:50.0000000;
    s:3:"lng";d:-1.0000000;
    s:4:"zoom";i:9;
    s:8:"place_id";s:0:"";
    s:11:"street_name";s:0:"";
    s:17:"street_name_short";s:0:"";
    s:4:"city";s:0:"";
    s:5:"state";s:0:"";
    s:9:"post_code";s:0:"";
    s:7:"country";s:0:"";
    s:13:"country_short";s:0:"";
    }

    I assumed that it was because the search input is empty so I’ve even tried to make the field ‘required’ so that if someone updates the post they must first use the Google map to choose the placemarker again, but this didn’t work.

    I can’t work this out 🙁

  • Solving

    Display Current Month and Beyond?

    Hello, I wanted to display posts for the current month and beyond. Meaning, I would like to display dates for all of April and every date I have for the future. When April is done, the blog posts would be removed. Here is the current code I have to display for the current day:

    add_filter(‘kadence_blocks_pro_posts_grid_query_args’, ‘post_grid_sort_acf_date’, 20, 2);
    function post_grid_sort_acf_date($args, $attributes) {
    if (strpos($attributes[‘className’], ‘acf-sort’) !== false) {
    $args[‘meta_key’] = ‘release_dates’;
    $args[‘orderby’] = ‘meta_value_num’;
    $args[‘order’] = ‘ASC’;

    // Get the current date in the format that matches your ‘release_dates’ meta key values
    $current_date = current_time(‘Ymd’);

    // Add a meta query to filter posts with ‘release_dates’ in the future
    $args[‘meta_query’] = array(
    array(
    ‘key’ => ‘release_dates’,
    ‘value’ => $current_date,
    ‘compare’ => ‘>’,
    ‘type’ => ‘NUMERIC’
    )
    );
    }
    return $args;

    Sorry if this is in the wrong section. Thanks in advance.

  • Unread

    MyListing and WooCommerce Intergration

    Hi All!

    I am encountering an issue with the integration between Listing feature and WooCommerce. As a result of my research, I came across with this plugin!

    I aim to create a platform where my customers can list their products on my website. To achieve this, I’ve created a listing form that includes fields such as Title, Description, Category, Location, and Price.

    I don’t know if you have idea how MyListing theme whcih I use works, but it provides a feature that users can list their products ans sell.
    However, I would like to integrate the listings with WooCommerce features.

    My question is: Is there a way to integrate my listing as a WooCommerce product by creating fields that are compatible with WooCommerce using the MyListing infrastructure? Is this plugin provides such this feature?
    I would appreciate your asnwer and guidance on this matter.

  • Helping

    How Do I Do This?

    I have a question about ACF. I created an ACF group for a group of messages/lessons, which are also divided into subgroup lessons on addition, subtraction, multiplication, and division. I need to create a query from the ACF information that displays the lessons for the specific subgroups. I created a query for a particular taxonomy, but the sublessons don’t change for other categories. How do I make one in which the sublessons reflect the message category they belong to?

  • Unread

    Setting up a new directory for a specific ACF file field

    Hello,

    I have been trying unsuccessfully to change the upload path of any file uploaded via a specific ACF field.

    The field in question has a name of ‘pdf’ and a key of ‘field_67c62165a77ab’

    The upload directory I’d like to use is a folder called ‘resources’ inside the uploads folder. The directories of ‘wp-content’, ‘uploads’ and ‘resources’ all have the required write permissions of 7-7-5

    This is the code that I have tried using below. The result is that the file simply uploads in the media library using the standard month and date directory of WordPress. Maybe somebody could take a look and advise where it might be going wrong.

    function custom_acf_upload_prefilter( $file ) {
        // ACF Field key
        if ( isset($_POST['acf']['field_67c62165a77ab']) ) {
            
    // Set a custom upload directory
            $file['name'] = sanitize_file_name($file['name']);
            $upload_dir = wp_upload_dir(); // Get WordPress upload directory
            
            // Set custom folder
            $custom_dir = $upload_dir['basedir'] . '/resources/'; // Custom folder path
            
            // Create custom folder if it doesn't exist
            if (!file_exists($custom_dir)) {
                wp_mkdir_p($custom_dir);
            }
    
            // File's new path
            $file['path'] = $custom_dir . $file['name'];
            $file['url'] = $upload_dir['baseurl'] . '/resources/' . $file['name'];
            
        }
    
        return $file;
    }
    add_filter('acf/upload_prefilter', 'custom_acf_upload_prefilter');

    Something seems to be missing. Hopefully someone here can advise why the file is not getting pushed to the new directory. Thanks

  • Solved

    Target repeater subfield with JavaScript API

    I would like to catch the change event on the repeater subfield (post object), because I need to read the new value and display an error message if necessary.

    Another question is, where can I find the description of the showError function and its possible parameters?

  • Unread

    Google Maps field does not accept input

    I have been using ACF-Pro for a few weeks and have integrated the ACF field “Google Maps” on a website. So far this has worked without any problems.

    However, a few days ago the field stopped accepting input. The message “Location not found: REQUEST_DENIED” appears. The Google API is valid and I even entered the URL to the post in Google as a test, but unfortunately that didn’t help either.

    I design my website with Elementor Pro. If I place a “Google Maps” element as a test, I can enter the coordinates or the address and the map is displayed. The API is therefore valid.

    Does anyone here have a solution?
    I would be grateful for any tips.

  • Solving

    Auto-Scroll Bug in Gutenberg (WP 6.7+) When Creating a New Paragraph

    If you have an ACF block with mode => edit and it contains a WYSIWYG Editor field in visual mode, positioned below a newly created paragraph, WordPress incorrectly detects the iframe in WYSIWYG Editor as the new paragraph and scrolls down to it.

    🚨 However, if the ACF block is above the new paragraph, the issue does not occur.

    ### ✅ Quick fix:
    Change all blocks from 'mode' => 'edit' to 'auto':

    acf_register_block_type([
        'mode' => 'auto',
    ]);

    📌 This will fix the issue, preventing WordPress from scrolling to the WYSIWYG Editor.

  • Unread

    Displaying custom post types by year.

    Hello.
    I would like to know how i can display content post types by year.

    I need to create a set of portfolios each year where the team will have their details, a gallery etc.
    When we get to 2026, i would like to be able to click on 2025 and view all those who were part of the 2025 intake.

    Thanks in advance.
    Q

  • Unread

    How to Create Non-Content Custom Post Type Cards Using ACF?

    Hi,

    I want to create a custom post type using Advanced Custom Fields (ACF) where each post only consists of custom fields and has no content or single post page.

    Here’s my setup:

    I have a custom post type called “Brand”.
    Each brand has the following custom fields:
    Brand Name (title)
    Brand Description (text field)
    Brand Logo (image field)
    External Link (URL field)

    I don’t want these posts to have any content or a single post page.

    Instead, I want to display brand cards dynamically on a page, where clicking on a brand card redirects to its external link.

    How can I achieve this using ACF without relying on additional plugins? Any guidance on how to structure the query and prevent single post pages from being accessed would be appreciated!

    Thanks!

  • Solved

    Radius Circle on ACF Map

    I’m running into an issue of where to put some specific code..
    As you can see from the code I am entering the address (in admin) for the map and a radius, for the circle. I have NOT added the value of the radius to the circle function yet..

    Here is what I’m using for the map:

    
     <?php 
     $location = get_sub_field('map');
     $radius = get_sub_field('radius');
     var_dump($location);
     echo $radius; 
    
     if( $location ): ?>
      <section class="wrapper bg-light">
        <div class="map">
          <div class="acf-map" data-zoom="16">
              <div class="marker" data-lat="<?php echo esc_attr($location['lat']); ?>" data-lng="<?php echo esc_attr($location['lng']); ?>"></div>
          </div>
        </div>
        <!-- /.map -->
      </section>
      <!-- /section -->
    
      <style type="text/css">
      .acf-map {
          width: 100%;
          height: 500px;
          margin: 0;
      }
    
      .acf-map img {
         max-width: inherit !important;
      }
      </style>
    
      <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBfQsg-s2IP33YI4cXaUrGrJ4gGl-NAyaY&callback=Function.prototype"></script>
      <script type="text/javascript">
    
      (function( $ ) {
    
        /**
         * initMap
         *
         * Renders a Google Map onto the selected jQuery element
         *
         * @date    22/10/19
         * @since   5.8.6
         *
         * @param   jQuery $el The jQuery element.
         * @return  object The map instance.
         */
        function initMap( $el ) {
    
            // Find marker elements within map.
            var $markers = $el.find('.marker');
    
            // Create gerenic map.
            var mapArgs = {
                zoom        : $el.data('zoom') || 16,
                mapTypeId   : google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map( $el[0], mapArgs );
    
            // Add markers.
            map.markers = [];
            $markers.each(function(){
                initMarker( $(this), map );
            });
    
            // Center map based on markers.
            centerMap( map );
    
            // Return map instance.
            return map;
        }
    
        /**
         * initMarker
         *
         * Creates a marker for the given jQuery element and map.
         *
         * @date    22/10/19
         * @since   5.8.6
         *
         * @param   jQuery $el The jQuery element.
         * @param   object The map instance.
         * @return  object The marker instance.
         */
        function initMarker( $marker, map ) {
    
            // Get position from marker.
            var lat = $marker.data('lat');
            var lng = $marker.data('lng');
            var latLng = {
                lat: parseFloat( lat ),
                lng: parseFloat( lng )
            };
    
            // Create marker instance.
            var marker = new google.maps.Marker({
                position : latLng,
                map: map
            });
    
            // Append to reference for later use.
            map.markers.push( marker );
    
            // If marker contains HTML, add it to an infoWindow.
            if( $marker.html() ){
    
                // Create info window.
                var infowindow = new google.maps.InfoWindow({
                    content: $marker.html()
                });
    
                // Show info window when marker is clicked.
                google.maps.event.addListener(marker, 'click', function() {
                    infowindow.open( map, marker );
                });
            }
        }
    
        /**
         * centerMap
         *
         * Centers the map showing all markers in view.
         *
         * @date    22/10/19
         * @since   5.8.6
         *
         * @param   object The map instance.
         * @return  void
         */
        function centerMap( map ) {
    
            // Create map boundaries from all map markers.
            var bounds = new google.maps.LatLngBounds();
            map.markers.forEach(function( marker ){
                bounds.extend({
                    lat: marker.position.lat(),
                    lng: marker.position.lng()
                });
            });
    
            // Case: Single marker.
            if( map.markers.length == 1 ){
                map.setCenter( bounds.getCenter() );
    
            // Case: Multiple markers.
            } else{
                map.fitBounds( bounds );
            }
        }
    
        // Render maps on page load.
        $(document).ready(function(){
            $('.acf-map').each(function(){
                var map = initMap( $(this) );
            });
        });
    
      })(jQuery);
      </script>
    
    <?php endif; ?>

    And another forum post said to put this code in there:

            var cityCircle = new google.maps.Circle({
                strokeColor: "#9BCCDF",
                strokeOpacity: 0.8,
                strokeWeight: 2,
                fillColor: "#9BCCDF",
                fillOpacity: 0.35,
                map: map,
                center: latlng,
                radius: 40233.6,
                draggable: false
            });
    

    But any where I add it, it doesn’t work.
    Any help would be appreciated.

  • Solved

    504 Gateway Timeout

    Hey guys, this is my first post.

    I’m fairly new to ACF, and i recently migrated a site from my local machine to live servers.

    On local i had no issues, but on live i get 504 gateway errors fairly often but they don’t follow a predictable pattern. Through trial and error I found out by disabling ACF the errors go away. I am wondering if the way i set everything up is causing the issue.

    I have a custom post type called ‘projects’ and that post type has a field group with 16 fields (including 8 image fields). I am using the_field() and get_field() to output this data on the front end. Could the repeated queries to the database be the problem? Or should i not be using the_field or get_field?

    Should i upgrade to ACF pro so i can use the image gallery field, would this help the problem?

    A little insight from someone with more experience will help me massively to solve the issue, i appreciate you taking the time to read my post.

    Thanks!

  • Unread

    kadence pro + acf z zastosowaniem Query Loop i Query Card, Filter – Dropdown.

    Dzień dobry,

    Nie mogę filtrować po dodaniu pól acf. wcześniej po zastosowaniu wszystko działało: kadence pro + acf + WooCommerce z zastosowaniem Query Loop i Query Card, Filter – Dropdown. Z tych narzędzi korzystałem do pewnego momentu działało. Czy to problem z acf ?? korzystałem z WOOF tu również nie działały filtry tylko podstawowe WooCommerce. Proszę o pomoc

  • Unread

    WordPress is trying to sanitize and escape fields that contain arrays

    I have latest ACF pro and latest WordPress.
    This happens on wordpress editor.

    WordPress is trying to sanitize and escape fields that contain arrays instead of strings:
    PHP Warning: Array to string conversion in /wp-includes/formatting.php on line 1096

    [03-Mar-2025 20:40:11 UTC] ⚠ wp_check_invalid_utf8 received an array: Array
    (
        [genre] => Array
            (
                [0] => Array
                    (
                        [term_id] => 77
                        [slug] => dating-sim
                        [name] => Dating Sim
                        [parent] => 0
                        [term_taxonomy_id] => 77
                        [term_order] => 0
                        [facet] => {"term_id":77,"slug":"dating-sim","name":"Dating Sim","parent":0,"term_taxonomy_id":77,"term_order":0}
                    )
    
            )
    
        [index] => Array
            (
                [0] => Array
                    (
                        [term_id] => 1019
                        [slug] => i
                        [name] => I
                        [parent] => 0
                        [term_taxonomy_id] => 1019
                        [term_order] => 0
                        [facet] => {"term_id":1019,"slug":"i","name":"I","parent":0,"term_taxonomy_id":1019,"term_order":0}
                    )
    
            )
    
        [language] => Array
            (
                [0] => Array
                    (
                        [term_id] => 120
                        [slug] => english-patched
                        [name] => English Patched
                        [parent] => 0
                        [term_taxonomy_id] => 120
                        [term_order] => 0
                        [facet] => {"term_id":120,"slug":"english-patched","name":"English Patched","parent":0,"term_taxonomy_id":120,"term_order":0}
                    )
    
                [1] => Array
                    (
                        [term_id] => 25
                        [slug] => japanese
                        [name] => Japanese
                        [parent] => 0
                        [term_taxonomy_id] => 25
                        [term_order] => 0
                        [facet] => {"term_id":25,"slug":"japanese","name":"Japanese","parent":0,"term_taxonomy_id":25,"term_order":0}
                    )
    
            )
    
        [publisher] => Array
            (
                [0] => Array
                    (
                        [term_id] => 7
                        [slug] => n
                        [name] => N
                        [parent] => 0
                        [term_taxonomy_id] => 7
                        [term_order] => 0
                        [facet] => {"term_id":7,"slug":"n","name":"N","parent":0,"term_taxonomy_id":7,"term_order":0}
                    )
    
                [1] => Array
                    (
                        [term_id] => 109
                        [slug] => squaresoft
                        [name] => SquareSoft
                        [parent] => 0
                        [term_taxonomy_id] => 109
                        [term_order] => 0
                        [facet] => {"term_id":109,"slug":"squaresoft","name":"SquareSoft","parent":0,"term_taxonomy_id":109,"term_order":0}
                    )
    
            )
    
        [region] => Array
            (
                [0] => Array
                    (
                        [term_id] => 24
                        [slug] => japan
                        [name] => Japan
                        [parent] => 0
                        [term_taxonomy_id] => 24
                        [term_order] => 0
                        [facet] => {"term_id":24,"slug":"japan","name":"Japan","parent":0,"term_taxonomy_id":24,"term_order":0}
                    )
    
            )
    
        [release-year] => Array
            (
                [0] => Array
                    (
                        [term_id] => 2013
                        [slug] => 1987
                        [name] => 1987
                        [parent] => 0
                        [term_taxonomy_id] => 2013
                        [term_order] => 0
                        [facet] => {"term_id":2013,"slug":"1987","name":"1987","parent":0,"term_taxonomy_id":2013,"term_order":0}
                    )
    
            )
    
    )
    
    [03-Mar-2025 20:40:11 UTC] 🔎 Function stack trace:
    /wp-includes/formatting.php (Line: 4699) → Function: wp_check_invalid_utf8
    /wp-includes/post.php (Line: 2989) → Function: esc_attr
    /wp-includes/post.php (Line: 2833) → Function: sanitize_post_field
    /wp-includes/class-wp-post.php (Line: 367) → Function: sanitize_post
    /wp-includes/post.php (Line: 1116) → Function: filter
    [03-Mar-2025 20:40:11 UTC] ⚠ wp_check_invalid_utf8 received an array: Array
    (
        [game_name] => Array
            (
                [0] => Array
                    (
                        [value] => Nakayama Miho no Tokimeki High School
                        [raw] => Nakayama Miho no Tokimeki High School
                        [boolean] => 
                        [date] => 1970-01-01
                        [datetime] => 1970-01-01 00:00:01
                        [time] => 00:00:01
                    )
    
            )
    
        [cdr_download_counter] => Array
            (
                [0] => Array
                    (
                        [value] => 6177
                        [raw] => 6177
                        [long] => 6177
                        [double] => 6177
                        [boolean] => 
                        [date] => 1970-01-01
                        [datetime] => 1970-01-01 00:00:01
                        [time] => 00:00:01
                    )
    
            )
    
        [rmp_vote_count] => Array
            (
                [0] => Array
                    (
                        [value] => 14
                        [raw] => 14
                        [long] => 14
                        [double] => 14
                        [boolean] => 
                        [date] => 1970-01-01
                        [datetime] => 1970-01-01 00:00:01
                        [time] => 00:00:01
                    )
    
            )
    
        [rmp_avg_rating] => Array
            (
                [0] => Array
                    (
                        [value] => 4.7
                        [raw] => 4.7
                        [long] => 4
                        [double] => 4.7
                        [boolean] => 
                        [date] => 2025-03-03
                        [datetime] => 2025-03-03 04:07:00
                        [time] => 04:07:00
                    )
    
            )
    
    )
    
    [03-Mar-2025 20:40:11 UTC] 🔎 Function stack trace:
    /wp-includes/formatting.php (Line: 4699) → Function: wp_check_invalid_utf8
    /wp-includes/post.php (Line: 2989) → Function: esc_attr
    /wp-includes/post.php (Line: 2833) → Function: sanitize_post_field
    /wp-includes/class-wp-post.php (Line: 367) → Function: sanitize_post
    /wp-includes/post.php (Line: 1116) → Function: filter
  • Unread

    Empty Data Fields in ACF Gutenberg Blocks

    I’ve built a number of custom blocks and I’ve noticed when copy/pasting them from the editor that data fields are always included even if they are empty or still have their default value. Below is an example where I’ve changed the field names to make it more readable but the point is that none of those values differ from the defaults set in ACF yet all fields are still being written. This is a very basic example but I have other blocks with a large number of fields with a value that is often “” or where the default remains unchanged.

    <!-- wp:acf/test-block {"name":"acf/test-block","data":{"field_heading":"Block Heading","field_sub_heading":"", "field_image":"", "field_gap":"40px", "field_show_button":"1", "field_link":{"title":"","url":"","target":""}},"mode":"preview"} -->

    This is obviously in contrast with core blocks where there is only a value if settings differ from the default.

    <!-- wp:paragraph -->
    <!-- wp:paragraph {"align":"center"} -->

    My question is: do these empty fields affect performance? My custom ACF blocks do seem to take longer to load in the editor especially if there is a custom block inside another custom block. And if this is what’s slowing them down, is there any way I can set up the blocks up to improve load times? I’ve noticed that if I use conditional logic to only show fields under certain circumstances the data fields aren’t included (setting Show Button to False results in the Link field not being displayed in the data).

    <!-- wp:acf/test-block {"name":"acf/test-block","data":{"field_heading":"Block Heading","field_sub_heading":"", "field_image":"", "field_gap":"40px", field_show_button":"0", "mode":"preview"} -->

    The blocks load fine on the front end but I would like to speed them up in the editor if at all possible.

    Many thanks,
    Kevin

  • Unread

    ACF field data in the WP notification email

    Seems simple enough, but for me, it’s a mind bender.

    I’ve created the desired field “lot_number”. It displays in the Registration form as expected. The field can be filled by the user when I test it.

    Here’s the question: How Can I get THAT information into the “New User Registration” email that is sent out by WordPress?

    Here is the information from ACF…

      Name: lot_number
      Key : field_67be1cdc82c28
      Slug: group_67be1cdb0c243

    New user registration on your site “MyWebsite.addr”:
    Username: [user_login]
    E-mail: [user_email]
    Lot Number: [acf field="{$lot_number}"]

    An email will be sent shortly containing a link to Add/Change your password.
    Please follow that link to add password to your registration.

    I’m old and nearly completely bald, so very little left to pull out! ANY help that can be provided would be GREATLY APPRECIATED!

  • Solving

    Force JSON Field Group Only

    Two question:

    1. Is there a way to “disable” field group editing and only use the field groups defined by json in the acf-json folder? The reason for this is to prevent users from making changes on the site, as oppose to the JSON file which is version controlled and synchronized across the different environment via CI/CD.

    2. Is there a way to delete the “database version” of a field group but retain the JSON version? When a user unknowingly makes an ACF change in the admin dashboard, it overrides the JSON version. We’ve been resolving this issue by deleting the field group (which also deletes the JSON) and then redeploying. Ideally, there’s a better way.

Viewing 25 results - 1 through 25 (of 21,298 total)