3
   Array
(
    [post] => Array
        (
            [jw_objective] => Exposure to e<b>nd to end development</b> of various applications; right from requirement analysis to system study, designing, coding, testing, de-bugging, <i>documentation and i</i>mplementation. Adept in <u>handling the design and coding functions</u>
            [postid] => 363
            [jw_fullname] => Pradeep
            [jw_email] => pradeepsk88@gmail.com
            [jw_phone] => 9952149811
            [jw_website] => www.por.com
            [jw_address1] => 83, VGP Nagar East
            [jw_address2] => T Nagar
            [jw_address3] => Chennai, India 605602
            [jw_title] => Senior Web Developer
            [jw_cname] => TPF Software Solutions
            [jw_startdate] => Dec 2010
            [jw_enddate] => Present
            [jw_desc] => This is my responsibilit<b>es in this job</b>
            [jw_qualifications] => Certified Public Acc<i>ountant (CPA)
                        Certified Management Accountant (CMA)
                        Certified Financial Manager (CFM)
                        Certified Fraud Examiner (CF</i>E)
                        Cer<b>tified Financial Planner (CFP)
                        Certified Internal Auditor (CIA)
                        Enrolled Agent (EA)
                        Certified Government Financial Manager (CGFM)
                                                                        </b>
            [jw_educname] => B.E
            [jw_eduiname] => Arunai College of Engineering
            [jw_edustartdate] => May 2005
            [jw_eduenddate] => May 2009
            [jw_edudesc] => This is a riduculous thing happen<b><i>ed in my life, </i></b>
            [jw_interest] => Th<i>ese are my interests</i>
            [jw_referance] => This Is my referance
        )

    )

This is the array I iterate through, and add it to the wp_postmeta through the following foreach loop

foreach ($_POST AS $key => $value) {
    add_post_meta($pid, $key, $value, true);
} 

The information is posted from a custom form.

The problem I have is the HTML tags like <b> and <i> are automatically stripped off when entering the database. The HTML is generated from a jquery wysiwyg editor

But the information is saved successfully. Is there any way to save postmeta with the HTML tags?

2

Is it that your tags are being stripped, or that you aren't preparing them prior to displaying them. Try wrapping your output:

echo apply_filters('the_content', get_post_meta($post->ID, '_custom_field_name', true));
0

On Update Use addslashes(); And On Print Use stripslashes();

  • 5
    Some explanation with examples would be great. – Nilambar Mar 23 '15 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.