Giter Site home page Giter Site logo

Comments (9)

Jeradin avatar Jeradin commented on May 28, 2024

Thank you for the report, not sure how I missed ever testing the field as required!

This issue should be resolved.

from acf-website-field.

aguidis avatar aguidis commented on May 28, 2024

Thank you for your responsiveness. When I saw this error message at the beginning, I thought it was due to the url I set. But it was a correct format. Is it possible to not register the field if it's a wrong url instead of displaying a message on the front ?

from acf-website-field.

Jeradin avatar Jeradin commented on May 28, 2024

Can you link a URL with the error message? I thought I disabled the front end error message.

from acf-website-field.

Jeradin avatar Jeradin commented on May 28, 2024

Ah, tested and I see what you are referring to. The Invalid URL on the front end.

I am not sure that is a better solution, if someone puts in a bad url and nothing displays on the front end, wouldn't that be confusing? Trying to think of another option.

I don't want to add ajax to the admin to validate the url, so the front end was the only place I could think of.

from acf-website-field.

aguidis avatar aguidis commented on May 28, 2024

Is there a way to use your function for cleaning the url before register it in database ?
I mean before the admin save the post ?
I tried when I looked at your code but I failed ^^'

from acf-website-field.

Jeradin avatar Jeradin commented on May 28, 2024

Can you post a URL that is causing an issue and I can run some validation tests.

ACF has a function to change a field value before it gets saved to the database...

    function update_value($value, $post_id, $field)
    {
        // Note: This function can be removed if not used
        return $value;
    }

But would like to run some tests before I mess with that.

from acf-website-field.

aguidis avatar aguidis commented on May 28, 2024

It was just an idea to optimize your plugin. I think it's better for the user experience to display an error message in the back office when the admin try to save his post with a wrong url.

from acf-website-field.

Jeradin avatar Jeradin commented on May 28, 2024

I think its a good idea, sometimes I get nervous adding ajax/jquery to the admin though.

Can you add a URL that was giving you an issue and I will run some tests to see how to add the feature.

Thanks Aguidis.

from acf-website-field.

aguidis avatar aguidis commented on May 28, 2024

I simply tried the value 'test'. So in back office my post was updated and in my page I could read "bad url". At this moment, I was wondering if I could change the code in order to call a function when my post is about to be updated. In order to check the field's value. But I'm not totaly comfortable with with the hook so I failed like I said ^^

from acf-website-field.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.