0

我有一个自定义数据库,我需要将数据分配给它来自的帖子 ID...

 $table_name = $wpdb->prefix . "customtable";

 $sql = "CREATE TABLE IF NOT EXISTS `$table_name` (
          `id` int(10) NOT NULL  AUTO_INCREMENT, //instead of AUTO_INCREMENT how can I assign post_id?
          `name` varchar(100) NOT NULL,
          `data` text NOT NULL,
          `date_c` int(10) NOT NULL,
          `date_m` int(11) NOT NULL,
          `flag_hidden` tinyint(1) NOT NULL DEFAULT '0',
          `flag_deleted` tinyint(1) NOT NULL DEFAULT '0',
          PRIMARY KEY (`id`)
        ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;"; 

通过将 分配post_idid列,我应该能够获得get_post_meta(get_the_ID(), '_moon_sortable_content', false);正确的数据?

4

0 回答 0