Tag Info

New answers tagged


Storing data in a serialized array a is terrible way to store data unless all you want is to pulling out in a block. If you want to query the data contained in the serialized string you've got a mess. Don't do that. Store granular data. Second, your "custom table" really looks like the commentsmeta table or the postmetatable. It makes not sense to duplicate ...


Since you plan on retrieving and displaying the data ( and most likely wanting to sort it ) then you should store your reviews data in a custom table. All of these fields could be set as integer only: id,comment_id,food,service,location Then you could grab the data by joining this table to the comments table and the comments table to the posts table.


I guess, you can use the following function public function pre_install() { global $wpdb; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); $sql=" CREATE TABLE IF NOT EXISTS `".$wpdb->prefix."prelauncher` ( id mediumint(9) NOT NULL auto_increment, username tinytext NOT NULL, email varchar(255) NOT NULL, PRIMARY KEY ...


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.

Top 50 recent answers are included