Coder Social home page Coder Social logo

Comments (5)

nlemoine avatar nlemoine commented on June 1, 2024

Hi @Nick-Fiasco,

Sorry, I can't consider your feature request for many reasons.

  • Some users might not be interested in having those flags. Maybe they'll use their own flag icon set. But the plugin will still load an extra stylesheet and image.
  • It's really easy to add them to your theme stylesheet using any package manager: https://github.com/legacy-icons/famfamfam-flags/tree/master/dist/sprite
  • Moreover, I don't like backend plugins messing with the front-end. I'm mostly a front-end developer and I like to keep things separated. There's enough plugins including scripts and styles out there ;)

from acf-country.

Nick-Fiasco avatar Nick-Fiasco commented on June 1, 2024

Okay no problem I can look into that.

Would you be able to point me in the direction of how to get the split values from the field?
I'm using the default country code and country name, but struggling to actually output the different values from the array.

So, the country name and the country code as separate values (in order to use the value to control classes for the flags).

I'm sure I'm just being a bit stupid, but what I've tried to far doesn't yield both the country code and name, only the name.

Any ideas?

Thanks

from acf-country.

nlemoine avatar nlemoine commented on June 1, 2024

I assume you get your field value with something like:

$country = get_field('my_country_field');

Then you can get values with:

$country_name = reset($country);
$country_code = key($country);

from acf-country.

Nick-Fiasco avatar Nick-Fiasco commented on June 1, 2024

Excellent, that is exactly what I needed!

Thank you very much.

from acf-country.

bramroos avatar bramroos commented on June 1, 2024

Hi, I'm stuck with the same. I've looked at your suggestion but have no idea how to get that to work. Do you have a working example?
Many thanks!

from acf-country.

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.