Advertisement
Guest User

Untitled

a guest
Aug 20th, 2015
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. // para renderizar o editor:
  2. function apresentacao_texto_setting() {
  3.     $options = get_option('p_apresentacao');
  4.     wp_editor( get_post_meta(
  5.         $post->ID,
  6.         'apresentacaotexto',
  7.         true
  8.     ),
  9.     'apresentacaotexto', // editor id
  10.     $settings = array(
  11.         'wpautop' => false,
  12.         'media_buttons' => false,
  13.         'editor_height' => 150,
  14.         'teeny' => true
  15.     )
  16. );
  17. }
  18.  
  19.  
  20. // depois, para tentar salvar no banco de dados:
  21. function proserv_save_custom_fields() {
  22.     global $post;
  23.     update_post_meta(
  24.         $post->ID,
  25.         'apresentacaotexto',
  26.         $_POST['apresentacaotexto']
  27.     );
  28. }
  29. add_action('save_post', 'proserv_save_custom_fields');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement