How to insert more than one row of data into a table at one time

You could use a foreach loop – function mp_install_name_data() { global $wpdb; $table_name = $wpdb->prefix . “names”; $rows = array( array( ‘id’ => ‘1’, ‘name’ => ‘matt’, ‘age’ => ’20’, ‘point_one’ => ‘0.45’, ‘point_two’ => ‘0.22’ ), array( ‘id’ => ‘2’, ‘name’ =>’james’, ‘age’ => ‘6’, ‘point_one’ => ‘0.27’, ‘point_two’ => ‘0.17’ ) ); foreach( … Read more

Why majority of fileds in wp_posts table prefixed with post_?

You pretty much answered it – legacy code. WordPress is the result of years of code evolution, refactoring and (most importantly) multiple developers/coders/authors – whilst they’re getting pretty good at enforcing coding standards/consistency, there will always be a trail of the past.

Remove Line Breaks From Cell Content in WordPress

The <br/> tags are added by wpautop function that is hooked into the_content filter. So you need to unhook it from the page where your table is displayed. There are several ways to do this. With PHP you can do something like this (change the ‘your_page/post_id’ with the actual ID) function wpdg_91929_remove_autop_for_page( $content ) { … Read more