fix: resolve warning cannot modify header information on enqueue style.
This commit is contained in:
parent
96a0034acd
commit
6fd7a289b7
|
@ -21,9 +21,8 @@ class Media {
|
|||
|
||||
protected function __construct() {
|
||||
add_action( 'init', [$this, 'add_attachment_page_rewrite_rule'] );
|
||||
|
||||
global $TAINACAN_BASE_URL;
|
||||
wp_enqueue_style( 'tainacan-media-page', $TAINACAN_BASE_URL . '/assets/css/tainacan-media-page.css', [], TAINACAN_VERSION );
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'add_css' ) );
|
||||
add_action( 'wp_enqueue_scripts', array( &$this, 'add_css' ) );
|
||||
|
||||
add_filter( 'query_vars', [$this, 'attachment_page_add_var'] );
|
||||
add_action( 'template_redirect', [$this, 'attachment_page'] );
|
||||
|
@ -37,6 +36,11 @@ class Media {
|
|||
);
|
||||
}
|
||||
|
||||
public function add_css() {
|
||||
global $TAINACAN_BASE_URL;
|
||||
wp_enqueue_style( 'tainacan-media-page', $TAINACAN_BASE_URL . '/assets/css/tainacan-media-page.css', [], TAINACAN_VERSION );
|
||||
}
|
||||
|
||||
public function attachment_page_add_var($vars) {
|
||||
$vars[] = 'tainacan_attachment_page';
|
||||
return $vars;
|
||||
|
|
Loading…
Reference in New Issue