T
T
tropicalfruit2017-08-07 19:32:16
PHP
tropicalfruit, 2017-08-07 19:32:16

Import from custom wordpress table?

Good day to all,
I'm a beginner web dev, I ran into a problem. I am doing one project, it was necessary to import some data from Facebook, I created a separate table in the database for this, downloaded and parsed the data using curl and saved it there. All this now looks like a calendar, where events are displayed, with photos, links and so on. The customer asked to add the ability to add a photo and description to this event already from the WordPress admin panel. Accordingly, now you need to do something like a custom type of records, where records from this table will be imported.
Is there any best way to implement this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WordPress WooCommerce, 2017-08-07
@maxxannik

According to the correct one, it was necessary not to make a custom table, but a Custom Post Type. And then the question would not arise.
Now either cut the crutches further (if you started with crutches). Or try to go the hard way pulling on the WP List Table API https://codex.wordpress.org/Class_Reference/WP_Lis...

D
Denis Yudin, 2017-08-12
@denisday

There are two ways:

  1. Use the WP_List_table class
  2. Create a CPT, in a custom table, add a column matching strings to strings in wp_posts (Usually, a bunch is made by post_id). Next, write a save_post event handler that would synchronize the data from the post in wp_posts to a custom table. And do not forget to write a handler for the status change event for a post in WP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question