本文整理汇总了PHP中remove_editor_styles函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_editor_styles函数的具体用法?PHP remove_editor_styles怎么用?PHP remove_editor_styles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_editor_styles函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: twym_remove_editor_styles
function twym_remove_editor_styles()
{
$settings = get_option('twym_settings');
$theme_styles = isset($settings['theme_styles']) ? '1' : false;
if ('1' === $theme_styles) {
return;
}
remove_editor_styles();
}
示例2: html
/**
* Serves the app's base HTML, which in turns calls the load script.
*
* @since 4.2.0
* @access public
*
* @global WP_Locale $wp_locale
* @global string $wp_version
* @global bool $is_IE
*/
public function html()
{
global $wp_locale, $wp_version;
// Get data, new (POST) and old (GET).
$data = $this->merge_or_fetch_data();
$post_title = $this->get_suggested_title($data);
$post_content = $this->get_suggested_content($data);
// Get site settings array/data.
$site_settings = $this->site_settings();
// Pass the images and embeds
$images = $this->get_images($data);
$embeds = $this->get_embeds($data);
$site_data = array('v' => !empty($data['v']) ? $data['v'] : '', 'u' => !empty($data['u']) ? $data['u'] : '', 'hasData' => !empty($data));
if (!empty($images)) {
$site_data['_images'] = $images;
}
if (!empty($embeds)) {
$site_data['_embeds'] = $embeds;
}
// Add press-this-editor.css and remove theme's editor-style.css, if any.
remove_editor_styles();
add_filter('mce_css', array($this, 'add_editor_style'));
if (!empty($GLOBALS['is_IE'])) {
@header('X-UA-Compatible: IE=edge');
}
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
?>
<!DOCTYPE html>
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" <?php
language_attributes();
?>
> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" <?php
language_attributes();
?>
> <![endif]-->
<!--[if gt IE 8]><!--> <html <?php
language_attributes();
?>
> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="<?php
echo esc_attr(get_bloginfo('html_type'));
?>
; charset=<?php
echo esc_attr(get_option('blog_charset'));
?>
" />
<meta name="viewport" content="width=device-width">
<title><?php
esc_html_e('Press This!');
?>
</title>
<script>
window.wpPressThisData = <?php
echo wp_json_encode($site_data);
?>
;
window.wpPressThisConfig = <?php
echo wp_json_encode($site_settings);
?>
;
</script>
<script type="text/javascript">
var ajaxurl = '<?php
echo esc_js(admin_url('admin-ajax.php', 'relative'));
?>
',
pagenow = 'press-this',
typenow = 'post',
adminpage = 'press-this-php',
thousandsSeparator = '<?php
echo addslashes($wp_locale->number_format['thousands_sep']);
?>
',
decimalPoint = '<?php
echo addslashes($wp_locale->number_format['decimal_point']);
?>
',
isRtl = <?php
echo (int) is_rtl();
?>
;
</script>
<?php
/*
* $post->ID is needed for the embed shortcode so we can show oEmbed previews in the editor.
//.........这里部分代码省略.........
示例3: serve_app_html
/**
* Serves the app's base HTML, which in turns calls the load.js
*
* @since 4.2
*/
public function serve_app_html()
{
global $wp_locale;
// Get data, new (POST) and old (GET)
$data = $this->merge_or_fetch_data();
// Get site settings array/data
$site_settings = $this->site_settings();
// Set the passed data
$data['_version'] = $site_settings['version'];
$data['_runtime_url'] = $site_settings['runtime_url'];
$data['_ajax_url'] = $site_settings['ajax_url'];
// Plugin only
wp_register_script('press-this-app', plugin_dir_url(__FILE__) . 'js/app.js', array('jquery'), false, true);
wp_localize_script('press-this-app', 'pressThisL10n', $this->i18n());
wp_register_style('press-this-css', plugin_dir_url(__FILE__) . 'css/press-this.css');
// TEMP: for tags handling –– @TODO: evaluate
wp_register_script('tag-box', plugin_dir_url(__FILE__) . 'js/tag-box.js', array('suggest'), false, true);
// Add press-this-editor.css and remove theme's editor-style.css, if any.
remove_editor_styles();
add_filter('mce_css', array($this, 'editor_styles_override'));
$hook_suffix = 'press-this.php';
/**
* @TODO: this is a temp fix to an arcane issue while we're a plugin.
* See https://github.com/MichaelArestad/Press-This/issues/51
* Will become irrelevant when/if we merge into core.
*/
if (function_exists('set_current_screen')) {
set_current_screen($hook_suffix);
}
if (!empty($GLOBALS['is_IE'])) {
@header('X-UA-Compatible: IE=edge');
}
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
?>
<!DOCTYPE html>
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" <?php
language_attributes();
?>
> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" <?php
language_attributes();
?>
> <![endif]-->
<!--[if gt IE 8]><!--> <html <?php
language_attributes();
?>
> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="<?php
bloginfo('html_type');
?>
; charset=<?php
echo get_option('blog_charset');
?>
" />
<meta name="viewport" content="width=device-width">
<title><?php
echo esc_html(__('Press This!'));
?>
</title>
<script>
window.wpPressThisData = <?php
echo json_encode($data);
?>
;
window.wpPressThisConfig = <?php
echo json_encode($site_settings);
?>
;
</script>
<script type="text/javascript">
var ajaxurl = '<?php
echo admin_url('admin-ajax.php', 'relative');
?>
',
pagenow = 'press-this',
typenow = 'post',
adminpage = 'press-this-php',
thousandsSeparator = '<?php
echo addslashes($wp_locale->number_format['thousands_sep']);
?>
',
decimalPoint = '<?php
echo addslashes($wp_locale->number_format['decimal_point']);
?>
',
isRtl = <?php
echo (int) is_rtl();
?>
;
</script>
<?php
//.........这里部分代码省略.........
示例4: contact_support
function contact_support()
{
if (current_user_can('subscriber')) {
return false;
}
?>
<style>
.mainwp_info-box-yellow {
margin: 5px 0 15px;
padding: .6em;
background: #ffffe0;
border: 1px solid #e6db55;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
clear: both;
}
</style>
<?php
if (isset($_POST['submit'])) {
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], '_contactNonce')) {
return false;
}
$from_page = $_POST['mainwp_branding_send_from_page'];
$back_link = get_option('mainwp_branding_message_return_sender');
$back_link = !empty($back_link) ? $back_link : 'Go Back';
$back_link = !empty($from_page) ? '<a href="' . esc_url($from_page) . '" title="' . esc_attr($back_link) . '">' . esc_html($back_link) . '</a>' : '';
if ($this->send_support_mail()) {
$send_email_message = get_option('mainwp_branding_send_email_message');
if (!empty($send_email_message)) {
$send_email_message = stripslashes($send_email_message);
} else {
$send_email_message = 'Your Message was successfully submitted.';
}
} else {
$send_email_message = __('Error: send mail failed.');
}
?>
<div
class="mainwp_info-box-yellow"><?php
echo esc_html($send_email_message . '  ' . $back_link);
?>
</div><?php
} else {
$from_page = '';
if (isset($_GET['from_page'])) {
$from_page = urldecode($_GET['from_page']);
} else {
$protocol = isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'off') ? 'https://' : 'http://';
$fullurl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$from_page = urldecode($fullurl);
}
$support_message = get_option('mainwp_branding_support_message');
$support_message = nl2br(stripslashes($support_message));
?>
<form action="" method="post">
<div style="width: 99%;">
<h2><?php
echo esc_html($this->settings['contact_support_label']);
?>
</h2>
<div style="height: auto; margin-bottom: 10px; text-align: left">
<p><?php
echo wp_kses_post($support_message);
?>
</p>
<div style="max-width: 650px;">
<?php
remove_editor_styles();
// stop custom theme styling interfering with the editor
wp_editor('', 'mainwp_branding_contact_message_content', array('textarea_name' => 'mainwp_branding_contact_message_content', 'textarea_rows' => 10, 'teeny' => true, 'wpautop' => true, 'media_buttons' => false));
?>
</div>
</div>
<br/>
<?php
$button_title = get_option('mainwp_branding_submit_button_title');
$button_title = !empty($button_title) ? $button_title : __('Submit');
?>
<input id="mainwp-branding-contact-support-submit" type="submit" name="submit"
value="<?php
echo esc_attr($button_title);
?>
"
class="button-primary button" style="float: left"/>
</div>
<input type="hidden" name="mainwp_branding_send_from_page"
value="<?php
echo esc_url($from_page);
?>
"/>
<input type="hidden" name="_wpnonce" value="<?php
echo esc_attr(wp_create_nonce('_contactNonce'));
?>
"/>
</form>
<?php
}
//.........这里部分代码省略.........
示例5: mac_vis_editor
function mac_vis_editor()
{
global $options;
if (isset($options['enable_mac_editor']) && $options['enable_mac_editor'] != "") {
remove_editor_styles();
add_editor_style('editor-fontsafe-style.css');
}
}
示例6: render_description_editor
/**
* Add a description editor to the single snippet page
* @param Snippet $snippet The snippet being used for this page
*/
function render_description_editor(Snippet $snippet)
{
$settings = code_snippets_get_settings();
$settings = $settings['description_editor'];
$heading = __('Description', 'code-snippets');
/* Hack to remove space between heading and editor tabs */
if (!$settings['media_buttons'] && 'false' !== get_user_option('rich_editing')) {
$heading = "<div>{$heading}</div>";
}
echo '<label for="snippet_description"><h3>', $heading, '</h3></label>';
remove_editor_styles();
// stop custom theme styling interfering with the editor
wp_editor($snippet->desc, 'description', apply_filters('code_snippets/admin/description_editor_settings', array('textarea_name' => 'snippet_description', 'textarea_rows' => $settings['rows'], 'teeny' => !$settings['use_full_mce'], 'media_buttons' => $settings['media_buttons'])));
}
示例7: admin_head
function admin_head()
{
global $pagenow, $post;
if (!empty($post) && $post->post_type == SPOTS_POST_TYPE && $pagenow == 'post.php') {
remove_editor_styles();
add_editor_style(apply_filters('spots_editor_css', null));
}
?>
<style type="text/css">
#postdivrich .mce-i-addspotbutton,
#wpbody-content span.mce_addspotbutton,
#adminmenu #menu-posts-spot div.wp-menu-image,
#icon-edit.icon32-posts-spot {
background-image: url( <?php
echo esc_url(SPOTS_URL);
?>
/assets/icon.png );
background-repeat:no-repeat;
background-color:transparent;
background-position:0 0;
background-size: initial;
}
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and ( min--moz-device-pixel-ratio: 1.5),
only screen and ( -o-min-device-pixel-ratio: 3/2),
only screen and ( min-device-pixel-ratio: 1.5),
only screen and ( min-resolution: 1.5dppx) {
#postdivrich .mce-i-addspotbutton,
#wpbody-content span.mce_addspotbutton,
#adminmenu #menu-posts-spot div.wp-menu-image,
#icon-edit.icon32-posts-spot {
-webkit-background-size: 85px 56px;
-moz-background-size: 85px 56px;
background-size: 85px 56px;
}
}
#postdivrich .mce-i-addspotbutton:hover,
#wpbody-content span.mce_addspotbutton:hover { background-position: 0 -20px }
#adminmenu #menu-posts-spot div.wp-menu-image { background-position: -20px 0 }
#adminmenu #menu-posts-spot:hover div.wp-menu-image{ background-position: -20px -28px }
#icon-edit.icon32-posts-spot { background-position: -48px 0 }
.acInput {width: 200px;}
.acResults {padding: 0px;border: 1px solid WindowFrame;background-color: Window;overflow: hidden;}
.acResults ul {width: 100%;list-style-position: outside;list-style: none;padding: 0;margin: 0;}
.acResults li {margin: 0px;padding: 2px 5px;cursor: pointer;display: block;width: 100%;font: menu;font-size: 12px;overflow: hidden;}
.acLoading {background : url( 'indicator.gif' ) right center no-repeat;}
.acSelect {background-color: Highlight;color: HighlightText;}
</style>
<?php
}
示例8: description_editor_box
/**
* Add a description editor to the single snippet page
*
* @since 1.7
* @access private
* @param object $snippet The snippet being used for this page
* @return void
*/
function description_editor_box($snippet)
{
?>
<label for="snippet_description">
<h3><div><?php
_e('Description', 'code-snippets');
?>
</div></h3>
</label>
<?php
remove_editor_styles();
// stop custom theme styling interfering with the editor
wp_editor($snippet->description, 'description', apply_filters('code_snippets/admin/description_editor_settings', array('textarea_name' => 'snippet_description', 'textarea_rows' => 10, 'teeny' => true, 'media_buttons' => false)));
}
示例9: code_snippets_description_editor_box
/**
* Add a description editor to the single snippet page
*
* @since 1.7
* @access private
* @param object $snippet The snippet being used for this page
*/
function code_snippets_description_editor_box($snippet)
{
$settings = code_snippets_get_settings();
$settings = $settings['description_editor'];
$media_buttons = $settings['media_buttons'];
echo '<label for="snippet_description"><h3>';
$heading = __('Description', 'code-snippets');
echo $media_buttons ? $heading : "<div>{$heading}</div>";
echo '</h3></label>';
remove_editor_styles();
// stop custom theme styling interfering with the editor
wp_editor($snippet->description, 'description', apply_filters('code_snippets/admin/description_editor_settings', array('textarea_name' => 'snippet_description', 'textarea_rows' => $settings['rows'], 'teeny' => !$settings['use_full_mce'], 'media_buttons' => $media_buttons)));
}
示例10: add_theme_support
return $files;
}
/**
* Avoid Theme Support feature
* We are using Option
*/
add_theme_support('custom-header');
remove_theme_support('custom-header');
add_theme_support('custom-background');
remove_theme_support('custom-background');
add_editor_style();
remove_editor_styles();
if (!isset($content_width)) {
$content_width = 474;
}
add_action("init", "charity_rewrite_rules");
function charity_rewrite_rules() {
flush_rewrite_rules();
}
/*
* Woocommerce Theme Support
*/
add_action('after_setup_theme', 'charity_woocommerce_support');
示例11: admin_init
function admin_init()
{
$this->add_caps();
$this->maybe_upgrade();
if (!empty($_GET['_wp_http_referer']) && (isset($_GET['page']) && in_array(SPNL()->validate->page($_GET['page']), $this->adminpages))) {
//safe redirect with esc_url 4/20
wp_safe_redirect(esc_url_raw(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))));
exit;
}
if (isset($_REQUEST['post_id'])) {
$p = get_post($_REQUEST['post_id']);
if ($p !== null && $p->post_type == 'sp_newsletters') {
add_filter('disable_captions', create_function('$a', 'return true;'));
}
}
//Removed in 0.9.2
//$this->create_initial_list();
/*
if( SendPress_Option::get('emails-today') == false ){
$emails_today = array( date("z") => '0' );
SendPress_Option::set('emails-today', $emails_today);
}
$emails_today = SendPress_Option::get('emails-today');
$emails_today[date("z") + 1 ] = '0';
SendPress_Option::set('emails-today', $emails_today);
*/
//SendPress_Option::set('emails-today', '');
//SendPress_Option::set('allow_tracking', '');
//wp_clear_scheduled_hook( 'sendpress_cron_action' );
// Schedule an action if it's not already scheduled
/*
if ( ! wp_next_scheduled( 'sendpress_cron_action' ) ) {
wp_schedule_event( time(), 'tenminutes', 'sendpress_cron_action' );
}
*/
//wp_clear_scheduled_hook( 'sendpress_cron_action' );
/*
add_meta_box( 'email-status', __( 'Email Status', 'sendpress' ), array( $this, 'email_meta_box' ), $this->_email_post_type, 'side', 'low' );
*/
//MAKE SURE WE ARE ON AN ADMIN PAGE
if (isset($_GET['page']) && in_array($_GET['page'], $this->adminpages)) {
remove_action('admin_init', 'Zotpress_add_meta_box', 1);
remove_filter('mce_external_plugins', 'cforms_plugin');
remove_filter('mce_buttons', 'cforms_button');
remove_filter("mce_plugins", "cforms_plugin");
remove_filter('mce_buttons', 'cforms_button');
remove_filter('tinymce_before_init', 'cforms_button_script');
global $wp_filter;
$wp_filter['admin_notices'] = array();
if (SPNL()->validate->page($_GET['page']) == 'sp-templates' || isset($_GET['view']) && $_GET['view'] == 'style-email') {
wp_register_script('sendpress_js_styler', SENDPRESS_URL . 'js/styler.js', '', SENDPRESS_VERSION);
}
if (defined('WPE_PLUGIN_BASE')) {
add_action('admin_print_styles', array($this, 'remove_wpengine_style'));
}
$this->_page = SPNL()->validate->page($_GET['page']);
add_filter('tiny_mce_before_init', array($this, 'myformatTinyMCE'));
if (isset($_GET['beta'])) {
SendPress_Option::set('beta', absint($_GET['beta']));
}
remove_editor_styles();
add_filter('mce_css', array($this, 'plugin_mce_css'));
//Stop Facebook Plugin from posting emails to Facebook.
remove_action('transition_post_status', 'fb_publish_later', 10, 3);
$tiny = new SendPress_TinyMCE();
$this->_current_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : '';
$view_class = $this->get_view_class($this->_page, $this->_current_view);
$view_class = new $view_class();
$view_class->admin_init();
add_action('sendpress_admin_scripts', array($view_class, 'admin_scripts_load'));
$view_class = $this->get_view_class($this->_page, $this->_current_view);
$this->_current_action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : '';
$this->_current_action = isset($_GET['action2']) ? sanitize_text_field($_GET['action2']) : $this->_current_action;
$this->_current_action = isset($_POST['action2']) ? sanitize_text_field($_POST['action2']) : $this->_current_action;
$this->_current_action = isset($_POST['action']) && sanitize_text_field($_POST['action']) !== '-1' ? sanitize_text_field($_POST['action']) : $this->_current_action;
$method = str_replace("-", "_", $this->_current_action);
$method = str_replace(" ", "_", $method);
if (!empty($_POST) && (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], $this->_nonce_value))) {
if (method_exists($view_class, $method)) {
$save_class = new $view_class();
$save_class->{$method}();
//print_r($save_class);
} elseif (method_exists($view_class, 'save')) {
//$view_class::save($this);
$save_class = new $view_class();
$save_class->save($_POST, $this);
} else {
require_once SENDPRESS_PATH . 'inc/helpers/sendpress-post-actions.php';
}
} else {
if (isset($_GET['action']) || isset($_GET['action2'])) {
$this->_current_action = sanitize_text_field($_GET['action']);
$this->_current_action = isset($_GET['action2']) && sanitize_text_field($_GET['action2']) !== '-1' ? sanitize_text_field($_GET['action2']) : $this->_current_action;
$method = str_replace("-", "_", $this->_current_action);
$method = str_replace(" ", "_", $method);
if (method_exists($view_class, $method)) {
$save_class = new $view_class();
call_user_func(array($view_class, $method), $_GET, $this);
//.........这里部分代码省略.........
示例12: enqueue_scripts
public function enqueue_scripts()
{
if (!$this->is_editor_screen()) {
return;
}
// Glyphicons
if (!wp_style_is('glyphicons')) {
wp_enqueue_style('glyphicons', plugins_url('css/glyphicons/css/glyphicons.css', MMTL_FILE), null, '1.9.2');
}
// Font Awesome
if (!wp_style_is('font-awesome')) {
wp_enqueue_style('font-awesome', plugins_url('css/font-awesome/css/font-awesome.min.css', MMTL_FILE), null, '4.5.0');
}
// Featherlight
if (!wp_script_is('featherlight')) {
wp_enqueue_script('featherlight', plugins_url('js/featherlight/featherlight.min.js', MMTL_FILE), array('jquery'), '1.3.4', true);
}
// jQuery UI
if (!wp_style_is('jquery-ui-structure')) {
wp_enqueue_style('jquery-ui-structure', plugins_url('css/jquery-ui.structure.min.css', MMTL_FILE), null, '1.11.4');
}
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-tabs');
// Table Layout
wp_enqueue_style('table-layout');
wp_enqueue_style('table-layout-editor', plugins_url('css/editor.min.css', MMTL_FILE));
wp_enqueue_style('table-layout-editor-style', plugins_url('css/editor-style.min.css', MMTL_FILE));
wp_enqueue_script('table-layout-editor', plugins_url('js/editor/main.js', MMTL_FILE), null, false, true);
wp_enqueue_script('table-layout-editor-common', plugins_url('js/editor/common.js', MMTL_FILE), null, false, true);
wp_enqueue_script('table-layout-admin', plugins_url('js/admin.js', MMTL_FILE), null, false, true);
$options = apply_filters('mmtl_options', array('post_id' => $this->get_post_id(), 'post_editor_id' => MMTL_POST_EDITOR_ID, 'ajaxurl' => admin_url('admin-ajax.php'), 'noncename' => MMTL_NONCE_NAME, 'nonce' => wp_create_nonce('MMTL_Editor'), 'confirm_delete' => __('Are you sure you want to delete this component?', 'table-layout'), 'control_label_add' => __('Add', 'table-layout'), 'control_label_edit' => __('Edit', 'table-layout'), 'control_label_copy' => __('Copy', 'table-layout'), 'control_label_delete' => __('Delete', 'table-layout'), 'control_label_toggle' => __('Toggle', 'table-layout'), 'meta_title_id' => __('ID', 'table-layout'), 'meta_title_class' => __('Class', 'table-layout'), 'meta_title_bg_image' => __('Background image', 'table-layout'), 'meta_title_push' => __('Push', 'table-layout'), 'meta_title_pull' => __('Pull', 'table-layout')));
wp_localize_script('table-layout-admin', 'MMTL_Options', $options);
remove_editor_styles();
}