Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @doyuk

    I tested the function outside, it works. But it doesn’t work in XML editor.

    I’ve opened an internal ticket so that we can look into fixing this in a future release. In the meantime, you can use this method instead:

    1. Pass the {ID} element to your function instead of the content:

    <Content>[my_fix_content({ID})]</Content>

    2. Change your function code to this:

    function my_fix_content( $ID ) {
    	if ( $content = get_post_field( 'post_content', $ID ) ) {
    		$content = preg_replace("~(?:\[/?)[^/\]]+/?\]~s", '', $content);
    		$content = preg_replace('~(?:\[/?).*?"]~s', '', $content);
    		$content = preg_replace('(\\[([^[]|)*])', '', $content );
    		$content = preg_replace('/\[(.*?)\]/', '', $content );
    		return htmlentities( $content );
    	}
    }
    Thread Starter doyuk

    (@doyuk)

    My issue is resolved now. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Removing Visual Composer & Shortcodes’ is closed to new replies.