Moved to correct wpdb->posts parameter for mutlisite aware table name
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 18 Nov 2014 20:47:10 +0000 (15:47 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 18 Nov 2014 20:47:10 +0000 (15:47 -0500)
models/admin/add/index.php
models/admin/prototypes/delete.php
models/admin/prototypes/display.php
models/admin/prototypes/edit.php
models/admin/prototypes/index.php

index 1c6bac8..80d23c3 100644 (file)
@@ -179,7 +179,7 @@ class glmProtoAdmin_add_index
                         ));
 
                 // Store into wp_posts table
-                $result = $this->wpdb->insert('wp_posts',
+                $result = $this->wpdb->insert($this->wpdb->posts,
                         array(
                                 'post_date' => $date,
                                 'post_date_gmt' => $gmtDate,
index 0e0db90..7fec023 100644 (file)
@@ -89,7 +89,7 @@ class glmProtoAdmin_prototypes_delete
             $res = $this->wpdb->get_row(
                     "
                                DELETE
-                                 FROM wp_posts
+                                 FROM ".$this->wpdb->posts."
                                 WHERE post_type = 'glm_proto'
                                   AND id = $id
                        ", ARRAY_A);
index 2945d69..922ff6e 100644 (file)
@@ -92,7 +92,7 @@ class glmProtoAdmin_prototypes_display
                                           DATE_FORMAT(post_date, '%Y-%m-%d') p_date,
                                           post_title,
                                           post_content
-                                 FROM wp_posts
+                                 FROM ".$this->wpdb->posts."
                                 WHERE post_type = 'glm_proto'
                                   AND id = $id
                        ", ARRAY_A);
index f8fecf9..ba82e56 100644 (file)
@@ -101,7 +101,7 @@ class glmProtoAdmin_prototypes_edit
                 DATE_FORMAT(post_date, '%Y-%m-%d') p_date,
                 post_title,
                 post_content
-                FROM wp_posts
+                FROM ".$this->wpdb->posts."
                 WHERE post_type = 'glm_proto'
                 AND id = $id
                 ", ARRAY_A);
@@ -206,8 +206,7 @@ class glmProtoAdmin_prototypes_edit
                         ));
 
                 // Store into wp_posts table
-                $result = $this->wpdb->update(
-                        'wp_posts',
+                $result = $this->wpdb->update($this->wpdb->posts,
                         array(
                                 'post_date' => $date,
                                 'post_date_gmt' => $gmtDate,
@@ -250,7 +249,7 @@ class glmProtoAdmin_prototypes_edit
                 'modelRedirect' => false,
                 'view' => $view,
                 'data' => array(
-                    'content' => $content
+                        'content' => $content
                 )
         );
     }
index 43738af..2db371f 100644 (file)
@@ -133,7 +133,7 @@ class glmProtoAdmin_prototypes_index
                                   DATE_FORMAT(post_date, '%Y-%m-%d') p_date,
                                   post_title,
                                   post_content
-                         FROM wp_posts
+                         FROM ".$this->wpdb->posts."
                         WHERE post_type = 'glm_proto'
                  ORDER BY post_date, post_title
                        ", ARRAY_A);