Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

I need a custom field that only Admins can see WordPress

  • SOLVED

I have profiles built using custom post types. I want to add a checkbox that only admins can see in these profiles.

So, the profile custom post type name is "users."

I'm using ACF Pro v5 field groups right now if that matters.

Then once the field is there, I need an IF statement in the custom post type page template that shows content if this new checkbox is checked.

Hopefully that makes sense.

Answers (2)

2015-04-29

Ross Wilson answers:

The easiest way is to create a new field group called Admin Options or something, and set it to only display if User is equal to Administrator in the location rules

2015-04-29

Arnav Joy answers:

do you know how to add new field using acf ?

and then you can use following :-

<?php
if( get_field('acf_checkbox_field_name') == 1 ) {

// show this section

}
?>


Kyler Boudreau comments:

Thanks Arnav. That's what I needed.