• ibiza69

    (@ibiza69)


    Hi, we where wondering if could be possible to activate the TinyMCE Editor at Advance Excerpt, instead of having to place directly the HTML code at excerpts? Hopefully there is some code for activating it, as would be very appreciated.

    Thanks in advance for any feedback.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WPKube

    (@wpkube)

    Hi @ibiza69

    No, sorry, our plugin is only for manipulating the output of the excerpt, we don’t alter the method in which it’s created.

    I just tried looking for a different plugin that might help you with that but I wasn’t able to find anything, which kind of makes me think that it might not be possible, there’s usually a plugin for everything ??

    Did you have any luck in finding a plugin for that?

    Thread Starter ibiza69

    (@ibiza69)

    Hi @wpkube, thanks for taking the time to answer and yes, we found something that did the job very well, works like charm ??

    Here is the code to place at functions.php or Code Snippets:

    <?php
    
    /*******  https://github.com/cosmic/cosmic-tinymce-excerpt
      * Plugin Name: Cosmic TinyMCE Excerpt
      * Description: TinyMCE pour les extraits
      * Author: Agence Cosmic
      * Author URI: https://agencecosmic.com/
      * Version: 1.0
      ****************************/
     
     function cosmic_activate_page_excerpt() {
       add_post_type_support('page', array('excerpt'));
     }
     add_action('init', 'cosmic_activate_page_excerpt');
     
     # Removes default extracts and replaces them with new blocks
     function cosmic_replace_post_excerpt() {
       foreach (array("post", "page") as $type) {
         remove_meta_box('postexcerpt', $type, 'normal');
         add_meta_box('postexcerpt', __('Excerpt'), 'cosmic_create_excerpt_box', $type, 'normal');
       }
     }
     add_action('admin_init', 'cosmic_replace_post_excerpt');
     
     function cosmic_create_excerpt_box() {
       global $post;
       $id = 'excerpt';
       $excerpt = cosmic_get_excerpt($post->ID);
     
       wp_editor($excerpt, $id);
     }
     
     function cosmic_get_excerpt($id) {
       global $wpdb;
       $row = $wpdb->get_row("SELECT post_excerpt FROM $wpdb->posts WHERE id = $id");
       return $row->post_excerpt;
     }

    Hopefully can help others that look for it and/or you can include it somewhere:

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is there a way to activate the TinyMCE Editor at Advanced Excerpt?’ is closed to new replies.