pradlig
7/6/2017 - 3:27 AM

solución "Warning: Cannot modify header information"

solución "Warning: Cannot modify header information"

<?php

defined( 'ABSPATH' ) or die( 'Exit!' );

if (!class_exists('TemplateBack')) {

	/**
	* Funcionalidades para el tema base
	* 
	* @author Jesús Gil 
	* @author pradlig@gmail.com
	*/
	class TemplateBack {

		function __construct() {

			// solución "Warning: Cannot modify header information"
			add_action( 'init', array($this, 'app_output_buffer') );
		}

		// solución "Warning: Cannot modify header information"
		function app_output_buffer() {
			ob_start();
		}
	}

	global $TemplateBack;
	$TemplateBack = new TemplateBack();
}