echo messes with header – function column_css echoes on ‘init’ hook
-
PHP Error:
Warning Cannot modify header information – headers already sent by (output started at /home/iac/public_html/new/wp-content/plugins/image-cleanup/image-cleanup.plugin.php:151)
Function column_css echoes an in-line <style> on ‘admin_init’ hook (!) – before headers are sent. It prints the style before <doctype> is even declared.
Try instead to hook on ‘admin_enqueue_scripts’:
add_action( 'admin_enqueue_scripts', array ($this, 'img_clnup_admin_style' )); function img_clnup_admin_style(){ wp_enqueue_style('img_clnup_admin_style', IMGCLNUP_PLUGIN_URL . "img_clnup_admin.css"); }
(or at least print/echo it on the page – safely inside the html body)
Salut!
- The topic ‘echo messes with header – function column_css echoes on ‘init’ hook’ is closed to new replies.