Comments (4)
I think I resolved issue. Problem was in Javascript when rewriting hidden field based on input.
With new ACF name field is setup differently. If you have time maybe you can check? but this works for me now!
In javascript acf-audio-video-field.js __getInputName function needs rewrite.
Before (line from line 86)
__getInputName: function __getInputName() {
var inputName = this.$inputContainer.children(':first').attr('name').split('][');
if (inputName[inputName.length - 1].indexOf('field') == 0) return inputName.join('][');
inputName.splice(inputName.length - 1, 1);
return inputName.join('][') + ']';
},
After update
__getInputName: function __getInputName() {
var inputName = this.$inputContainer.children(':first').attr('name').split('][');
return inputName;
},
from acf-audio-video.
Additional information:
ACF Pro v: 5.5.9
Wordpress v: 4.7.2
Video is uploaded and saved in media library.
When selecting the video and publish the video is not saved in DB.
In DB field is also empty. I use PHP to add ACF fields to posttype.
The field itself is stored in DB. But empty value.
from acf-audio-video.
This fix no longer seems to work.
from acf-audio-video.
The previous code works only for the first selection. After saving the post for the first time, there is no way to change the selected media or to empty the field.
After investigating a bit, I've found that the hidden input that is used for storing the value into the database was altered during the media selection.
Using the following code, everything seems work fine.
__getInputName: function __getInputName() {
var key = this.$field.data('key');
var inputName = 'acf['+key+']';
return inputName;
},
from acf-audio-video.
Related Issues (13)
- TypeError: $ is undefined HOT 2
- PHP warning when $attachment_url is an array HOT 3
- Add file error HOT 3
- Dont work more :( HOT 1
- New ACF Audio/Video Field
- Not working after Ajax
- Allowed file type setting does not work (and a quick suggestion for fix this) HOT 2
- Field not properly saved when created inside a flexible content field HOT 1
- undefined tag value
- File not saved HOT 1
- Add composer.json
- Doesn't work since Upgrade MediaElement to 4.X by wordpress core HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf-audio-video.