dalenguyen / firebase-wordpress-plugin

A plugin that helps to integrate Firebase to WordPress
https://firebase-wordpress-docs.readthedocs.io
GNU General Public License v2.0
111 stars 31 forks source link

🐛 Inconsistent Post Type Collection Names When Using Dashes or Underscores #73

Closed oalexdoda closed 4 years ago

oalexdoda commented 4 years ago

There's two glitches when syncing custom post types with Firebase.

If the post type has two words (with either an underscore or a dash), it renders that too instead of camel-casing it.

Attachment

I think they should be “wpMusicVideos” and “wpElementorLibraries” instead. It would be great if collection names could also be custom labeled, so that if you wanted to drop the wp or take a deeper level of control over your database structure, you have that option.

The other glitch was that the word “library” gets pluralized as “librarys” instead of “libraries”.

dalenguyen commented 4 years ago

The collection name will be based on the post type plural label in v1.5.0.

oalexdoda commented 4 years ago

Does it remove dashes and underscores too? @dalenguyen

dalenguyen commented 4 years ago

@altechzilla Yes it does.

Fancy-Cars -> wpFancyCars Fancy_cars -> wpFancyCars Fancy Cars -> wpFancyCars

oalexdoda commented 4 years ago

Any reason they're prefixed with wp? Is there a case where the plugin would do a different prefix base?

dalenguyen commented 4 years ago

It's because it comes from WordPress and I don't want it to be a conflict with existing collection names in people database.

oalexdoda commented 4 years ago

Gotcha, makes sense!