Support

Account

Forum Replies Created

  • Has anyone found a solution that adds “Bulk Edit” to taxonomies?

    I assume since stock WP doesn’t offer anything other than “Delete” in the UI this is a more difficult thing to implement.

    I’ve reviewed all the options on this page, and no luck, except maybe “AdminColumns” which is $90, and doesn’t clearly state if it can even bulk edit taxonomy fields.

  • Done!

    I’m sort of “wait and see” on the ownership change, but I can certainly see the advantages of having more resources available. I’ve seen some neat feature requests not happen probably more due to limited time/talent than anything else.

    Would like to see them hire you, John, if that’s ever an option. 🙂

  • Chasing my tail on this, php-fpm config had a typo in the logging setup, all my debugging was going nowhere… Thanks so much though, I’m very happy to now know how to fetch these values in flex content fields – very helpful!

    So this seems to work very well. For anyone finding this while searching, I use a lazy-loader (https://github.com/vb/lazyframe) for videos to keep page weight down (and we have some pages with 50+ videos) and for it to look nice and provide flexibility if the user wants to override the default vimeo thumb, I provide a field for the video thumbnail. The user only needs to enter the vimeo video ID.

    If the thumbnail/poster field isleft blank, I want to fetch the URL to the thumbnail from vimeo. This does that.

    	// Fetch vimeo thumbnail on save - takes video ID as input
    	add_filter('acf/update_value/key=field_60412898401c1', 'rf_acf_update_vimeo_thumb_inspo', 20, 4);	
    	function rf_acf_update_vimeo_thumb_inspo( $value, $post_id, $field, $original ) {
    		/* error_log( "in wfh thumb debug, value is $value", 0 );
    		error_log( "in wfh thumb debug, post_id is $post_id", 0 );
    		error_log( "in wfh thumb debug, field is " . print_r($field, true), 0 );
    		error_log( "in wfh thumb debug, original is $original", 0 ); */
    		
    		// only set a new value if the field is empty
    		if ( $value == '') {
    			// get url field's full name (includes flex name, row #, field name concatenated w/"_")
    			$field_name = $field['name'];
    			// strip this field's name from full name
    			$field_name = str_replace('_inspo_thumbnail_url', '', $field_name);
    			// append video ID field to stripped name
    			$field_name .= '_inspo_vimeo_video_id';
    			// use get_post_meta to get the value from the same row (inspo_vimeo_video_id)
      			$vimeo_video_id = get_post_meta($post_id, $field_name, true);
    			// get video here
    			$vimeo_meta = file_get_contents("https://vimeo.com/api/v2/video/$vimeo_video_id.json");
    			$vimeo_meta = json_decode($vimeo_meta);
    			$vimeo_thumb = $vimeo_meta[0]->thumbnail_large;
    			// set value
    			$value = $vimeo_thumb;
    			return $value;
    		} else {
    			error_log('$value was not empty',0);
    			return $value;
    		}
    	}
  • I’m lost on finding they key here. I’ve turned on field visibility on the “edit field group” page and my flexible content field, at the top level is “field_6018cb496afa3”. Then the layouts themselves don’t display a field key for the layout, but within the layout, there are keys for each row. In my example, the video ID field is “field_602f31fa1de20”.

    If I setup a filter with add_filter('acf/update_value/key=field_6018cb496afa3', 'my_function_name', 20, 4); or add_filter('acf/update_value/key= field_602f31fa1de20', 'my_function_name', 20, 4); and in my function I just var_dump everything, I get no output, suggesting that my filter is not firing because I’m not looking for the right field… Where am I going wrong here?

  • +1 to infinity and beyond – we have so many fields that need the WYSIWYG field not for sheer quantity of text but for the style options the editor provides.

    An older javascript hack floating around doesn’t seem to cope with flexible content fields either…

  • Just wanted to follow-up with an update.

    I raised a support ticket about the long-term viability of FC and got a reply from Elliot – basically, yeah this stuff is staying around and being actively developed/improved, and part of the ACF model is to fix an imperfect CMS basically… Really great to hear!

    Also opted to go with FC over ACF blocks for the project that brought all these questions up – there was some debate, but we’re OK until WP nukes the Classic “block”.

  • I wonder how common feelings like yours are in the development community? I am not in any user groups or other WP-related forums and such, but I’m kind of surprised at how radical a departure gutenberg is. I feel like there’s plenty of folks that will need to jump up their skills AND apparently learn React just to start working with gutenberg. It seems incredibly misguided, and I’m really hoping automattic doesn’t just drop the “classic” editor when they’ve decided everyone should be in gutenberg…

    I really appreciate your input, and the sites I’m thinking of are very similar – we want flexibility to piece elements together but we don’t want all sorts of random styling and such.

    I’ll try the contact form and see if I hear anything back regarding the long-term viability of Flexible Content.

  • Ugh. I have over 100 of these to convert…

  • This is bizarre – the fields are definitely not changing, and in the db I see the keys are all the same. Even further if I simply change the field type back to “repeater” from “group”, my data reappears…

    Additionally, if I try to add new data in this state, it does not show up on the frontend. And in the backend, validation is totally screwy – subfields that have no validation required fail validation for being empty (and don’t have the red asterisk).

    I suspect this tampering just totally confuses some part of ACF…

  • I finally got around to reading a bit about Local JSON, and trying this out on a dev site and… sadly it does not work. I simply changed one field from “repeater” to “group” and the data disappeared, frontend and backend.

    What’s weird is that if I look at the filed group ID, field ID for the repeater-turned-group and some subfields, the keys are unaltered. This implies that this switcheroo SHOULD work. I wonder if some validation is failing somewhere that makes ACF refuse to save data?

    Time for more digging…

  • I might be a bit off with this, but I ran into what I think is a similar issue. I look for an empty field (video thumbnail in my case), and if it’s empty, I look at another field (a vimeo video ID) and I do a little fetch of some json to grab the thumbnail URL and then save it. This has worked great for simple ACF fields.

    I recently wanted to use this in a Group, and noticed the field wasn’t updating.

    I had a few problems:

    – I was using ‘acf/update_value/name=thumbnail_url’ which will match any field (including subfields it turns out) with that name. Cool for most of my other ACFs where I can just have one filter in functions.php to cover a bunch of different ACF fields where I need this. Not cool for this subfield, as the video ID was also in a subfield, so my function was not finding a video ID.
    – I had no idea how to match a subfield in the “acf/update_value/name=foobar” format (still don’t)
    – I had no idea how to fetch the subfield with the video ID

    This was the original function/filter:

    	// Fetch vimeo thumbnail on save - takes video ID as input
    	function rf_acf_update_vimeo_thumb( $value, $post_id, $field ) {
    		// only set a new value if the field is empty
    		if ( $value == '') {
    			// get video here
    			$vimeo_video_id = get_field('vimeo_video_id');
    			// fetch thumb url(s)
    			$vimeo_meta = file_get_contents("https://vimeo.com/api/v2/video/$vimeo_video_id.json");
    			$vimeo_meta = json_decode($vimeo_meta);
    			$vimeo_thumb = $vimeo_meta[0]->thumbnail_large;
    			// set value
    			$value = $vimeo_thumb;
    			return $value;
    		} else {
    			return $value;
    		}
    	}
    	
    	add_filter('acf/update_value/name=thumbnail_url', 'rf_acf_update_vimeo_thumb', 10, 3);

    So to “fix” this:

    – I opted to give my thumbnail field a new name since I don’t know how to match on a subfield only, so that’s now “wfh_thumbnail_url”.
    – I randomly stumbled on another post in these forums that stated a subfield can be fetched by combining the group’s field name and the subfield name, so my “get_field()” for the video ID which is in the group “page_top” and is named “vimeo_video_id” is fetched with “get_field(‘page_top_vimeo_video_id’);”

    With those two changes, things seem to work well.

    // same, but sub-field
    	// Fetch vimeo thumbnail on save - takes video ID as input
    	function rf_acf_update_vimeo_thumb_alt( $value, $post_id, $field ) {
    		// only set a new value if the field is empty
    		if ( $value == '') {
    			// get video here
    			$vimeo_video_id = get_field('page_top_vimeo_video_id');
    			// fetch thumb url(s)
    			$vimeo_meta = file_get_contents("https://vimeo.com/api/v2/video/$vimeo_video_id.json");
    			$vimeo_meta = json_decode($vimeo_meta);
    			$vimeo_thumb = $vimeo_meta[0]->thumbnail_large;
    			// set value
    			$value = $vimeo_thumb;
    			return $value;
    		} else {
    			return $value;
    		}
    	}
    	add_filter('acf/update_value/name=wfh_thumbnail_url', 'rf_acf_update_vimeo_thumb_alt', 10, 3);

    I do wish I could just match with ‘acf/update_value/name=page_top_wfh_thumbnail_url’…

  • +1 on this being a built-in

    Some use cases:

    – blog category archive pages
    – woo product category archive pages
    – woo product tag archive pages

  • +1 on just settling on a method and adding to to ACF core.

    Just a “number of rows” for the textarea in the wysiwyg settings would be nice – we already have a toggle for media buttons, different toolbars, a “number of rows” would be perfectly natural there.

  • Just bumping this one – people seem to like the idea of ACF renaming things, and clearly there are going to be some edge cases where the plugin author is going to have an easier time knowing where the danger is… A year ago I did put in a feature request, and there was positive feedback there and a “I hope to fix this in future versions” response…

    I’m going to update that ticket too, see if anything comes from it.

  • Oh, also just going to post my code in case it’s helpful or if someone wants to yell at me for being wrong:

    	// Fetch vimeo thumbnail on save - takes video ID as input
    	function rf_acf_update_vimeo_thumb( $value, $post_id, $field ) {
    		// only set a new value if the field is empty
    		if ( $value == '') {
    			// get video here
    			$vimeo_video_id = get_field('vimeo_video_id');
    			// fetch thumb url(s)
    			$vimeo_meta = file_get_contents("https://vimeo.com/api/v2/video/$vimeo_video_id.json");
    			$vimeo_meta = json_decode($vimeo_meta);
    			$vimeo_thumb = $vimeo_meta[0]->thumbnail_large;
    			// set value
    			$value = $vimeo_thumb;
    			return $value;
    		} else {
    			return $value;
    		}
    	}
    	
    	add_filter('acf/update_value/name=thumbnail_url', 'rf_acf_update_vimeo_thumb', 10, 3);
  • Not sure if this is the correct usage, but I hit on “acf/update_value” and that seems to be working well. In the function I created, I only do anything if the value comes in empty. So for a new post, if the user has not opted to paste in a custom URL, I see a blank value and then go and fetch and decode the json from vimeo to get the video’s thumbnail URL and then set it.

    Subsequent edits of the page will similarly hit my “is it defined?” check and skip this. If the user wants to force a check for a new thumbnail for some reason they can blank out the URL and hit “submit” and the blank form will trigger another fetch. This seems pretty sane I think?

  • @etling – that is pretty cool. Also I like the idea that it’s sort of a one-shot and the user is free to later alter it. Hmmm…


    @hube2
    – I will look at this as well, I need to think about what approach is easiest for the end user (and also think about how often they might want to override, if ever).

  • Same! Going to open a support ticket.

    This is an un-google-able question, everyone is looking to do this for the terms, and I already have that working.

  • I opened a ticket on this to try to lodge this as a feature request.

  • I also would say that what others have suggested, with Fausto’s idea of making it selectable (update the underlying data or not when changing the field name) is a great idea.

    Two immediate use cases I can think of where this would be a time saver:

    – New developers who are doing lots of experimenting and realized they’ve named things in a way that no longer make sense
    – Seasond developers who inherit projects from elsewhere where some dingus has just used inscrutable/nonsensical/misleading names

    I mean, sure, you can poke around in the db, but I’d rather have a sane, automated way to deal with renames…

  • I hate to revive this, but it’s one of the more relevant threads I could find.

    I just created a CPT with some ACF custom fields in it to replace an old plugin that we’re ditching. All works well, but I cannot get the sorting to appear correctly.

    My data is stored in ACF date-picker “format” for new entries I assume, but the old entries did come in via a CSV import of heavily-massaged data (old plugin wanted $90 for an “export” feature, so F-that). Can I assume the dates are stored correctly if they are displaying correctly when pulling them via get_field()? Or no? This is ACF5, just noting that as there was mention of the format changing between 4 and 5.

  • I’m glad this is fixed, but having poked at the issue myself for a good hour or so, I’m incredibly curious about two things:

    – Being a javascript noob, I find debugging is the hardest part, what tool/tools do you use to poke at an issue like this? For example, I was looking at “event listeners” on the options button and didn’t see anything amiss…

    – What was the fix?

  • Just confirming ChrisAtMogul’s fix works as of 2/2019.

    Following the official upgrade guide did not result in the “database upgrade required” prompt.

  • What I don’t get here is that both buttons do have unique IDs. I’m not following how whatever js events are fired are tied to both buttons?

Viewing 25 posts - 1 through 25 (of 26 total)