I’m adding a field to toggle whether a comment is sticky or not, so I can bring to the top on the frontend an important comment, via ticking an option on the comment in wp-admin.
When I set the ‘Show this field group if’ to Comment = All it shows on the backend as well as the frontend. I’m generating the comment form using comment_form( $args )
How can I get this field to be backend only?
Add a prepare field filter https://www.advancedcustomfields.com/resources/acf-prepare_field/ and return false if it is not the admin
add_filter('acf/prepare_field/name=YOUR_FIELD_NAME", 'admin_only_field');
admin_only_field($field) {
if (!is_admin()) {
return false;
}
return $field;
}