This does fix the media chooser issue but causes the Gravity Forms Add Form
button to disappear from the WYSIWYG field.
I’m also running in to this issue. I don’t see how priority would have any effect as the actual filter code is literally passing $value to both the $value and $orig_value parameters. There doesn’t appear to be any way that those would NOT be the same value which renders the $orig_value parameter useless.
Actually, I spoke too soon. Looks like there is already a JS event in ACF Pro for handline this situation. The event is:
render_block_preview
It passes two arguments, the element as a jQuery object and details about the block (name, content, mode, etc…). I put together a quick example usage here:
https://gist.github.com/hereswhatidid/a67dc3697a481c223bdced42586f6664
It’s been quite a while since this was originally posted but I would also love to see this type of event added. I have a few blocks that use their own custom JS events and it would be great to be able to initialize those for the user when previewing the block in the admin.
I’m experiencing this as well. I’m able to set the default alignment if I set up the block as part of a template but the block does not respect the default alignment if it’s added after the fact to a page.
I’m having trouble setting the default alignment as well except I’m unable to set the default alignment at the registration point. Are you able to have a block show up as Full Width by default? I have full-width enabled at the theme level and I’m able to set the width manually by the using the controls after a block has been put on the screen but they do not respect the default ‘align’ option.
This is an older question but I thought I’d chime in with what I believe was the issue here and this question ranks high in the searches.
In a multi-site situation where you’re hardcoding the fields via PHP you need to make sure those options are being initialized on all the sub sites as well. If you have a global options page on the primary site within a Multisite network but those options aren’t also initialized on the sub sites, you’ll get the above behavior. Specifically the data for the field is accessible but it doesn’t bring in any of the ACF-specific formatting. For example, a repeater field will just return the number of sub-items, not the actual content of the sub-items.
Also, it would be great if there was a little bit more visual distinction on the accordion title. Right now the title blends in with the fields below it.
Has there been any progress on this one? I still see it happening as of 5.6rc1
Thanks! And like I mentioned earlier, I was able to add in an option within the admin for adding values to the body class with about 8 lines of code but I wasn’t sure how to submit code changes like that. Also, the classes can be controlled through a JS filter but it isn’t quite as clean as an actual field setting:
http://hereswhatidid.com/2015/08/customize-acf-wysiwyg-input-styles/
I just wrote a blog post on how I was able to use the wrapper CSS Class field on the WYSIWYG to modify the body class within the rendered iframe:
http://hereswhatidid.com/2015/08/customize-acf-wysiwyg-input-styles/
I also have a fix in place that would add a new property to all WYSIWYG fields that lets you directly specific the classes rather than using the filter but I’m waiting on that to be reviewed.
Let me know what you think, thanks!
That’s actually the goal I had in mind. The field key on the body works a bit but you can’t really anticipate what that will be and it varies quite a bit once you start using repeaters.
I don’t believe you can target the content of an iframe with CSS in the parent document (as far as I know) so that wouldn’t really work. Technically I could use JavaScript to go in and manually apply the body class after the fact but that feels a bit hacky.
Thanks again! It works great.
I was able to put together a working prototype but I’m not sure what the best way is to get the code to you. Is there an email address I can send it over as an attachment? Otherwise I can post it to a gist if that’s easier.
Definitely interested in this as well. Would be great to be able to specify a unique editor-styles.css for each WYSIWYG field either through front end options or a filter.
It does abort the request from the front end’s perspective but the server will still process each of the admin-ajax.php calls. If you put in a debugger breakpoint at the end of the ‘get_choices’ method and then type in a several character search term, it will hit that break point for every character typed even though they were aborted from the browser.
Once the call to the server is initiated, xhr.abort() will only tell the browser to not wait for a response. The server will still process the initial request.
That was my conclusion too, I just wasn’t sure if there was any particular preference. Thanks!
Strange, it appears to be working now. Thanks for looking in to it!
I’m also having this issue when creating users specifically on a multi-site installation. The registration email sends out a link that goes directly to wp-activate.php which then attempts to render the page. This may be related to: https://core.trac.wordpress.org/ticket/23197
I’m also still getting this in 1.2.0 but clicking the “Return to Plugins” link rather than the “Return to Updates” link after updating does cause it to go away.
Just to confirm, a post revision point will not be created unless an edit is made to the actual default post content, right? I can see the updated custom fields fine in the revisions interface but new revision points aren’t saved unless a change has been made to the standard post content.
Did you say in the Stack Overflow question that setting the content.mode to browse didn’t always work? I just uncommented that line and it appears to be working correctly for me now.
It’s line 1748 in the input.js file.
The only thing I’ve noticed where it stays with the upload view now is if you use the Add Image after switching views in the default Media Manager. The reason that’s happening is there just isn’t a call to set the view to “browse” in the .popup() method.
Thanks! I’ll let you know if I figure anything out.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.