/** * Replace file URLs in new blog. * * @param Mlp_Copy_Attachments $copy_files * @return int|false Number of rows affected/selected or false on error */ private function update_file_urls($copy_files) { $tables = array($this->wpdb->posts => array('guid', 'post_content', 'post_excerpt', 'post_content_filtered'), $this->wpdb->term_taxonomy => array('description'), $this->wpdb->comments => array('comment_content')); $db_replace = new Mlp_Db_Replace($this->wpdb); $replaced_rows = 0; foreach ($tables as $table => $columns) { $table_name = new Mlp_Db_Table_Name($table, $this->table_names); $replaced_rows += (int) $db_replace->replace_string($table_name, $columns, $copy_files->source_url, $copy_files->dest_url); } return $replaced_rows; }
/** * Replace file URLs in new blog. * * @param Mlp_Copy_Attachments $copy_files * @return int|false Number of rows affected/selected or false on error */ private function update_file_urls($copy_files) { $tables = array($this->wpdb->posts => array('guid', 'post_content', 'post_excerpt', 'post_content_filtered'), $this->wpdb->term_taxonomy => array('description'), $this->wpdb->comments => array('comment_content')); $db_replace = new Mlp_Db_Replace($tables, $copy_files->source_url, $copy_files->dest_url, $this->wpdb); return $db_replace->replace(); }
/** * Replace file URLs in new blog. * * @param Mlp_Copy_Attachments $copy_files * @return int|false Number of rows affected/selected or false on error */ protected function update_file_urls($copy_files) { require dirname(dirname(__FILE__)) . '/inc/class-Mlp_Db_Replace.php'; $tables = array($wpdb->posts => array('guid', 'post_content', 'post_excerpt', 'post_content_filtered'), $wpdb->term_taxonomy => array('description'), $wpdb->comments => array('comment_content')); $db_replace = new Mlp_Db_Replace($tables, $copy_files->source_url, $copy_files->dest_url); return $db_replace->replace(); }