• Resolved Carl Gross

    (@carlgross)


    Hi all. If I connect to the WordPress plugins API for a particular plugin, I can view data about that plugin. For example, for the Woocommerce plugin, if I connect to:

    https://api.www.ads-software.com/plugins/info/1.0/woocommerce.json

    it will display data about the Woocommerce plugin.

    On that page, dates are displayed in a particular format (screenshot). I realize this may be a standard format. But I was wondering if there was a way to connect to this API ‘in a different locale,’ i.e. a way to display plugin info on this page, with dates in a different format. Is that possible?

    My educated guess is that what I want is not possible. If that’s the case, no worries–I’ll use this data and change format myself. But I just thought I’d do my due diligence and ask.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The API has a standard format, or it wouldn’t be useful. This API is not for general use, so it doesn’t have any options like locale.

    You have to recover the data and filter what you need, in this scenario you have a json answer, so retrieve the date and convert it manually with the DateTime class if the format is supported or otherwise date_create_from_format

    Thread Starter Carl Gross

    (@carlgross)

    OK thanks to both of you. I’ll grab that date as-is and modify it myself. We can consider this resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I connect to plugins API and display data in a different format?’ is closed to new replies.