From what I can see using version 5.4.5 currently I still so no option to disable the field from editing.
I’m hoping for a solution as well 🙁 Apparently BP doesn’t use CPTs, things like “groups” are just a BP component so they are not accessible by ACF out of the box. I’m hoping to find a solution that lets me add ACF fields as freely as I do everywhere else, and then possibly using a Gravity Form (or other custom form solution) during the registration process to populate those fields.
Any other suggestions out there for making the connection?
I was able to get this figured out through a couple stack exchange forums. I did not end up using an ACF field because I wasn’t sure at the time. Essentially I have a rewrite rule hooked to init
and post_type_link
that uses the meta value of my custom field (which I imagine can be done with ACF as well. Here’s some of the code:
/* Add rewrite rules for permalink structure */
add_action( 'init', array( $this, 'map_rewrite_rules') );
add_filter( 'post_type_link', array( $this, 'filter_map_permalik'), 10, 2 );
public function setup_map_meta_boxes() {
add_meta_box('story-map', 'Map Series', 'story_attributes_meta_box', 'story', 'side', 'default');
}
public function map_rewrite_rules() {
add_rewrite_rule( '(.*)/([^/]+)/?$','index.php?story=$matches[2]','top' );
}
I made the custom field like so:
function story_attributes_meta_box($post) {
$pages = wp_dropdown_pages(
array(
'post_type' => 'map',
'selected' => $post->post_parent,
'name' => 'parent_id',
'show_option_none' => __('(no parent)'),
'sort_column' => 'menu_order, post_title',
'echo' => 0
)
);
if ( ! empty($pages) ) {
_e('<label class="fat-wide">Map: </label>');
echo $pages;
}
}
Hope that can help you on your project in some way
In my instance because the images I uploaded were too small (icons) they don’t have WP sizes so I had to set the image size to “full.” Apparently it doesn’t have any URL fallback for images sizes anymore… Same thing, only since 5.0.8
Thanks for Supernovae for your insight on this, helped me get a solution.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.