Forum Replies Created

Viewing 15 replies - 1 through 15 (of 127 total)
  • Thread Starter bjorsq

    (@bjorsq)

    I posted the URL of the page which is having issues in IE 11 in my question, along with the error I am seeing in the console in IE 11. Can you please clarify exactly what you want me to post? I am using the latest version (3.0.3) in WordPress 5.3.2.

    Plugin Author bjorsq

    (@bjorsq)

    Hi,

    I’m sorry, this doesn’t appear to have anything to do with this plugin

    Plugin Author bjorsq

    (@bjorsq)

    Hi Ulrich,

    I haven’t had much success with this plugin and Gutenberg I’m afraid. With the plugin loading the editor in a metabox it will display the current excerpt, but I can’t get it to update the excerpt from the contents of the metabox. I believe this is probably down to the fact that Gutenberg allows editing excerpts and will overwrite the excerpt crafted in this plugin’s editor. The mechanism of this plugin is very simplistic, and does not alter the save/update mechanism of the page editor in any way (all it does is replace the textarea for excerpts with TinyMCE).

    With the next release I will probably disable this plugin if Gutenberg is enabled until I can find a reliable way of removing excerpt editing from Gutenberg and getting the metabox to save the excerpt instead.

    Thread Starter bjorsq

    (@bjorsq)

    Sorry – scratch that. The site was in wpengine and I think their object cache is the culprit.

    Plugin Author bjorsq

    (@bjorsq)

    Hi – this isn’t the expected outcome of using the plugin, but then all the plugin does is allow you to format excerpts using a rich text editor. The display of the excerpt on your site is dependent on your theme. GeneratePress calls the_excerpt(), but unfortunately this does not add the read more link to manual excerpts. What you will need to do is use GPHooks (if you have GeneratePress Premium) or a child theme/plugin to add the following filter:

    
    add_filter('wp_trim_excerpt', 'add_read_more_to_manual_excerpt', 10, 2);
    function add_read_more_to_manual_excerpt( $trimmed, $formatted )
    {
        $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' );
        return $formatted . '<p>' . $excerpt_more . '</p>';
    }
    

    The filter wp_trim_excerpt is called by the wordpress function of the same name, and is fed a trimmed version of the excerpt and the contents of $post->post_excerpt (which is your formatted text). The function itself will only provide and excerpt with read more link if no manual excerpt is present. Adding this filter will add $excerpt_more in a paragraph tag to the end of your manual excerpts.

    Plugin Author bjorsq

    (@bjorsq)

    Nice one!

    Plugin Author bjorsq

    (@bjorsq)

    If you look at the Rich Text Excerpt plugin settings, it should now have an option to enable the plugin for pages. If this option isn’t present, your installation still does not support excerpts for pages. If you have added post type support for excerpts to pages in your child theme as above, the only conclusion I can draw is that something else (another plugin or the parent theme) is removing support for excerpts on pages after your child theme adds it.

    Plugin Author bjorsq

    (@bjorsq)

    Are you certain? When you go to edit the page, is the excerpt editor shown at all? Either on the page or as a checkbox in screen options?

    Plugin Author bjorsq

    (@bjorsq)

    If you put it in the Child Theme’s functions.php file it should work.

    Plugin Author bjorsq

    (@bjorsq)

    No, you need to enable excerpts on pages (this is not enabled by default). One way of doing this is to put the following in your theme functions file.

    
    add_post_type_support( 'page', 'excerpt' );
    

    Missed one more edit in template/network_admin_network_settings.php to generate the multiselect list:

    
                $network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
                echo '<div class="multiselect" id="site-select-box">';
                foreach( $network_blogs as $blog ) {
                    echo '    <label><input ' . checked(get_blog_option( $blog->blog_id, 'mucd_duplicable', "no"), 'yes', false) . ' class="duplicables-list" type="checkbox" name="duplicables-list[]" value="'.$blog->blog_id.'" />' . substr($blog->domain . $blog->path, 0, -1) . '</label>';
                }
                echo '</div>';
    

    This is due to the wp_get_sites function being deprecated (I think the breaking change may have happened in 4.7?). There are 4 calls to this function in the plugin – one in include/functions.php and three in lib/option.php. The code needs to be edited so it uses the new get_sites function, which has a different parameter for the maximum number of sites to get (number rather than limit). It also needs to be changed so the list of sites are treated as objects instead of associative arrays. These are the edits which are working on my installs:

    in functions.php

    
            /**
             * Get all duplicable sites
             * @since 0.2.0
             * @return array of blog data
             */
            public static function get_site_list() {
                $site_list = array();
    
                $network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
                foreach( $network_blogs as $blogobj ){
                    $blog = (array) $blogobj;
                    if (MUCD_Functions::is_duplicable($blog['blog_id']) && MUCD_SITE_DUPLICATION_EXCLUDE != $blog['blog_id']) {
                        $site_list[] = $blog;
                    }
    
                }
    
                return $site_list;
            }
    

    in option.php

    
            /**
             * Init 'mucd_duplicable' options
             * @param string $blogs_value the value for blogs options
             * @param string $network_value the value for site option
             * @since 0.2.0
             */
            public static function init_duplicable_option($blogs_value = "no", $network_value = "all") {
                $network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
                foreach( $network_blogs as $blog ){
                    $blog_id = $blog->blog_id;
                    add_blog_option( $blog_id, 'mucd_duplicable', $blogs_value);
                }
                add_site_option( 'mucd_duplicables', $network_value );
            }
    
            /**
             * Delete 'mucd_duplicable' option for all sites
             * @since 0.2.0
             */
            public static function delete_duplicable_option() {
                $network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
                foreach( $network_blogs as $blog ){
                    $blog_id = $blog->blog_id;
                    delete_blog_option( $blog_id, 'mucd_duplicable');
                }
                delete_site_option( 'mucd_duplicables');
            }
    
            /**
             * Set 'mucd_duplicable' option to "yes" for the list of blogs, other to "no"
             * @since 0.2.0
             * @param array $blogs list of blogs we want the option set to "yes"
             */
            public static function set_duplicable_option($blogs) {
                $network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
                foreach( $network_blogs as $blog ){
                    if(in_array($blog->blog_id, $blogs)) {
                        update_blog_option( $blog->blog_id, 'mucd_duplicable', "yes");
                    }
                    else {
                        update_blog_option($blog->blog_id, 'mucd_duplicable', "no");
                    }
                }
            }
    
    

    Hope this helps…

    Plugin Author bjorsq

    (@bjorsq)

    This plugin has been tested in 4.6 but only in an installation where there are very few other plugins installed. If you have any additional plugins installed which affect the editor, try disabling them to see if this fixes the issue.

    The metabox editor checkbox is to cover and inconsistency with drag and drop (TinyMCE doesn’t like being dragged/dropped without disabling and re-initialising), and is left over from more than a year ago when this was a new feature. It sounds more like you are having a problem with another plugin interfering with TinyMCE.

    Plugin Author bjorsq

    (@bjorsq)

    Hi Maxizz,

    The current default entries for these buttons in the “toolbar buttons” box in Settings->Rich Text Excerpts refer to a previous version of the TinyMCE editor plugin and are as follows:

    justifyleft,justifycenter,justifyright

    Replace these with:

    alignleft,aligncenter,alignright,alignjustify

    I will update the default buttons in the next release

    Peter

    • This reply was modified 8 years ago by bjorsq.
    Thread Starter bjorsq

    (@bjorsq)

    I’m still not certain what arbitrary URLs are.

    I never did add my own filter, as there was no call to apply_filters in the plugin on the lines I referred to in my question, so nothing to hook into. Adding my own filter would have involved changing the code of the plugin (and losing these changes whenever the plugin is updated).

Viewing 15 replies - 1 through 15 (of 127 total)