cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
280 stars 83 forks source link

Comma instead thousands in database #216

Closed KeenGamer closed 5 years ago

KeenGamer commented 5 years ago

Hello, is it possible to write into the database as a number without the comma? If we want to use the field somewhere else, it is not possible because for example 2,351 views should be simply 2351. Or where can we change it?

Thank you.

cabrerahector commented 5 years ago

Hi there,

The actual number is stored on the database as an integer, no formatting at all. The formatting takes place after the plugin retrieves the data from the database.

When you say:

If we want to use the field somewhere else ...

You mean for example displaying the views count of a post somewhere in single.php?

KeenGamer commented 5 years ago

Well, if I go and check the table postmeta to see data for one post, then meta_key views_total has meta_value 4,498 for example. And we take this field to another plugin which cannot work with commas in numbers...

cabrerahector commented 5 years ago

That data on your postmeta table isn't coming from WPP. Most likely from some custom code or from another plugin.

KeenGamer commented 5 years ago

Hmhm, ok, will try to find it out. Because the author of the theme told us that you are the author of the figure which is used... Where do you save the data, what table?

cabrerahector commented 5 years ago

WordPress Popular Posts stores its data in two tables: popularpostsdata (total views count, a.k.a. "All-time") and popularpostssummary (ranged data, eg. "last 7 days").

KeenGamer commented 5 years ago

Thank you.