• Resolved madwester

    (@madwester)


    Hey there! Let’s see if someone can help me how to do this, it would be really appreciated 🙂

    I am printing my tables in PHP with this function: <?php tablepress_print_table( array( ‘id’ => ‘4’ )); ?>

    But with this, I always have to specify the ID and I would like to know if there is another way of reading what tables exist and then print them all? Without having to go to the PHP code and do it manually with the ID.

    Hopefully someone can help me :))))

    /Maddie

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Your best chance here is to use a PHP function to retrieve a list of all available IDs:

    $table_ids = TablePress::$model_table->load_all();
    foreach ( $table_ids as $table_id ) {
      tablepress_print_table( array( 'id' => $table_id ) );
    }

    Regards,
    Tobias

    Thread Starter madwester

    (@madwester)

    You’re an absolute legend!! responding in 2 seconds with the perfect, working answer! thanks heaps!!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

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

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Print all tables without specify ID in PHP code every time’ is closed to new replies.