• When I create a snippet that might be a little complicated, I’d like to bold some text, use paragraph html tags and use lists.

    The current state ofthe plugin will strip all html from the description metabox even though I use the tinymce wysiwyg and even if use the “text” section of the input metabox.

    Could you please allow some tags to come through or perhaps add some filters so i can extend without having to edit your plugin files.

    Currently, if I replace this (lines 1266 to 1270 in /plugins/post-snippets/src/PostSnippets/Edit.php):

    //******************** Preparing Snippet Description ************************* */

    $snippet_desc = sanitize_textarea_field( $_REQUEST[‘snippet_desc’] ?? ” );

    //****************************** END *********************************** */

    with this:

    //******************** Preparing Snippet Description ************************* */

    $snippet_desc = wp_kses_post( $_REQUEST[‘snippet_desc’] ?? ” );

    //****************************** END *********************************** */

    it will work.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter SiteDesignUSA

    (@sitedesignusa)

    This is how I’ve handled my issue. I’ve hard-coded in the /plugins/post-snippets/src/PostSnippets/Edit.php file line 1266

                //******************** Preparing Snippet Description ************************* */

    // Custom allowed HTML tags
    $allowed_html = array(
    'h1' => array(),
    'h2' => array(),
    'h3' => array(),
    'h4' => array(),
    'h5' => array(),
    'h6' => array(),
    'b' => array(),
    'pre' => array(),
    'p' => array(),
    'ul' => array(),
    'ol' => array(),
    'li' => array(),
    );

    // Override the description sanitization
    $snippet_desc = wp_kses($_REQUEST['snippet_desc'] ?? '', $allowed_html);

    //****************************** END *********************************** */

    Would be neat to have a filter on this so I can change for my use but you wouldn’t have to change the plugin core code to this extent.

    Thanks!

    Thread Starter SiteDesignUSA

    (@sitedesignusa)

    added <strong>

                //******************** Preparing Snippet Description ************************* */

    // Custom allowed HTML tags
    $allowed_html = array(
    'h1' => array(),
    'h2' => array(),
    'h3' => array(),
    'h4' => array(),
    'h5' => array(),
    'h6' => array(),
    'b' => array(),
    'strong' => array(),
    'pre' => array(),
    'p' => array(),
    'ul' => array(),
    'ol' => array(),
    'li' => array(),
    );

    // Override the description sanitization
    $snippet_desc = wp_kses($_REQUEST['snippet_desc'] ?? '', $allowed_html);

    //****************************** END *********************************** */
    Plugin Support hamzawpexperts

    (@hamzawpexperts)

    Hello @sitedesignusa,

    Thanks for contacting us,

    I hope you are doing well, We’ve informed our technical team about your issue, and they will work on it promptly. When we receive their response, we will get back to you. Our team is here to assist you. Thank you for your patience.

    Thanks & Regards
    WP Experts Support Team

    Plugin Support hamzawpexperts

    (@hamzawpexperts)

    Hello @sitedesignusa,

    We would like to inform you that we will implement this in the upcoming release.

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.