Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // para renderizar o editor:
- function apresentacao_texto_setting() {
- $options = get_option('p_apresentacao');
- wp_editor( get_post_meta(
- $options['apresentacao_texto'],
- 'apresentacaotexto',
- true
- ),
- 'apresentacaotexto', // editor id
- $settings = array(
- 'wpautop' => false,
- 'media_buttons' => false,
- 'editor_height' => 150,
- 'teeny' => true
- )
- );
- }
- // depois, para tentar salvar no banco de dados:
- function proserv_save_custom_fields() {
- global $_POST;
- $postid = (wp_is_post_revision( $postid )) ? wp_is_post_revision ( $post ) : $postid;
- $post_type = get_post_type( $postid );
- if ('textoapresentacao' == $post_type) {
- update_post_meta($postid, 'apresentacaotexto', $_POST['apresentacaotexto']);
- }
- }
- add_action('save_post', 'proserv_save_custom_fields', 1, 2);
- function admin_init(){
- add_meta_box("p_apresentacao_texto", "Texto Apresentacao", "apresentacao_meta_options", 'textoapresentacao', "normal", "low");
- }
- add_action('admin_init', 'admin_init');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement