This started messing up for me. I’m not sure if I added a field that made it start to glitch but it looks like when it loads the page get_sub_field('section_title')
will get the appropriate value for each row but when I expand/collapse the row it will return NULL
. Would this be a JS issue?
I’m also looking for a way to accomplish this
Anyone have any experience with altering the datepicker in the admin via javascript?
I switched the theme to test out the plugin. Default theme worked, so that told me something in my theme was altering the code. Through a process of elimination in my functions.php file, I found that this function was causing it to alter the name field:
add_filter('get_the_excerpt', 'end_with_sentence');
function end_with_sentence($excerpt) {
$allowed_end = array('.', '!', '?', '...');
$exc = explode( ' ', $excerpt );
$found = false;
$last = '';
while ( ! $found && ! empty($exc) ) {
$last = array_pop($exc);
$end = strrev( $last );
$found = in_array( $end{0}, $allowed_end );
}
return (! empty($exc)) ? $excerpt.'</p><a class="cta-link" href="'. get_permalink($post->ID) . '" title="'. __( 'Read', 'wpBASEtheme' ) . get_the_title($post->ID).'">'. __( 'View Full Post <span>e</span>', 'wpBASEtheme' ) .'</a>' : rtrim(implode(' ', $exc) . ' ' .$last);
}
add_filter('wp_insert_post_data', 'end_with_sentence_on_save', 20, 2);
function end_with_sentence_on_save($data, $postarr) {
if ( ! empty( $data['post_content'] ) && $data['post_status'] != 'inherit' && $data['post_status'] != 'trash' ) {
$text = strip_shortcodes( $data['post_content'] );
$text = apply_filters('the_content', $text );
$text = str_replace(']]>', ']]>', $text );
$excerpt_length = apply_filters('excerpt_length', 55);
$data['post_excerpt'] = wp_trim_words($text, $excerpt_length, '');
} else {
return $data;
}
$allowed_end = array('.', '!', '?', '...');
$exc = explode(' ', $data['post_excerpt']);
$found = false;
$last = '';
while ( ! $found && ! empty($exc) ) {
$last = array_pop($exc);
$end = strrev( $last );
$found = in_array( $end{0}, $allowed_end );
}
if (! empty($exc)) $data['post_excerpt'] = rtrim(implode(' ', $exc) . ' ' .$last);
return $data;
}
So there’s no need to worry about this issue any longer.
It’s working on my clean WordPress 4.0 with a fresh database and the latest version of ACF. So I updated it on the site that I’m working on but it’s still doing the data-string thing.
I restored the website to the previous version of WordPress to just update the ACF plugin and only update the database for ACF. Still getting the data-string in the name field. I’m kind of at a loss. I’ve disabled all the other plugins to see if that was effecting it, but it’s not.
I did go from embedding ACF in my theme to using the plugins panel, but I wouldn’t think that’d have anything to do with it. This isn’t the first time I’ve switched it.
Any help would be greatly appreciated.
Thanks
I guess the latest version, 5.0.7, does say it’s tested up to 3.9.2 and not 4.0. Guess I’ll just have to wait. Well that’s there incase you’re unaware of it.
I just exported the custom fields of the working copy and put it into my functions.php folder. It’d be nice to be able to add more fields though.
Any chance this could get looked at? Created another project that’s doing the same thing with the latest version of ACF
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.