本文整理汇总了PHP中bstw函数的典型用法代码示例。如果您正苦于以下问题:PHP bstw函数的具体用法?PHP bstw怎么用?PHP bstw使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bstw函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: siteorigin_panels_black_studio_tinymce_admin_init
/**
* Add all the required actions for the TinyMCE widget.
*/
function siteorigin_panels_black_studio_tinymce_admin_init()
{
global $pagenow;
if (in_array($pagenow, array('post-new.php', 'post.php')) || $pagenow == 'themes.php' && isset($_GET['page']) && $_GET['page'] == 'so_panels_home_page') {
if (function_exists('bstw')) {
add_filter('tiny_mce_before_init', array(bstw(), 'tiny_mce_before_init'), 20);
add_action('admin_head', array(bstw(), 'enqueue_media'));
add_action('admin_print_scripts', array(bstw(), 'admin_print_scripts'));
add_action('admin_print_styles', array(bstw(), 'admin_print_styles'));
add_action('admin_print_footer_scripts', array(bstw(), 'admin_print_footer_scripts'));
} else {
add_filter('tiny_mce_before_init', 'black_studio_tinymce_init_editor', 20);
add_action('admin_head', 'black_studio_tinymce_load_tiny_mce');
add_action('admin_print_scripts', 'black_studio_tinymce_scripts');
add_action('admin_print_styles', 'black_studio_tinymce_styles');
add_action('admin_print_footer_scripts', 'black_studio_tinymce_footer_scripts');
}
}
}
示例2: bstw
// END class Black_Studio_TinyMCE_Plugin
}
// END class_exists check
if (!function_exists('bstw')) {
/**
* Return the main instance to prevent the need to use globals
*
* @return object
* @since 2.0.0
*/
function bstw()
{
return Black_Studio_TinyMCE_Plugin::instance();
}
/* Create the main instance */
bstw();
} else {
/* Check for multiple plugin instances */
if (!function_exists('bstw_multiple_notice')) {
/**
* Show admin notice when multiple instances of the plugin are detected
*
* @return void
* @since 2.1.0
*/
function bstw_multiple_notice()
{
global $pagenow;
if ('widgets.php' == $pagenow) {
echo '<div class="error">';
/* translators: error message shown when multiple instance of the plugin are detected */
示例3: siteorigin_panels_admin_init
/**
* Initialize compatibility for Page Builder (SiteOrigin Panels)
*
* @uses add_filter()
* @uses add_action()
* @uses remove_filter()
* @uses add_action()
* @uses is_plugin_active()
*
* @return void
* @since 2.0.0
*/
public function siteorigin_panels_admin_init()
{
if (is_admin() && is_plugin_active('siteorigin-panels/siteorigin-panels.php')) {
add_filter('siteorigin_panels_widget_object', array($this, 'siteorigin_panels_widget_object'), 10);
add_filter('black_studio_tinymce_container_selectors', array($this, 'siteorigin_panels_container_selectors'));
add_filter('black_studio_tinymce_activate_events', array($this, 'siteorigin_panels_activate_events'));
add_filter('black_studio_tinymce_deactivate_events', array($this, 'siteorigin_panels_deactivate_events'));
add_filter('black_studio_tinymce_enable_pages', array($this, 'siteorigin_panels_enable_pages'));
remove_filter('widget_text', array(bstw()->text_filters(), 'wpautop'), 8);
}
}
示例4: black_studio_tinymce_siteorigin_panels_widget_object
/**
* @since 1.4.5
* @deprecated 2.0.0
*/
function black_studio_tinymce_siteorigin_panels_widget_object($the_widget)
{
_deprecated_function(__FUNCTION__, '2.0.0', 'bstw()-compatibility()->plugins()->siteorigin_panels_widget_object( ... )');
bstw()->compatibility()->plugins()->siteorigin_panels_widget_object($the_widget);
}
示例5: wp_pre_39
/**
* Compatibility for WordPress prior to 3.9
*
* @uses add_action()
* @uses remove_action()
* @uses add_filter()
* @uses get_bloginfo()
* @uses Black_Studio_TinyMCE_Admin::enabled()
*
* @return void
* @since 2.0.0
*/
public function wp_pre_39()
{
$wp_version = get_bloginfo('version');
if (bstw()->admin()->enabled()) {
add_filter('black-studio-tinymce-widget-script', array($this, 'wp_pre_39_handle'), 61);
add_filter('tiny_mce_before_init', array($this, 'wp_pre_39_tiny_mce_before_init'), 61);
add_action('admin_print_footer_scripts', array($this, 'wp_pre_39_admin_print_footer_scripts'));
remove_action('admin_print_footer_scripts', array(bstw()->admin(), 'admin_print_footer_scripts'));
if (!version_compare($wp_version, '3.2', '<')) {
remove_action('admin_print_footer_scripts', array($this, 'wp_pre_32_admin_print_footer_scripts'));
}
if (!version_compare($wp_version, '3.3', '<')) {
remove_action('admin_print_footer_scripts', array($this, 'wp_pre_33_admin_print_footer_scripts'));
}
add_action('black_studio_tinymce_editor', array($this, 'wp_pre_39_editor'), 10, 4);
remove_action('black_studio_tinymce_editor', array(bstw()->admin(), 'editor'), 10, 3);
}
}
示例6: enqueue
/**
* Helper function to enqueue script
*
* @uses wp_enqueue_style()
* @uses wp_enqueue_script()
* @uses plugins_url()
* @uses wp_localize_script()
* @uses SCRIPT_DEBUG
*
* @param mixed[] $pointers
* @return void
* @since 2.1.0
*/
public function enqueue($pointers)
{
$script = 'black-studio-tinymce-widget-pointer';
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style('wp-pointer');
wp_enqueue_script($script, plugins_url('js/' . $script . $suffix . '.js', dirname(__FILE__)), array('wp-pointer'), bstw()->get_version(), true);
wp_localize_script('black-studio-tinymce-widget-pointer', 'bstw_pointers', $pointers);
}
示例7: plugin_row_meta
/**
* Show row meta on the plugin screen
*
* @uses esc_html()
* @uses esc_url()
*
* @param string[] $links
* @param string $file
* @return string[]
* @since 2.0.0
*/
public function plugin_row_meta($links, $file)
{
if ($file == bstw()->get_basename()) {
foreach ($this->links as $url => $label) {
$links[$label] = '<a href="' . esc_url($url) . '" target="_blank">' . esc_html($label) . '</a>';
}
}
return $links;
}
示例8: siteorigin_panels_admin_init
/**
* Initialize compatibility for Page Builder ( SiteOrigin Panels )
*
* @uses add_filter()
* @uses add_action()
* @uses remove_filter()
* @uses add_action()
* @uses is_plugin_active()
*
* @return void
* @since 2.0.0
*/
public function siteorigin_panels_admin_init()
{
// if ( is_admin() &&
// ( is_plugin_active( 'siteorigin-panels/siteorigin-panels.php' ) ||
// is_plugin_active( 'page-builder-for-canvas-master/page-builder-for-canvas.php' ) )
// This VE2 is bundled in Page Builder, so don't need to check for Page Builder
if (is_admin()) {
add_filter('siteorigin_panels_widget_object', array($this, 'siteorigin_panels_widget_object'), 10);
add_filter('black_studio_tinymce_container_selectors', array($this, 'siteorigin_panels_container_selectors'));
add_filter('black_studio_tinymce_activate_events', array($this, 'siteorigin_panels_activate_events'));
add_filter('black_studio_tinymce_deactivate_events', array($this, 'siteorigin_panels_deactivate_events'));
add_filter('black_studio_tinymce_enable_pages', array($this, 'siteorigin_panels_enable_pages'));
remove_filter('widget_text', array(bstw()->text_filters(), 'wpautop'), 8);
}
}
示例9: do_shortcode
/**
* Process shortcodes in widget text
*
* @uses do_shortcode()
*
* @param string $text
* @return string
* @since 2.0.0
*/
public function do_shortcode($text, $instance = null, $widget = null)
{
if (bstw()->check_widget($widget) && !empty($instance)) {
$text = do_shortcode($text);
}
return $text;
}
示例10: kt_remove_bstw_do_shortcode
function kt_remove_bstw_do_shortcode()
{
if (function_exists('bstw')) {
remove_filter('widget_text', array(bstw()->text_filters(), 'do_shortcode'), 10);
}
}