本文整理匯總了PHP中SwpmUtils::do_misc_initial_plugin_setup_tasks方法的典型用法代碼示例。如果您正苦於以下問題:PHP SwpmUtils::do_misc_initial_plugin_setup_tasks方法的具體用法?PHP SwpmUtils::do_misc_initial_plugin_setup_tasks怎麽用?PHP SwpmUtils::do_misc_initial_plugin_setup_tasks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SwpmUtils
的用法示例。
在下文中一共展示了SwpmUtils::do_misc_initial_plugin_setup_tasks方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: define
include_once 'classes/class.simple-wp-membership.php';
include_once 'classes/class.swpm-cronjob.php';
include_once 'swpm-compat.php';
define('SIMPLE_WP_MEMBERSHIP_VER', '3.3.6');
define('SIMPLE_WP_MEMBERSHIP_DB_VER', '1.2');
define('SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL', home_url());
define('SIMPLE_WP_MEMBERSHIP_PATH', dirname(__FILE__) . '/');
define('SIMPLE_WP_MEMBERSHIP_URL', plugins_url('', __FILE__));
define('SIMPLE_WP_MEMBERSHIP_DIRNAME', dirname(plugin_basename(__FILE__)));
define('SIMPLE_WP_MEMBERSHIP_TEMPLATE_PATH', 'simple-membership');
if (!defined('COOKIEHASH')) {
define('COOKIEHASH', md5(get_site_option('siteurl')));
}
define('SIMPLE_WP_MEMBERSHIP_AUTH', 'simple_wp_membership_' . COOKIEHASH);
define('SIMPLE_WP_MEMBERSHIP_SEC_AUTH', 'simple_wp_membership_sec_' . COOKIEHASH);
SwpmUtils::do_misc_initial_plugin_setup_tasks();
register_activation_hook(SIMPLE_WP_MEMBERSHIP_PATH . 'simple-wp-membership.php', 'SimpleWpMembership::activate');
register_deactivation_hook(SIMPLE_WP_MEMBERSHIP_PATH . 'simple-wp-membership.php', 'SimpleWpMembership::deactivate');
add_action('swpm_login', 'SimpleWpMembership::swpm_login', 10, 3);
$simple_membership = new SimpleWpMembership();
$simple_membership_cron = new SwpmCronJob();
//Add settings link in plugins listing page
function swpm_add_settings_link($links, $file)
{
if ($file == plugin_basename(__FILE__)) {
$settings_link = '<a href="admin.php?page=simple_wp_membership_settings">Settings</a>';
array_unshift($links, $settings_link);
}
return $links;
}
add_filter('plugin_action_links', 'swpm_add_settings_link', 10, 2);