Skip to content

Instantly share code, notes, and snippets.

@nextend
Last active June 8, 2018 06:06
Show Gist options
  • Save nextend/c7201df29919f5719cfed767584fc295 to your computer and use it in GitHub Desktop.
Save nextend/c7201df29919f5719cfed767584fc295 to your computer and use it in GitHub Desktop.
Fix for Insert PHP Code Snippet output buffer issue
<?php
/*
Plugin Name: Fix: Insert PHP Code Snippet output buffer issue
Author: nextendweb
Version: 1.0.0
Requires at least: 4.1
Tested up to: 4.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
add_action('plugins_loaded', 'fix_insert_php_code_snippet');
function fix_insert_php_code_snippet() {
if (function_exists('xyz_ips_display_content')) {
add_shortcode('xyz-ips', 'fix_xyz_ips_display_content');
}
}
function fix_xyz_ips_display_content($xyz_snippet_name) {
ob_start();
return xyz_ips_display_content($xyz_snippet_name);
}