本文整理汇总了PHP中_WP_Editors::parse_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP _WP_Editors::parse_settings方法的具体用法?PHP _WP_Editors::parse_settings怎么用?PHP _WP_Editors::parse_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_WP_Editors
的用法示例。
在下文中一共展示了_WP_Editors::parse_settings方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: js_wp_editor
function js_wp_editor($settings = array())
{
if (!class_exists('_WP_Editors')) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
$set = _WP_Editors::parse_settings('apid', $settings);
if (!current_user_can('upload_files')) {
$set['media_buttons'] = false;
}
if ($set['media_buttons']) {
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
$post = get_post();
if (!$post && !empty($GLOBALS['post_ID'])) {
$post = $GLOBALS['post_ID'];
}
wp_enqueue_media(array('post' => $post));
}
_WP_Editors::editor_settings('apid', $set);
$ap_vars = array('url' => get_home_url(), 'includes_url' => includes_url());
wp_register_script('ap_wpeditor_init', get_template_directory_uri() . '/functions/js-wp-editor.js', array('jquery'), '1.1', true);
wp_localize_script('ap_wpeditor_init', 'ap_vars', $ap_vars);
wp_enqueue_script('ap_wpeditor_init');
}
示例2: get_set
public function get_set()
{
$set = _WP_Editors::parse_settings($this->editor_id, $this->get_settings());
if (!current_user_can('upload_files')) {
$set['media_buttons'] = false;
}
return $set;
}
示例3: __loadTinyMce
protected function __loadTinyMce()
{
if (!class_exists('_WP_Editors', false)) {
require_once ABSPATH . WPINC . '/class-wp-editor.php';
}
/*
* _WP_Editors shouldn't be used directly, but in this case
* it's the best way to load WordPress RTE stuff and handle
* RTE editors in Javascript
*/
$set = \_WP_Editors::parse_settings(null, array('tinymce' => true, 'quicktags' => false));
\_WP_Editors::editor_settings('woodlets_tiny_mce', $set);
}
示例4: js_wp_editor
function js_wp_editor($settings = array())
{
if (!class_exists('_WP_Editors')) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
$set = _WP_Editors::parse_settings('apid', $settings);
if (!current_user_can('upload_files')) {
$set['media_buttons'] = false;
}
if ($set['media_buttons']) {
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
$post = get_post();
if (!$post && !empty($GLOBALS['post_ID'])) {
$post = $GLOBALS['post_ID'];
}
wp_enqueue_media(array('post' => $post));
}
_WP_Editors::editor_settings('apid', $set);
}
示例5: js_wp_editor
function js_wp_editor($settings = array())
{
if (!class_exists('_WP_Editors')) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
$set = _WP_Editors::parse_settings('apid', $settings);
// if ( !current_user_can( 'upload_files' ) )
// $set['media_buttons'] = false;
// if ( $set['media_buttons'] ) {
// wp_enqueue_script( 'thickbox' );
// wp_enqueue_style( 'thickbox' );
// wp_enqueue_script('media-upload');
// $post = get_post();
// if ( ! $post && ! empty( $GLOBALS['post_ID'] ) )
// $post = $GLOBALS['post_ID'];
// wp_enqueue_media( array(
// 'post' => $post
// ) );
// }
_WP_Editors::editor_settings('apid', $set);
$ap_vars = array('url' => get_home_url(), 'includes_url' => includes_url(), 'upload_files' => current_user_can('upload_files'));
wp_localize_script('jquery', 'ap_vars', $ap_vars);
}
示例6: wp_tiny_mce
/**
* @since 2.7.0
* @deprecated 3.3.0
* @deprecated Use wp_editor()
* @see wp_editor()
*/
function wp_tiny_mce($teeny = false, $settings = false)
{
_deprecated_function(__FUNCTION__, '3.3', 'wp_editor()');
static $num = 1;
if (!class_exists('_WP_Editors')) {
require_once ABSPATH . WPINC . '/class-wp-editor.php';
}
$editor_id = 'content' . $num++;
$set = array('teeny' => $teeny, 'tinymce' => $settings ? $settings : true, 'quicktags' => false);
$set = _WP_Editors::parse_settings($editor_id, $set);
_WP_Editors::editor_settings($editor_id, $set);
}
示例7: enqueue_wp_editor_scripts
public function enqueue_wp_editor_scripts()
{
$screen = get_current_screen();
$allowed_screens = $this->allowed_post_types;
if (in_array($screen->id, $allowed_screens)) {
if (!class_exists('_WP_Editors')) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
$set = _WP_Editors::parse_settings('fusionb_id', array());
if (!current_user_can('upload_files')) {
$set['media_buttons'] = false;
}
if ($set['media_buttons']) {
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
$post = get_post();
if (!$post && !empty($GLOBALS['post_ID'])) {
$post = $GLOBALS['post_ID'];
}
wp_enqueue_media(array('post' => $post));
}
_WP_Editors::editor_settings('fusionb_id', $set);
}
}
示例8: loadTinyMceSettings
function loadTinyMceSettings() {
if ( ! class_exists( '_WP_Editors' ) )
require( ABSPATH . WPINC . '/class-wp-editor.php' );
$set = _WP_Editors::parse_settings( self::$content_editor_id, self::$content_editor_settings );
_WP_Editors::editor_settings( self::$content_editor_id, $set );
}
示例9: js_wp_editor
function js_wp_editor($settings = array())
{
if (!class_exists('_WP_Editors')) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
$set = _WP_Editors::parse_settings('apid', $settings);
_WP_Editors::editor_settings('apid', $set);
}
示例10: _action_print_wp_editor
/**
* @internal
**/
public function _action_print_wp_editor()
{
if (!class_exists('_WP_Editors')) {
require ABSPATH . WPINC . '/class-wp-editor.php';
$id = 'fw-wp-editor-option-type';
$set = _WP_Editors::parse_settings($id, array('teeny' => true, 'media_buttons' => true, 'tinymce' => true, 'editor_css' => true, 'quicktags' => true));
_WP_Editors::editor_settings($id, $set);
_WP_Editors::enqueue_scripts();
_WP_Editors::editor_js();
}
}
示例11: add_editor_settings
/**
* Setup an extra TinyMCE setting for use in AJAX editors
*/
public function add_editor_settings()
{
$ajax_settings = _WP_Editors::parse_settings($this->get_the_ID(), $this->get_tinymce_settings());
_WP_Editors::editor_settings($this->get_the_ID(), $ajax_settings);
}
示例12: js
/**
* Add JS to header edit/Add new post
*/
function js()
{
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-core');
// http://code.jquery.com/ui/1.10.3/jquery-ui.js
// wp_enqueue_script('jquery-ui', 'http://code.jquery.com/ui/1.10.3/jquery-ui.js', array('jquery'));
if (function_exists('wp_enqueue_media')) {
wp_enqueue_media();
}
wp_enqueue_script('jquery-ui-dialog');
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('jquery-ui-droppable');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-position');
wp_enqueue_script('iris');
wp_enqueue_script('wp-color-picker');
wp_enqueue_script('quicktag');
wp_enqueue_script('jquery.poshytip.js', $this->settings['url'] . 'assets/js/jquery.poshytip.js', array('jquery'));
wp_enqueue_script('st-cookies', $this->settings['url'] . 'assets/js/cookies.js', array('jquery'));
wp_enqueue_script('st-tabs-builder', $this->settings['url'] . 'assets/js/tabs-builder.js', array('jquery'));
wp_enqueue_script('st-table-builder', $this->settings['url'] . 'assets/js/table-builder.js', array('jquery'));
wp_enqueue_script('st-input-items', $this->settings['url'] . 'assets/js/input-items.js', array('jquery'));
wp_enqueue_script('st-pagebuilder', $this->settings['url'] . 'assets/js/pagebuilder.js', array('jquery'));
$l10n = array();
$l10n[$this->nonceName] = $this->nonceValue;
$l10n['input_name'] = ST_Page_Builder::BUILDER_SETTINGS_NAME;
$l10n['item_sizes'] = $this->item_sizes;
$l10n['config']['confirm_remove_row'] = __('Are you sure want to remove this row ?', 'smooththemes');
$l10n['config']['confirm_remove_col'] = __('Are you sure want to remove this column ?', 'smooththemes');
$l10n['config']['row_settings_title'] = __('Section settings', 'smooththemes');
$l10n['config']['col_settings_title'] = __('Layout settings', 'smooththemes');
$l10n['config']['loading'] = __('Loading...', 'smooththemes');
$l10n['config']['tinymce_base'] = get_bloginfo('home') . '/wp-includes/js/tinymce';
if (function_exists('st_get_font_icons')) {
$l10n['font_icons'] = st_get_font_icons();
}
wp_localize_script('jquery-core', 'STBP', $l10n);
if (!class_exists('_WP_Editors')) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
$set = _WP_Editors::parse_settings('ap[id]', $settings);
if (!current_user_can('upload_files')) {
$set['media_buttons'] = false;
}
if ($set['media_buttons']) {
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
$post = get_post();
if (!$post && !empty($GLOBALS['post_ID'])) {
$post = $GLOBALS['post_ID'];
}
wp_enqueue_media(array('post' => $post));
}
_WP_Editors::editor_settings('ap[id]', $set);
}
示例13: enqueue_wp_editor_scripts
public function enqueue_wp_editor_scripts()
{
//initialize scripts for ajax text-editors
if (!class_exists('_WP_Editors')) {
require_once ABSPATH . WPINC . '/class-wp-editor.php';
}
$editor_id = 'content1';
$set = array('teeny' => false, 'tinymce' => true, 'quicktags' => false);
$set = _WP_Editors::parse_settings($editor_id, $set);
_WP_Editors::editor_settings($editor_id, $set);
}
示例14: wp_tiny_mce
/**
* Outputs the TinyMCE editor.
*
* @since 2.7.0
* @deprecated 3.3.0 Use wp_editor()
* @see wp_editor()
*
* @staticvar int $num
*/
function wp_tiny_mce($teeny = false, $settings = false)
{
_deprecated_function(__FUNCTION__, '3.3.0', 'wp_editor()');
static $num = 1;
$editor_id = 'content' . $num++;
$set = array('teeny' => $teeny, 'tinymce' => $settings ? $settings : true, 'quicktags' => false);
$set = _WP_Editors::parse_settings($editor_id, $set);
_WP_Editors::editor_settings($editor_id, $set);
}