-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wysiwyg not saving paragraphs... #23
Comments
Afaik, no issue. I guess you simply haven't attached the proper filter. Just use echo apply_filter( 'the_content', get_post_meta( get_the_ID(), etc. ) ); |
Hi @jezthomp , I've just tested the Here's my content in the textarea box:
And I just display it using:
|
Guess we can close that as localized/invalid. |
OK, I close the issue now. @jezthomp if you still have this problem, please reopen the issue. |
I'm seeing this too - If I add to paragraphs while in [text] then save - the html comes through on the front end.However when I re-open, the editor is still in [text] but the html has been converted to html hex. <p> It's as if [text] saves html, but when re-opened it converts any html to the respective HTML Entity Names. So saving it again just makes a mess. |
Hi, I've tested again with wysiwyg field type and don't see the problem (same as comments above). Here is how I input text (after save post, I see same result): And how it looks in the frontend: |
Edits via text to add p tags and a comment: This is what it looks like after saving: The visual editor now looks like html: If I make new edits to the text editor like this and save; It shows up on the front end like this: Oddly enough a quick workaround is to copy the html from the WYSIWYG editor On Sun, Mar 22, 2015 at 10:45 PM, Tran Ngoc Tuan Anh <
|
Can you upload images again? Looks like Github doesn't import images from email. |
I edited the previous message. Sorry about that. |
I found a stack-exchange post with a similar issue: http://wordpress.stackexchange.com/questions/94338/custom-editor-field-displaying-html-in-visual-editor |
Can you show me the code to register meta boxes? |
<?php
/**
* Registering meta sections for taxonomies
*
* All the definitions of meta sections are listed below with comments, please read them carefully.
* Note that each validation method of the Validation Class MUST return value.
*
* You also should read the changelog to know what has been changed
*
*/
/********************* BEGIN DEFINITION OF META SECTIONS ***********************/
$prefix = 'badge_'; // doesn't seem to be globally supported.
global $badge_meta_sections;
$badge_meta_sections = array();
// first meta section
$badge_meta_sections[] = array(
'title' => '', // section title
'taxonomies' => array('sr_expertise', 'sr_service'), // list of taxonomies. Default is array('category', 'post_tag'). Optional
'id' => 'first_section', // ID of each section, will be the option name
'fields' => array( // list of meta fields
// TEXT AREA
array(
'name' => 'Extended Description',
'desc' => '<span class="description">Extended description.</span>',
'id' => 'badge_verbose',
'type' => 'wysiwyg',
'std' => ''
),
// RADIO BUTTONS
array(
'name' => 'Select a hover color',
'id' => "badge_hover_color1",
'type' => 'radio',
// Array of 'value' => 'Label' pairs for radio options.
// Note: the 'value' is stored in meta field, not the 'Label'
'options' => array(
'#1d2e5b' => '<span class="sr_Water ">Water </span><br>',
'#634379' => '<span class="purple ">Purple </span><br>',
'#445b6a' => '<span class="sr_Sea ">Sea </span><br>',
'#7895a4' => '<span class="sr_Wind ">Wind </span><br>',
'#5A6527' => '<span class="green ">Green </span><br>',
'#818154' => '<span class="sr_Moss ">Moss </span><br>',
'#8b6b29' => '<span class="sr_Nut_Brown">Nut Brown </span><br>',
'#ba8747' => '<span class="sr_Grain ">Grain </span><br>',
'#FCC53F' => '<span class="yellow ">Yellow </span><br>',
'#e28025' => '<span class="sr_Golden ">Golden </span><br>',
'#ad1015' => '<span class="sr_Fire ">Fire </span><br>',
'#90352d' => '<span class="sr_Brick ">Brick </span><br>',
'#632d00' => '<span class="sr_Earth ">Earth </span><br>',
'#473f38' => '<span class="sr_Warm_Gray ">Warm Gray </span><br>',
'#000000' => '<span class="sr_Black ">Black </span><br>'
),
)
)
);
/**
* Register meta boxes
*
* @return void
*/
function YOUR_PREFIX_register_taxonomy_meta_boxes()
{
// Make sure there's no errors when the plugin is deactivated or during upgrade
if ( !class_exists( 'RW_Taxonomy_Meta' ) )
return;
global $badge_meta_sections;
foreach ( $badge_meta_sections as $meta_section )
{
new RW_Taxonomy_Meta( $meta_section );
}
}
// Hook to 'admin_init' to make sure the class is loaded before
// (in case using the class in another plugin)
add_action( 'admin_init', 'YOUR_PREFIX_register_taxonomy_meta_boxes' );
/********************* END DEFINITION OF META SECTIONS ***********************/
/********************* BEGIN VALIDATION ***********************/
/**
* Validation class
* Define ALL validation methods inside this class
* Use the names of these methods in the definition of meta boxes (key 'validate_func' of each field)
*/
class RW_Taxonomy_Meta_Validate {
function check_name($text) {
if ($text == 'Anh Tran') {
return 'He is Rilwis';
}
return $text;
}
}
/********************* END VALIDATION ***********************/
?>
''' |
Oh, this is another plugin Taxonomy Meta. I will fix it later in this repo. |
Oh geez. Sorry Tran. I forgot these were separate. Shall I repost on the TM repo? |
A wysiwyg within a meta box although saying the text is in a p tag, its not actually once its printed front end.
Bold tags work, as do others but the initial P tag does not.
Kind of making having the wysiwyg there a bit pointless?
Anyone else have this issue or just me?
The text was updated successfully, but these errors were encountered: