本文整理汇总了PHP中Shopp::upgradedb方法的典型用法代码示例。如果您正苦于以下问题:PHP Shopp::upgradedb方法的具体用法?PHP Shopp::upgradedb怎么用?PHP Shopp::upgradedb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shopp
的用法示例。
在下文中一共展示了Shopp::upgradedb方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: maintenance
/**
* Adds a maintenance mode notice to every admin screen
*
* @since 1.3
*
* @return void
**/
public function maintenance()
{
if (ShoppLoader::is_activating() || Shopp::upgradedb()) {
return;
}
$setting = isset($_POST['settings']['maintenance']) ? $_POST['settings']['maintenance'] : false;
$nonce = isset($_POST['_wpnonce']) ? $_POST['_wpnonce'] : false;
if (false !== $setting && wp_verify_nonce($nonce, 'shopp-setup')) {
shopp_set_setting('maintenance', $setting);
}
if (!Shopp::maintenance()) {
return;
}
if (wp_verify_nonce($this->request('_wpnonce'), 'shopp_disable_maintenance')) {
shopp_set_setting('maintenance', 'off');
} else {
$url = wp_nonce_url(add_query_arg('page', ShoppAdmin::pagename('settings'), admin_url('admin.php')), 'shopp_disable_maintenance');
$this->Screen->notice(Shopp::__('Shopp is currently in maintenance mode. %sDisable Maintenance Mode%s', '<a href="' . $url . '" class="button">', '</a>'), 'error', 1);
}
}
示例2: submenus
/**
* Adds a ShoppAdminPage entry to the WordPress menus under the Shopp menus
*
* @author Jonathan Davis
* @since 1.1
*
* @param ShoppAdminPage $Page A ShoppAdminPage object
* @return void
**/
private function submenus(ShoppAdminPage $Page)
{
$name = $Page->name;
$pagehook = $Page->page;
// Set capability
$capability = isset($this->caps[$name]) ? $this->caps[$name] : 'none';
$taxonomies = get_object_taxonomies(ShoppProduct::$posttype, 'names');
if (in_array("shopp_{$name}", $taxonomies)) {
$capability = 'shopp_categories';
}
// Set controller (callback handler)
$controller = array(ShoppAdmin(), 'route');
if (Shopp::upgradedb()) {
$controller = array('ShoppAdmin', 'updatedb');
}
$menu = $Page->parent ? $Page->parent : $this->mainmenu;
shopp_admin_add_submenu($Page->label, $pagehook, $menu, $controller, $capability);
}
示例3: maintenance
/**
* Handles maintenance mode messages
**/
private function maintenance()
{
if (ShoppLoader::is_activating() || Shopp::upgradedb()) {
return;
}
if (isset($_POST['settings']) && wp_verify_nonce($_REQUEST['_wpnonce'], 'shopp-setup')) {
if (isset($_POST['settings']['maintenance'])) {
shopp_set_setting('maintenance', $_POST['settings']['maintenance']);
}
}
if (Shopp::maintenance()) {
if (isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'shopp_disable_maintenance')) {
shopp_set_setting('maintenance', 'off');
} else {
$url = wp_nonce_url(add_query_arg('page', $this->Admin->pagename('setup'), admin_url('admin.php')), 'shopp_disable_maintenance');
$this->notice(Shopp::__('Shopp is currently in maintenance mode. %sDisable Maintenance Mode%s', '<a href="' . $url . '" class="button">', '</a>'), 'error', 1);
}
}
}