/** * Checks whether the provided blob should be imported. * * @param WordPress_GitHub_Sync_Blob $blob Blob to validate. * * @return bool */ protected function importable_blob(WordPress_GitHub_Sync_Blob $blob) { global $wpdb; // Skip the repo's readme. if ('readme' === strtolower(substr($blob->path(), 0, 6))) { return false; } // If the blob sha already matches a post, then move on. if (!is_wp_error($this->app->database()->fetch_by_sha($blob->sha()))) { return false; } if (!$blob->has_frontmatter()) { return false; } return true; }