本文整理汇总了PHP中GoogleSitemapGenerator::SendPingAll方法的典型用法代码示例。如果您正苦于以下问题:PHP GoogleSitemapGenerator::SendPingAll方法的具体用法?PHP GoogleSitemapGenerator::SendPingAll怎么用?PHP GoogleSitemapGenerator::SendPingAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoogleSitemapGenerator
的用法示例。
在下文中一共展示了GoogleSitemapGenerator::SendPingAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HtmlShowOptionsPage
//.........这里部分代码省略.........
if (!current_user_can("administrator")) {
echo '<p>Please log in as admin</p>';
return;
}
echo <<<HTML
<html>
\t<head>
\t\t<style type="text/css">
\t\thtml {
\t\t\tbackground: #f1f1f1;
\t\t}
\t\tbody {
\t\t\tcolor: #444;
\t\t\tfont-family: "Open Sans", sans-serif;
\t\t\tfont-size: 13px;
\t\t\tline-height: 1.4em;
\t\t\tmin-width: 600px;
\t\t}
\t\th2 {
\t\t\tfont-size: 23px;
\t\t\tfont-weight: 400;
\t\t\tpadding: 9px 10px 4px 0;
\t\t\tline-height: 29px;
\t\t}
\t\t</style>
\t</head>
\t<body>
HTML;
echo "<h2>" . __('Notify Search Engines about all sitemaps', 'sitemap') . "</h2>";
echo "<p>" . __('The plugin is notifying the selected search engines about your main sitemap and all sub-sitemaps. This might take a minute or two.', 'sitemaps') . "</p>";
flush();
$results = $this->sg->SendPingAll();
echo "<ul>";
foreach ($results as $result) {
$sitemapUrl = $result["sitemap"];
/** @var $status GoogleSitemapGeneratorStatus */
$status = $result["status"];
echo "<li><a href=\"" . esc_url($sitemapUrl) . "\">" . $sitemapUrl . "</a><ul>";
$services = $status->GetUsedPingServices();
foreach ($services as $serviceId) {
echo "<li>";
echo $status->GetServiceName($serviceId) . ": " . ($status->GetPingResult($serviceId) == true ? "OK" : "ERROR");
echo "</li>";
}
echo "</ul></li>";
}
echo "</ul>";
echo "<p>" . __('All done!', 'sitemap') . "</p>";
echo <<<HTML
\t</body>
HTML;
exit;
} else {
if (!empty($_GET["sm_ping_main"])) {
check_admin_referer('sitemap');
//Check again, just for the case that something went wrong before
if (!current_user_can("administrator")) {
echo '<p>Please log in as admin</p>';
return;
}
$this->sg->SendPing();
$message = __("Ping was executed, please see below for the result.", "sitemap");
}