Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress Importer Support #17

Closed
jeremyfelt opened this issue Jun 16, 2014 · 5 comments
Closed

WordPress Importer Support #17

jeremyfelt opened this issue Jun 16, 2014 · 5 comments

Comments

@jeremyfelt
Copy link

Hi @TobiasBg!

I'm running into this issue with TablePress and have been poking around to see if there's a good approach to regenerating the table ID associations.

The table data is inserted fine in posts and postmeta during import. Because of the missing tablepress_tables option, it does not show in the standard TablePress display. It does show if I go directly to edit.php?post_type=tablepress_table.

I could see hooking on wp_import_insert_post to regenerate the data. I could also see having a "regenerate" or "flush" option that triggers and entire rewrite of tablepress_tables. This could be useful in a case where that option is accidentally deleted for some reason as well.

Before I dig further—is this something that you could see supporting in the future? And have you given any thought to approach if so?

Thanks!

@TobiasBg
Copy link
Member

Hi @jeremyfelt!

Thanks for opening this ticket as a reminder! I haven't put that much thought and time into WordPress Importer support yet, given that TablePress has its own export/import system as a workaround here (mentioned in the link that you posted). I'm however very open to adding such support!

Using wp_import_insert_post in the WP Importer plugin looks like a good approach here, indeed. At first glance, the problem that I see is that the $post object for a table doesn't contain the table ID (as that's only stored in the tablepress_tables option, which is not exported, afaik).
So, there'd probably need to be a step in the WP Exporter that gets the table ID from the tablepress_tables option and adds it to a post meta field during the export, or something like that.
The alternative would be to simply assign a new/unused table ID to the imported tablepress_table post during the import. That way, imported tables would at least be visible in the TablePress UI, but chances are that existing [table] Shortcodes in posts/pages then point to the wrong table.

@TobiasBg
Copy link
Member

BTW, you might be interested in this TablePress Extension, which adds a "Debug" tab to TablePress, that shows some more internal information, and allows for easy editing of the tablepress_tables option, and more. It also makes the edit.php?post_type=tablepress_table entry visible in the admin menu for easy access.

TobiasBg added a commit that referenced this issue Oct 10, 2014
During export, add the table IDs for the exported `tablepress_table` posts into a pseudo post meta field.
During import, use those table IDs to restore the mapping from table ID to post ID in the `tablepress_tables` WP Option.
See #17.
@TobiasBg
Copy link
Member

Hi @jeremyfelt!
I just added TablePress integration into the WP import/export in 3e815dc (which will be part of TablePress 1.5 in a couple of days).
I hope it helps! :-)

@jeremyfelt
Copy link
Author

No way! That is fantastic! I was just showing this repo to our open lab this morning and I had forgotten about the issue. Thanks @TobiasBg!

@TobiasBg
Copy link
Member

No problem, @jeremyfelt :-) And thanks for spreading the word about the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants