Code Monkey home page Code Monkey logo

Comments (14)

franz-josef-kaiser avatar franz-josef-kaiser commented on July 2, 2024

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. ) );

from meta-box.

rilwis avatar rilwis commented on July 2, 2024

Hi @jezthomp , I've just tested the <p> tag and don't see the problems.

Here's my content in the textarea box:

I'm a WP developer and a freelancer from Vietnam. <b>This is strong</b> <i>Cool</i><p>This is a paragraph</p><p>Another paragraph</p>

And I just display it using:

<?php echo get_post_meta( get_the_ID(), '_bio', true ); ?>

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 2, 2024

Guess we can close that as localized/invalid.

from meta-box.

rilwis avatar rilwis commented on July 2, 2024

OK, I close the issue now. @jezthomp if you still have this problem, please reopen the issue.

from meta-box.

dwcouch avatar dwcouch commented on July 2, 2024

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>
Viewing it in visual of course now shows my html of course.

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.

from meta-box.

rilwis avatar rilwis commented on July 2, 2024

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):

http://prntscr.com/6k74hn

And how it looks in the frontend:

http://prntscr.com/6k74lj

from meta-box.

dwcouch avatar dwcouch commented on July 2, 2024

The visual editor view:
screenshot 2015-03-22 23 17 59 - visual editor

The Text Editor view:
screenshot 2015-03-22 23 18 21 - text-editor

Front end and html:
screenshot 2015-03-22 23 19 29 - front-end and html

Edits via text to add p tags and a comment:
screenshot 2015-03-22 23 23 01 - add p tags via text

This is what it looks like after saving:
screenshot 2015-03-22 23 23 48 - saved p tags via text

This is how it renders:
screenshot 2015-03-22 23 25 18 - front-end and html

The visual editor now looks like html:
screenshot 2015-03-22 23 25 35 - visual editor

If I make new edits to the text editor like this and save;
screenshot 2015-03-22 23 28 12 - text editor

It shows up on the front end like this:
screenshot 2015-03-22 23 28 41 - front-end and html 2nd save

Oddly enough a quick workaround is to copy the html from the WYSIWYG editor
and paste it into the Text editor and then save.

On Sun, Mar 22, 2015 at 10:45 PM, Tran Ngoc Tuan Anh <
[email protected]> wrote:

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):

http://prntscr.com/6k74hn

And how it looks in the frontend:

http://prntscr.com/6k74lj


Reply to this email directly or view it on GitHub
#23 (comment).

from meta-box.

rilwis avatar rilwis commented on July 2, 2024

Can you upload images again? Looks like Github doesn't import images from email.

from meta-box.

dwcouch avatar dwcouch commented on July 2, 2024

I edited the previous message. Sorry about that.

from meta-box.

dwcouch avatar dwcouch commented on July 2, 2024

I found a stack-exchange post with a similar issue: http://wordpress.stackexchange.com/questions/94338/custom-editor-field-displaying-html-in-visual-editor

from meta-box.

rilwis avatar rilwis commented on July 2, 2024

Can you show me the code to register meta boxes?

from meta-box.

dwcouch avatar dwcouch commented on July 2, 2024
<?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 ***********************/
?>
'''

from meta-box.

rilwis avatar rilwis commented on July 2, 2024

Oh, this is another plugin Taxonomy Meta. I will fix it later in this repo.

from meta-box.

dwcouch avatar dwcouch commented on July 2, 2024

Oh geez. Sorry Tran. I forgot these were separate.
I've got both installed inside a custom theme.

Shall I repost on the TM repo?

from meta-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.