• Resolved nicksoper

    (@nicksoper)


    Hi! Cool plugin.

    Is it possible to only pull the raw post content without any HTML wrapper?

    In the settings I see the block and inline options for “Wrapper for inserts” but I’d like to have nothing but the text in the post content.

    In other words, I’d like to change this output

    <span data-post-id="5150" class="insert-page insert-page-5150 ">4.97</span>

    To this output
    4.97

    I am periodically scraping our business review data which I would like insert into a page (technically content-block). The scraper can only update post or page content.

    Alternative ideas would be welcome.

    • This topic was modified 2 years, 4 months ago by nicksoper.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Paul Ryan

    (@figureone)

    Sure, if you’re comfortable using filters you can add this to your theme’s functions.php (or wherever else you have your custom actions and filters):

    if ( class_exists( 'InsertPagesPlugin' ) ) {
    	remove_filter( 'insert_pages_wrap_content', array( InsertPagesPlugin::get_instance(), 'insert_pages_wrap_content' ), 10 );
    }

    This unhooks the default wrapper defined in the plugin:
    https://github.com/uhm-coe/insert-pages/blob/master/insert-pages.php#L1075-L1086

    You can also add your own custom filter function to further customize.

Viewing 1 replies (of 1 total)
  • The topic ‘Exclude HTML in Post Content with no wrapper’ is closed to new replies.