wp_editor( $content, $editor_id, $settings);
works and appears for users with upload_files
capability only. I need it to display for visitors, too.
A seperate media upload button would work for visitors (tested),
but I need the ability to place images inside the content.wp_editor
is placed within a frontend submission form and visitors can create posts (with pending review).
Is there anyone who could help?
The options page includes a wp_editor form element, which worked perfectly. With the WP upgrade the options page now displays a broken Tiny MCE editor above the options page. Where the wp_editor is supposed to be displayed it is still displayed but it is broken, it doesn’t display anything in the editor.
I’ve spent many hours googling and reading through articles (most are out of date) to no avail. I’m hoping someone can point me in the right direction for resolving this coding issue.
I have the following code in my functions.php
function x_theme_admin_styles() {
wp_editor( "" , "main_text", array());
wp_enqueue_script('word-count');
wp_enqueue_script('post');
wp_enqueue_script('editor');
wp_enqueue_script('media-upload');
wp_enqueue_script('jquery');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
}
And this is how I am calling the wp_editor on the options page form:
wp_editor($x_maincont_opt['x_main_text'], "main_text", array());
$settings = array( 'textarea_name' => 'content', 'media_buttons' => false );
wp_editor( '', 'content', $settings );
I then add the content as a post:
$post = array(
'post_title' => sanitize_text_field($_POST['title']),
'post_content' => wp_kses_post($_POST['content']),
'post_status' => 'draft',
'post_type' => 'post',
);
$post_id = wp_insert_post($post);
I’ve noticed that this adds the content as a Classic block within Gutenberg. Is there a way to automatically have it converted to blocks within Gutenberg?
]]>This plugin does not work with PHP 8. It works fine with PHP 7.4.
Are there any plans to update it so it is PHP 8 compatible?
Many Thanks!
]]>For now, when I drag a specific sentence from the visual tab and move to the text tab, the focus disappears.
If anyone knows a solution please let me know.
I am using wp version 4.9.20.
Here is my wp_editor() usage.
$meta_key = '_my_meta_key';
$meta_value = get_post_meta($post->ID, $meta_key, true);
$settings = array(
'textarea_name' => $meta_key,
'media_buttons' => false,
);
wp_editor($meta_value, 'my_custom_editor', $settings);
]]>My code line:
<?php wp_editor( $rma_settings['policy'], 'refund_policy', [ 'editor_height' => 50, 'quicktags' => false, 'media_buttons' => false, 'teeny' => true, 'editor_class' => 'refund_policy' ] ); ?>
'h_referal_method' => array(
'label' => __( 'Referral Method', 'wpsl' ),
'type' => 'wp_editor',
),
Now this field showing on backend like: https://nimb.ws/3Ed9Qj
I did some code to show this field on front end as per your document and field showing fine on Front-end: https://nimb.ws/7riyao but issue is it removing Links on front-end that we added on backend. we have to keep this links on front-end.
I have use this code but get some jquery related errors and not generated a successfully wp_editor layout.
– Not get text-mode buttons.
https://i.ibb.co/19dhzfS/Capture.png
]]><p><a href="https://www.www.ads-software.com">www.www.ads-software.com</a></p>
This is the code:
<?php $args = array(
'editor_height' => 200,
'media_buttons' => false,
'teeny' => true,
'dfw' => false,
'tinymce' => true,
'wpautop' => false,
'quicktags' => true
);
$str = stripslashes($item['description']);
wp_editor($str, 'description', $args );
?>
Do you konow what the problem may be?
Thanks in advance!
Josep
]]>The plugin is fantastic and runs great in wp-admin. Now, I need to make it work in my front-end also.
]]>