subtype = "sitemeta"; // Set its owner to the current user $seo->owner_guid = $_SESSION['user']->getGUID(); // Set its access to public $seo->access_id = 2; // Set its title and description appropriately $seo->title = $metatags; $seo->description = $description; // Before we can set metadata, save if (!$seo->save()) { register_error(elgg_echo("sitepages:error")); forward("pg/sitepages/index.php?type=seo"); } // Success message system_message(elgg_echo("sitepages:seocreated")); // Remove the cache unset($_SESSION['description']); unset($_SESSION['metatags']); // Forward back to the page forward("pg/sitepages/index.php?type=seo");