ACF Table Field Pro Add-on Docs Last updated:

Since version: v1.8.0

Release Candidate 1.8.0-RC1

This page documents version 1.8.0, which is available as Release Candidate 1.8.0-RC1 for manual installation. The current public version is 1.7.6, automatic plugin updates still deliver that version.

Download the Release Candidate from your account (Download the plugin) and install it manually (Install the plugin). Details may still change until the final release.

Filter acf_tablefield/ajax_capability

This filter sets the capability a user needs for the AJAX requests of the table editor. Every request is first checked with a nonce. If the filter returns a capability, the user must also have it. Otherwise the request is rejected with the HTTP status 403 and a JSON error.

Parameters

add_filter( 'acf_tablefield/ajax_capability', function( $capability, $action ) { 
 
	if ( 'render_content' === $action ) { 
 
		return 'edit_others_posts'; 
	} 
 
	return $capability; 
}, 10, 2 );
    • $capability
    • (string|false)
    • The capability the user needs, or false for no capability check. Only a non-empty string is checked with current_user_can().

    • $action
    • (string)
    • The AJAX request that is checked.

    • Options: render_content, wp_editor, cache_overlay_field_value

AJAX requests

Action Default Description
render_content false Renders shortcodes in table cells for the preview in the table editor.
wp_editor false Loads the WYSIWYG editor of a table cell.
cache_overlay_field_value edit_posts Saves settings of the table options modal site-wide for the next use, such as the import source.

Users who edit tables without the capability

Table fields can also be edited by users with few capabilities, for example subscribers in their user profile or in a front end form. If you require a capability for render_content or wp_editor, users without it no longer see the shortcode preview in cells and cannot open the WYSIWYG editor.

Previous and Next Sources

Parent sources