本文整理汇总了PHP中Jetpack::get_module_slug方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::get_module_slug方法的具体用法?PHP Jetpack::get_module_slug怎么用?PHP Jetpack::get_module_slug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jetpack
的用法示例。
在下文中一共展示了Jetpack::get_module_slug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: options
function options($file, $option)
{
$options = func_get_args();
$file = array_shift($options);
$module_slug = Jetpack::get_module_slug($file);
if (!isset($this->sync_options[$module_slug])) {
$this->sync_options[$module_slug] = array();
}
foreach ($options as $option) {
$this->sync_options[$module_slug][] = $option;
add_action("delete_option_{$option}", array($this, 'deleted_option_action'));
add_action("update_option_{$option}", array($this, 'updated_option_action'));
add_action("add_option_{$option}", array($this, 'added_option_action'));
}
$this->sync_options[$module_slug] = array_unique($this->sync_options[$module_slug]);
}
示例2: module_configuration_screen
public static function module_configuration_screen($module, $method)
{
$module = Jetpack::get_module_slug($module);
add_action('jetpack_module_configuration_screen_' . $module, $method);
}
示例3: features_enabled
/**
* Returns what features are enabled. Uses the slug of the modules files.
*
* @return array|IXR_Error
*/
function features_enabled()
{
$raw_modules = Jetpack::get_active_modules();
$modules = array();
foreach ($raw_modules as $module) {
$modules[] = Jetpack::get_module_slug($module);
}
return $modules;
}
示例4: module_configuration_activation_screen
public static function module_configuration_activation_screen($module, $method)
{
$module = Jetpack::get_module_slug($module);
add_action('display_activate_module_setting_' . $module, $method);
}
示例5: constant
/**
* Simular to $this->options() function.
* Add the constant to be synced to .com when we activate the module.
* As well as on heartbeat and plugin upgrade and connection to .com.
*
* @param string $file
* @param string $constant
*/
function constant($file, $constant)
{
$constants = func_get_args();
$file = array_shift($constants);
$module_slug = Jetpack::get_module_slug($file);
if (!isset($this->sync_constants[$module_slug])) {
$this->sync_constants[$module_slug] = array();
}
foreach ($constants as $constant) {
$this->sync_constants[$module_slug][] = $constant;
}
}