Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ckpicker

    (@ckpicker)

    Ok, I figured it out. Looks like there’s a JSON string in the options table that maps these values. So, I was just able to do the following:

    $tablepress_options = json_decode(get_option('tablepress_tables'));
    
    //Get Table ID from Post ID
    foreach($tablepress_options->table_post as $key => $value) {
    	if($value == $post_id) {
    		$table_id = $key;
    	}
    }

    Hope that helps someone else! Thanks for a great plugin!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question.

    Yes, that field in the wp_options table holds the connection between the table ID and the post ID in the wp_posts DB table.
    Good to see that you already found this! ??

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Map Table ID to Post ID’ is closed to new replies.