Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Did you put a space in the slug when you created it? If so, you may need to do a quick import/export of the post types where you fill in the space with a dash or preferably an underscore, and then delete it afterwards.

    Thread Starter relish1227

    (@relish1227)

    I’d never looked at that import/export part before… I just copied the export text into an editor so I could figure out what was there and sure enough, I see:

    ” blog”:

    (I decided later I wanted it to be “blog-post”.)

    So, are you saying that if I grab the content from the “Export Post Types,” add an underscore to make it “_blog,” and then copy the updated text into the Import Post Types… that should fix it?

    Thread Starter relish1227

    (@relish1227)

    Okay, I tried it… renaming as “_blog” didn’t help. But I manually removed the whole section for that CPT and then imported the remainder and that did remove it.

    One follow-up question: Where is this information stored?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    For your first reply, yep, just copy the export half, make changes as necessary, and re-import the new version. It’s proven more handy than I first thought it would.

    We store our settings in a couple rows in the wp_options table. One row for all of the post types, one row for all of the taxonomies. Everything else is standard WordPress handling like posts being in wp_posts/wp_postmeta and taxonomy terms in their tables, etc. When someone uninstalls our plugin we also don’t delete our two rows, nor the content created. We assume nothing.

    Thread Starter relish1227

    (@relish1227)

    Thanks for the replies. For some reason the import didn’t work with the item starting with “_” — but, like I said, deleting it worked.

    Thanks for the database info. I really like your plugin, as it makes my life easier. ?? One criticism a colleague had of it is that it requires a trip to the database, whereas writing your own code to register CPTs doesn’t, so this plugin would make your site a little slower. It made me wonder if this plugin could just write to a file instead… What do you think of that? I suppose maybe there’s potentially permission issues.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Possibly, but I believe the db trip for this is rather minimal as compared to a good portion of a given load time.

    Also, there is the “Get Code” spot in the Import/Export tab that does its best to provide matching code that you can use move registration to somewhere else. It would turn the plugin more into a generator that registrator. It’s an option if you want it. You’d just need to remove the post types from or options afterwards so that you’re not doing both file version and db option version.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can't delete CPT’ is closed to new replies.