EDITS.WS

Tag: acf

  • Manage Your Event Vendors: Using Notion WP Sync and ACF

    Discover the power of integrating Notion with WordPress. Enhance event sign-ups and vendor coordination with Notion WP Sync. A game-changer for event organizers! This comprehensive guide provides a step-by-step tutorial on setting up these tools on your WordPress site. Transform your event management process with this powerful integration.”

    The post “Manage Your Event Vendors: Using Notion WP Sync and ACF” first appeared on WP Mayor.

  • ACF’s 2023 Annual Survey Results Reinforce Plugin’s Focus on Improving the Block Building Experience

    Advanced Custom Fields (ACF), one of the plugins WP Engine acquired from Delicious Brains in 2022, has published the results if its first annual survey. Although ACF reports more than 4.5 million active users, including PRO site installs, the survey only gathered feedback from 2,031 respondents.

    These results are more representative of the plugin’s developer community, as 81% of respondents are developers who maintain between 11-50 websites. 63% use version control for their codebase, and 27% manage dependencies with Composer.

    The survey showed that ACF is still an important tool for its early adopters, as 50% said they have been using it since its early days and 70% of all respondents use the plugin on all the websites they build.

    When asked what type of sites they are building, respondents had the option to choose multiple answers. Sites using Classic WordPress themes are the most popular followed by Hybrid themes, Block themes, and page builders. Surveying those who use the block editor, 56% report that they build blocks using ACF blocks.

    “It was cool to see the strong representation of hybrid and block themes,” WP Engine Product Marketing Manager Rob Stinson said. “It shows us that there is growing adoption of the modern WP editor experience amongst the PHP friendly crowd that is the ACF user base.

    “We had this scoped for upcoming releases anyway, but it reinforces our focus on improving the block building experience in ACF.”

    Among those ACF users building sites with page builders, the most popular selections include Elementor, Divi, Beaver Builder, and WPBakery Page Builder. Naturally, ACF Extended is the most popular extension used with ACF, followed by Gravity Forms, Yoast SEO, and ACF Better Search.

    Respondents demonstrated high confidence in those maintaining the plugin, as 98% of them are comfortable updating ACF to the latest version. They are also confident in continuing to build on top of WordPress, as 91% of survey participants said they are likely to continue with the platform. For a more detailed look at the questions and responses, check out the 2023 annual survey results on the ACF website.

  • WordPress Custom Fields 101: Tips, Tricks, and Hacks

    Are you looking to make the most of custom fields on your WordPress website?

    Custom fields are a handy WordPress feature that allows you to add extra data and information to your WordPress posts and pages. A lot of popular WordPress plugins and themes use custom fields to store important data.

    In this article, we will show you how to use WordPress custom fields with some tips, tricks, and hacks.

    WordPress custom fields 101 tips tricks and hacks

    Since this is a long article, we have added a table of contents for easier navigation. Just use the quick links below to jump to the section you want to read:

    What Are WordPress Custom Fields?

    WordPress custom fields are metadata used to add extra information to the post or page you are editing.

    By default, when you write a new post, page, or any other content type, WordPress saves that content in two different parts.

    The first part is the body of your content that you add using the WordPress content editor.

    The second part is the information about that content. For example, the title, author, date, time, and more. This information is called metadata.

    A WordPress website automatically adds all the required metadata to each post or page you create. You can also create and store your own metadata by using custom fields.

    By default, the custom fields option is hidden on the post edit screen. To view it, you need to click on the three-dot menu in the top-right corner of the screen and select ‘Preferences’ from the menu.

    Open preferences in content editor

    This will open a popup where you need to switch to the ‘Panels’ tab and then enable the ‘Custom fields’ option.

    After that, simply click on the ‘Enable & Reload’ button to reload the post editor.

    Enable custom fields option

    The post editor will reload, and you will be able to see the Custom Fields panel below the content editor.

    Custom fields can be used to add any information related to the post, page, or other content type. This meta information can then be displayed in your theme.

    View custom fields in WordPress

    However, to do that, you will need to edit your WordPress theme files.

    Note: This tutorial is recommended for users who are already familiar with editing theme files. It is also helpful for aspiring WordPress developers who want to learn how to properly use custom fields in their own themes or plugins.

    Having said that, let’s take a look at how to add and use custom fields in WordPress.

    Adding Custom Fields in WordPress

    First, you need to open a post or page in the block editor so that you can add custom fields. Then, you must go to the Custom Fields meta box.

    Adding custom field name and value

    Next, you need to provide a Name for your custom field and then enter its Value. Click on the ‘Add Custom Field’ button to save it.

    The field will be stored and displayed in the Custom Fields meta box like this:

    View newly created custom field

    You can edit this custom field any time you want and then just click on the ‘Update’ button to save your changes. You can also delete it if you don’t want to use it anymore.

    Now, you need to save your post to store your custom field settings.

    Displaying Custom Fields in WordPress Themes

    To display your custom field on your website, you will need to edit your WordPress theme files and code snippets.

    We don’t recommend directly editing the theme files because the slightest mistake can break your website. An easier way to do this is by using WPCode.

    It is the best code snippet plugin for WordPress that lets you add custom code and manage snippets from your WordPress dashboard.

    If you haven’t done this before, then we also recommend reading our guide on how to copy and paste code in WordPress.

    First, you will need to install and activate the free WPCode plugin. For more details, please see our beginner’s guide on how to install a WordPress plugin.

    Upon activation, you will need to go to Code Snippets » + Add Snippet from the WordPress dashboard and select the ‘Add Your Custom Code (New Snippet)’ option.

    Adding a code snippet to your WordPress website

    Now you need to copy this code to add to your theme files:

    <?php echo get_post_meta($post->ID, 'key', true); ?>
    

    Don’t forget to replace key with the name of your custom field.

    Next, you must enter the code into the ‘Code Preview’ area and change the Code Type to ‘PHP Snippet’.

    Enter custom fields code

    For example, we used this code in our demo theme:

    <p>Today's Mood: <?php echo get_post_meta($post->ID, 'Mood', true); ?></p>
    

    From here, you can scroll down to the Insertion section.

    Here, you can select where the code will run. By default, WPCode will Auto Insert the code and run it everywhere on your website.

    Edit insertion method for code

    However, you can change this and select where you would like the custom field to appear.

    For example, we will choose the ‘Page Specific’ tab and select the ‘Insert Before Post’ option. This way, the custom field will appear at the beginning of the blog post.

    Insert before post

    You can now save your changes and visit the post where you added the custom field to see it in action.

    You can use this custom field in all your other WordPress blog posts as well.

    Displaying custom field

    You can also easily adjust the custom field for different blog posts. Simply create a new post or edit an existing one.

    Then, go to the Custom Fields meta box and select your custom field from the dropdown menu and enter its Value.

    Reuse custom field

    Once you are done, simply click the ‘Add Custom Field’ button to save your changes and then publish or update your post.

    Troubleshooting: Can’t Find Custom Field in Dropdown on Post Edit Screen

    By default, WordPress only loads 30 custom fields in the dropdown menu on the post edit screen.

    If you are using WordPress themes and plugins that already use custom fields, then those might appear first in the dropdown menu, and you won’t be able to see your newly-created custom field.

    To fix this issue, you will need to add the following code to your theme’s functions.php file or by using WPCode (recommended):

    add_filter( 'postmeta_form_limit', 'meta_limit_increase' );
    function meta_limit_increase( $limit ) {
        return 50;
    }
    

    The above code will change that limit to 50. If you still can’t see your custom field, then you can try increasing that limit even further.

    Creating a User Interface for Custom Fields Using Advanced Custom Fields

    As you can see, once you add a custom field, you will have to select the field and enter its value each time you write a post.

    If you have many WordPress custom fields or multiple authors writing on your website, then this is not an ideal solution.

    Wouldn’t it be nice if you could create a user interface where users can fill in a form to add values to your custom fields?

    In fact, this is what so many popular WordPress plugins already do.

    For example, the SEO title and meta description box inside the popular All in One SEO plugin is a custom meta box:

    AIOSEO SEO title and description

    The easiest way to create a user interface for adding custom fields is by using the Advanced Custom Fields plugin.

    The first thing you need to do is install and activate the Advanced Custom Fields plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, you need to visit the ACF » Field Groups page and click on the ‘Add New’ button.

    Add new field group

    A field group is like a container with a set of custom fields. It allows you to add multiple panels of custom fields.

    Now, you need to provide a title for your field group and click the ‘+ Add Field’ button in the top-right corner.

    Add new field

    You can now select a field type.

    Advanced Custom Fields allows you to create all sorts of fields, including text, image upload, number, dropdown, checkboxes, and more.

    Select field type and other details

    Next, you can scroll down to see other options for that particular field, like field name, field label, and default value. You can change them to your own requirements.

    You can also add multiple fields to your field group if you want. Once you are finished, just click on the ‘Save Changes’ button.

    View new field group

    Next, edit a post or create a new one, and you will see a new panel with your WordPress custom fields below the content editor.

    For detailed step-by-step instructions, you can see our guide on how to add custom meta boxes in WordPress posts and post types.

    How to Hide Empty Custom Fields With Conditional Statements

    So far, we have covered how to create a custom field and display it in your theme.

    Now let’s see how to check that the custom field is not empty before displaying it. To do that, we will modify our code to first check if the field has data in it:

    <?php 
    
    $mood = get_post_meta($post->ID, 'Mood', true);
    
    if ($mood) { ?>
    
    <p>Today's Mood: <? echo $mood; ?></p>
    
    <?php 
    
    } else {
    // do nothing;
    }
    
    ?>
    

    Don’t forget to replace Mood with your own custom field name.

    Adding Multiple Values to a Custom Field

    Custom fields can be reused in the same post to add multiple values. You just need to select the field again and add another value to the ‘Value’ box.

    Adding multiple values to a custom field

    However, the code we have used in the above examples will only be able to show a single value.

    To display all values of a custom field, we need to modify the code and make it return the data in an array. You will need to add the following code to your theme file:

    <?php 
    $mood = get_post_meta($post->ID, 'Mood', false);
    if( count( $mood ) != 0 ) { ?>
    <p>Today's Mood:</p>
    <ul>
    <?php foreach($mood as $mood) {
                echo '<li>'.$mood.'</li>';
                }
                ?>
    </ul>
    <?php 
    } else { 
    // do nothing; 
    }
    ?>
    

    Again, don’t forget to replace Mood with your own custom field name.

    In this example, you will notice that we have changed the last parameter of get_post_meta function to false. This parameter defines whether the function should return a single value or not. Setting it to false allows it to return the data as an array, which we then displayed in a foreach loop.

    How to Search Posts by Custom Field in WordPress

    WordPress’s default search doesn’t work with any custom fields on your website. It only uses the content to find the post you or your visitors are looking for on your site.

    However, SearchWP changes that by improving your WordPress search. It’s the best WordPress search plugin that goes beyond using the post content and indexes everything, including WordPress custom fields, PDF documents, custom tables, text, files, and more.

    You can adjust the search algorithm without editing code using SearchWP. Simply install the plugin and then head over to SearchWP » Algorithm from your WordPress admin area.

    After that, you need to go to the ‘Engines’ tab and then adjust the Attribute Relevance slider. This will change the importance given to each attribute during a search.

    Adjust the search relevance

    For instance, you can set the Custom Fields slider to maximum and adjust sliders for other attributes accordingly. This way, SearchWP will give preference to data in custom fields when searching for content in WordPress.

    Another advantage of using SearchWP is that works with some of the most popular custom field plugins, including Advanced Custom Fields (ACF), Meta Box, and Pods.

    For more details, you can read our beginner-friendly guide on how to improve WordPress search with SearchWP.

    Displaying Posts With a Specific Custom Key

    WordPress allows you to display posts with custom keys and their values. For example, if you are trying to create a custom archive page to display all posts with specific custom keys, then you can use the WP_Query class to query posts matching those fields.

    You can use the following code as a starting point:

    $args = array(
        'meta_key'   => 'Mood',
        'meta_value' => 'Happy'
    );
    $the_query = new WP_Query( $args );
     
    <?php 
    // the query
    $the_query = new WP_Query( $args ); ?>
     
    <?php if ( $the_query->have_posts() ) : ?>
     
        <!-- the loop -->
        <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
            <h2><?php the_title(); ?></h2>
            <?php the_content(); ?>
     
        <?php endwhile; ?>
        <!-- end of the loop -->
     
        <!-- pagination here -->
     
        <?php wp_reset_postdata(); ?>
     
    <?php else : ?>
        <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
    <?php endif; ?>
    

    Don’t forget to replace meta_key and meta_value parameters with your own values.

    How to Add Guest Author Name Using Custom Fields

    Do you want to add a guest post but don’t want to add a new user profile just for that post? An easier method is adding a guest author name as a custom field.

    To do this, you will need to add the following code to your theme’s functions.php file or use WPCode (recommended):

    add_filter( 'the_author', 'guest_author_name' );
    add_filter( 'get_the_author_display_name', 'guest_author_name' );
    function guest_author_name( $name ) {
    global $post;
    $author = get_post_meta( $post->ID, 'guest-author', true );
    if ( $author )
    $name = $author;
    return $name;
    }
    

    For more details, please see our guide on pasting snippets from the web into WordPress.

    This code hooks a function to the_author and get_the_author_display_name filters in WordPress.

    The function first checks for the guest author’s name. If it exists, then it replaces the author’s name with the guest author’s name.

    Now you will need to edit the post where you want to display the guest author’s name. Go to the Custom Fields meta box, add your guest author name, and finally click on the ‘Add Custom Field’ button.

    Guest author custom field

    For more details, see our article on how to rewrite guest author names with custom fields in WordPress.

    How to Display Contributors to an Article Using Custom Fields

    On many popular blogs and news sites, many authors contribute to writing a single article. However, WordPress only allows a single author to be associated with a post.

    One way to solve this problem is by using the Co-Authors Plus plugin. To learn more, see our guide on how to add multiple authors to a WordPress post.

    Another method is adding contributors as a custom field.

    First, you need to edit the post where you want to display co-authors or contributors. Then, scroll down to the Custom Fields meta box and add author names as co-author custom fields.

    Add coauthor custom fields

    Now, you need to add this code to your theme files where you want to show co-authors:

    <?php 
     
    $coauthors = get_post_meta($post->ID, 'co-author', false);
    if( count( $coauthors ) != 0 ) { ?>
    <ul class="coauthors">
    <li>Contributors</li>
    <?php foreach($coauthors as $coauthors) { ?>
               <?php echo '<li>'.$coauthors.'</li>' ;
                }
                ?>
    </ul>
    <?php 
    } else { 
    // do nothing; 
    }
    ?>
    

    To display author names separated by commas, you can add the following custom CSS:

    .coauthors ul { 
    display:inline;
    }
    .coauthors li { 
    display:inline;
    list-style:none;
    }
    .coauthors li:after { 
    content:","
    }
    .coauthors li:last-child:after {
        content: "";
    }
    .coauthors li:first-child:after {
        content: ":";
    }
    

    This is how it looked on our demo site.

    Coauthors custom fields preview

    How to Display Custom Fields Outside the Loop in WordPress

    What if you need to show custom fields in the sidebar of a single post?

    To display the custom fields outside the WordPress loop, you can add the following code to your theme files:

    <?php
    global $wp_query;
    $postid = $wp_query->post->ID;
    echo get_post_meta($postid, 'key', true);
    wp_reset_query();
    ?>
    

    Don’t forget to replace key with your custom field name.

    Display a Custom Header, Footer, Sidebar Using Custom Fields

    Usually, most WordPress themes use the same header, footer, and sidebar on all pages.

    There are also many ways to show different sidebars, headers, or footers for different pages on your website. You can see our guide on how to display a different sidebar for each WordPress post or page.

    One way to do this is by using custom fields. Just edit the post or page where you want to show a different sidebar and then add the sidebar as a custom field.

    Add sidebar custom field

    Now you need to edit your WordPress theme file, such as single.php, where you want to display a custom sidebar. You will be looking for the following code:

    <?php get_sidebar(); ?>
    

    Replace this line with the following code:

    <?php
    global $wp_query;
    $postid = $wp_query->post->ID;
    $sidebar = get_post_meta($postid, "sidebar", true);
    get_sidebar($sidebar);
    wp_reset_query();
    ?>
    

    This code simply looks for the sidebar custom field and then displays it in your theme. For example, if you add webpage as your sidebar custom field, then the code will look for a sidebar-webpage.php file to display.

    You will need to create the sidebar-webpage.php file in your theme folder. You can copy the code from your theme’s sidebar.php file as a starting point.

    Manipulating RSS feed Content With Custom Fields

    Want to display additional metadata or content to your RSS feed users? Using custom fields you can manipulate your WordPress RSS feed and add custom content into your feeds.

    First, you need to add the following code to your theme’s functions.php file or use WPCode (recommended):

    function wpbeginner_postrss($content) {
    global $wp_query;
    $postid = $wp_query->post->ID;
    $coolcustom = get_post_meta($postid, 'coolcustom', true);
    if(is_feed()) {
    if($coolcustom !== '') {
    $content = $content."<br /><br /><div>".$coolcustom."</div>
    ";
    }
    else {
    $content = $content;
    }
    }
    return $content;
    }
    add_filter('the_excerpt_rss', 'wpbeginner_postrss');
    add_filter('the_content', 'wpbeginner_postrss');
    

    Now, just create a custom field called ‘coolcustom’ and add any value you like. You can use it to display advertisements, images, text, or anything you want.

    For more details, please see our guide on how to copy and paste code from the web into WordPress.

    How to Manipulate RSS Feed Title With Custom Fields

    Sometimes you may want to add extra text to a post title for RSS feed users. For example, this can be handy if you are publishing a sponsored post or a guest post.

    First, you need to add the following code to your theme’s functions.php file or use WPCode to add the custom code snippet without breaking your website:

    function wpbeginner_titlerss($content) {
    global $wp_query;
    $postid = $wp_query->post->ID;
    $gpost = get_post_meta($postid, 'guest_post', true);
    $spost = get_post_meta($postid, 'sponsored_post', true);
    
    if($gpost !== '') {
    $content = 'Guest Post: '.$content;
    }
    elseif ($spost !== ''){
    $content = 'Sponsored Post: '.$content;
    }
    else {
    $content = $content;
    }
    return $content;
    }
    add_filter('the_title_rss', 'wpbeginner_titlerss');
    

    Next, you need to edit the post where you want to display the extra text in the title field.

    Then, add guest_post and sponsored_post as custom fields.

    Add guest post custom field

    If either of these two custom fields is found with a value “true”, then the code will add the appropriate text before the title. This technique can be used in many ways to fit whatever you like.

    Want to learn more cool RSS feed hacks? See our guide on how to add content and manipulate your WordPress RSS feeds.

    How to Set Expiration Date for Posts in WordPress Using Custom Fields

    Want to set an expiration date for some posts on your WordPress site? This comes in handy when you want to publish content only for a specific period like running surveys or limited-time offers.

    One way to do this is by manually removing the post content or by using a plugin like Post Expirator.

    Another option is using custom fields to automatically expire posts after a specific time. You will need to edit your theme files and modify the WordPress loop like this:

    <?php
    if (have_posts()) :
    while (have_posts()) : the_post();
    $expirationtime = get_post_meta($post->ID, "expiration", false);
    if( count( $expirationtime ) != '' ) {
    if (is_array($expirationtime)) {
    $expirestring = implode($expirationtime);
    }
    
    $secondsbetween = strtotime($expirestring)-time();
    if ( $secondsbetween >= 0 ) {
    echo 'This post will expire on ' .$expirestring.'';
    the_content();
    } else {
    echo "Sorry this post expired!"
    }
    } else {
    the_content();
    }
    endwhile;
    endif;
    ?>
    

    Note: You will need to edit this code to match your theme.

    After adding this code, you can add the expiration custom field to the post you want to expire. Make sure you add the time in this format mm/dd/yyyy 00:00:00.

    Adding an expiration date using custom field

    How to Style Individual Posts Using Custom Fields

    Want to change the look of an individual post using CSS? WordPress automatically assigns each post its own class, which you can use to add custom CSS.

    However, by using custom fields, you can add your own custom classes and then use them to style posts differently.

    First, you need to edit a post that you would like to style differently. Go to the Custom Fields box and add the post-class custom field.

    Post class custom field

    Next, you need to edit your WordPress theme files and add this code at the beginning of the WordPress loop:

    <?php $custom_values = get_post_meta($post->ID, 'post-class'); ?>
    

    Now you need to find the line with the post_class() function.

    Here is how it looked in our demo theme:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    

    You must change this line to include your custom field value, like this:

    <article id="post-<?php the_ID(); ?>" <?php post_class($custom_values); ?>>
    

    Now if you examine the post’s source code using the Inspect tool, then you will see your custom field CSS class added to the post-class.

    Post class preview

    You can now can use this CSS class to add custom CSS and style your post differently.

    We hope this article helped you learn more about WordPress custom fields. You may also want to see our guide on how to add custom meta fields to custom taxonomies in WordPress and the best WordPress page builder plugins to help you design your website the way you want.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post WordPress Custom Fields 101: Tips, Tricks, and Hacks first appeared on WPBeginner.

  • ACF Plugin’s Reflected XSS Vulnerability Attracts Exploit Attempts Within 24 Hours of Public Announcement

    On May 5, Patchstack published a security advisory about a high severity reflected cross-site scripting (XSS) vulnerability in ACF (Advanced Custom Fields), potentially affecting more than 4.5 million users. WP Engine patched the vulnerability on May 4, but the Akamai Security Intelligence Group (SIG)  is reporting that attackers began attempting to exploit it within 24 hours of Patchstack’s publication.

    “Once exploit vector details are publicly released, scanning and exploitation attempts rapidly increase,” Akamai Principal Security Researcher Ryan Barnett said. “It is common for security researchers, hobbyists, and companies searching for their risk profile to examine new vulnerabilities upon release. However, the volume is increasing, and the amount of time between release and said growth is drastically decreasing. The Akamai SIG analyzed XSS attack data and identified attacks starting within 24 hours of the exploit PoC being made public.

    “What is particularly interesting about this is the query itself: The threat actor copied and used the Patchstack sample code from the write-up.

    Patchstack’s security advisory includes a breakdown of the vulnerability, sample payload, and details of the patch.

    Although the vulnerability, assigned CVE-2023-30777, was promptly patched, and WP Engine alerted its users the same day, site owners have been slow to update to the latest, patched version of the plugin (6.1.6). Only 31.5% of the plugin’s user base are running version 6.1+, leaving a significant portion still vulnerable unless they are protected by additional security measures like virtual patches.

    “Exploitation of this leads to a reflected XSS attack in which a threat actor can inject malicious scripts, redirects, ads, and other forms of URL manipulation into a victim site,” Barnett said. “This would, in turn, push those illegitimate scripts to visitors of that affected site. This manipulation is essentially blind to the site owner, making these threats even more dangerous.”

    Barnett noted that attackers using the sample code from Patchstack indicates these are not sophisticated attempts, but the comprehensive security advisory makes vulnerable sites easy to target.

    “This highlights that the response time for attackers is rapidly decreasing, increasing the need for vigorous and prompt patch management,” Barnett said.

  • ACF Launches New Annual Survey

    WP Engine has launched an annual survey for Advanced Custom Fields (ACF), one of the plugins it acquired from Delicious Brains in 2022. ACF reports more than 4.5 million active users, including PRO site installs, and WP Engine Product Manager Iain Poulson reports that the plugin is “growing in every way since the acquisition.” ACF has added more users, features, and releases, along with community building efforts like bi-weekly office hours.

    This is the first time ACF has surveyed its user base about how they are building sites with WordPress and what can be improved. The survey starts with questions about the contexts in which professionals are using ACF and the volume and types of sites they are building. Respondents are asked about how they edit their sites, the type of license they are using, how often the reach for ACF in their toolbox, and which ACF features they use most often (i.e. REST API, ACF Blocks, Options pages, ACF Forms, Post Types Registration, etc.).

    The survey is on the lengthier side with an estimated 15 minutes to complete. As ACF is a critical and indispensable part of many WordPress developers’ workflow, helping to shape its future development may be worth the time. WP Engine has also added a few questions that may only be tangentially related to ACF, such as where users are hosting their WordPress sites and what they use for local development.

    “It’s our primary method for gathering insights and feedback from the WP community on what they would like to see in ACF,” WP Engine Product Marketing Manager Rob Stinson said. He also related the importance of previous customer feedback that helped ACF’s team plan and implement features like registering CPTs and Taxonomies (v6.1).

    “In the near term, we’re working on bringing a UI to register Options Pages which is a PRO plugin feature, some long requested features like bi-directional relationship fields and improvements to conditional logic rules for taxonomy fields,” Poulson said. “We will also be focussing a release on more ACF Blocks features and improvements. The survey won’t likely change those planned features, and the initial results are validating our planned work on ACF Blocks.”

    The survey ends May 19, 2023, and WP Engine plans to publish an aggregated and anonymized version of the results soon after the data is collected.

  • ACF 6.1 Adds Support for Registering Custom Post Types and Taxonomies

    ACF (Advanced Custom Fields) version 6.1 was released this week with support for creating Custom Post Types and Taxonomies. This is a long-awaited feature that users have been asking for since the earliest days of the plugin when it was still developed by its original author, Elliot Condon.

    When Delicious Brains acquired the plugin, the ACF community reiterated this feature request. WP Engine kept it on the roadmap when they acquired ACF in June 2022 and has finally been able to deliver. Registering post types and taxonomies is now available through a simple interface that works in a similar way to creating field groups and fields.

    After registering the CPT, users can then add an existing or new field group for it or create a taxonomy, and move on from there. The advantage is that users don’t have to break their workflows and use a different plugin for this functionality. For those managing client websites, it is one fewer plugin required.

    “We know there are a large number of ACF users registering custom post types (CPTs) and creating custom fields for them,” WP Engine Senior Product Manager Iain Poulson said. “But they have to register the CPTs either manually with code or using another plugin. The overarching workflow of modeling the data needed for a site build is fragmented between different plugins, UIs, and user experiences. We wanted to fix that!”

    The ACF development team has also created a dedicated import tool for users who want to migrate post types and taxonomies from the Custom Post Type UI (CPTUI) plugin to ACF in order to manage them all from one plugin. ACF has also built in the ability to disable post types and taxonomies from the plugin admin in case users do not require this feature in the update.

    ACF reports more than 4.5 million users, so it will be interesting to see how having this built in will impact the CPTUI user base, which is active on more than a million websites. Some users simply need custom post types but won’t require all of ACF’s capabilities, but there is certainly a large overlap between the two plugins.

    After expanding well beyond the creation of custom fields with this and previous updates, Poulson said they will be referring to the plugin as “ACF” more going forward. The plugin’s admin sidebar menu has been updated from “Custom Fields” to ACF.

    Version 6.1 also includes the following highlights and important changes:

    • New ‘browse fields’ button opens a modal to search and showcase all field types
    • Post Object, Page Link and Relationship fields now support filtering by post status
    •  Full compatibility with PHP versions 8.1 and 8.2
    • New option to filter field settings tabs so other plugins can add custom tabs and arrange their fields
    • Security fix backported to ACF 5.12.5 for a security issue where ACF might unserialize maliciously manipulated data which instantiates a class

    All of these new features are available in both the free version and ACF Pro. Check out the changelog for the full rundown of everything included in version 6.1.