Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

mortrza1371 on "new rich text editor in admin"

$
0
0

I use Following functions to add new new rich text editor in admin .

add_action( 'add_meta_boxes', 'adding_new_metaabox' );
function adding_new_metaabox()
{
    add_meta_box('html_myid_61_section', 'ویژگی ها', 'my_output_function');
}

function my_output_function( $post )
{
//so, dont ned to use esc_attr in front of get_post_meta
$valueeee2=  get_post_meta($_GET['post'], 'PLUGIN_VALUE' , true ) ;
 wp_editor( htmlspecialchars_decode($valueeee2), 'mettaabox_ID_stylee', $settings = array('textarea_name'=>'MyInputNAME') );
}

function save_my_postdata( $post_id )
{
if (!empty($_POST['MyInputNAME']))
    {
    $datta=htmlspecialchars($_POST['MyInputNAME']);
    update_post_meta($post_id, 'PLUGIN_VALUE', $datta );
    }
  }
 add_action( 'save_post', 'save_my_postdata' );

and use thise code to display content in the template.

<?php echo get_post_meta($post->ID, "PLUGIN_VALUE", true);?>
but can't display clean content in the post.

see

  • Can't
  • Display
  • good

I don't want display tags.

I want display only content

see

Can't
Display
good


Viewing all articles
Browse latest Browse all 8245

Trending Articles