• The plugin is running normally,

    However, after inserting the page, garbled text appeared in the editing box,

    Perhaps it’s due to poor support for the Chinese language?

    For example:

    [insert page=’心’ display=’all ‘] in the editing box is invalid

    There is no problem with [insert page=’% e5% bf% 83′ display=’all ‘].

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter zhongxiyi

    (@zhongxiyi)

    I have solved this problem.

    Now I have a new idea.

    For example, I want to insert another page under the H2 title of the current page.

    The first title of the other page is H2, and the second title is H3.

    Can I automatically change the H2 title of the other page to H3 on the current page, and so on.

    Change the H3 title of another page to H4.

    Is it possible?

    Plugin Author Paul Ryan

    (@figureone)

    Hm that could be complex, one method would be to hook into the inserted page content and increment all headings by one (e.g., replacing all <h1> with <h2>, etc.). For example:

    add_filter( 'insert_pages_wrap_content', function ( $content ) {
    foreach ( array( 5, 4, 3, 2, 1 ) as $heading_level ) {
    $content = preg_replace( '/<h' . $heading_level . '([^>]*)>/', '<h' . ( $heading_level + 1 ) . '$1>', $content );
    }

    return $content;
    } );
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.