Skip to content

Commit

Permalink
move admin bar styles inline
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Mar 22, 2022
1 parent d6ec821 commit ef1246e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions includes/coming-soon.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct( Container $container ) {
'admin_screen_id' => 'newfold',
'admin_app_url' => \admin_url( 'admin.php?page=newfold' ),
'admin_notice_text' => __( 'Your site has `Coming Soon` mode active.', 'newfold-module-coming-soon' ),
'admin_bar_text' => __( 'Coming Soon Active', 'newfold-module-coming-soon' ),
'admin_bar_text' => '<div>' . __( 'Coming Soon Active', 'newfold-module-coming-soon' ) . '</div>',
'template_page_title' => __( 'Coming Soon!', 'newfold-module-coming-soon' ),
'template_styles' => false,
'template_content' => false,
Expand Down Expand Up @@ -89,11 +89,17 @@ public function notice_display() {
*/
public function add_tool_bar_item( \WP_Admin_Bar $admin_bar ) {
if ( current_user_can( 'manage_options' ) ) {
$allowed_adminbar_html = array(
// div with inline styles
'div' => array(
'style' => array()
),
);
if ( 'true' === get_option( esc_attr( $this->args['option_name'] ), 'false' ) ) {
$cs_args = array(
'id' => $this->args['admin_screen_id'] . '-coming_soon',
'href' => esc_url( $this->args['admin_app_url'] ),
'title' => '<div class="coming_soon-highlight">' . esc_html( $this->args['admin_bar_text'] ) . '</div>',
'title' => wp_kses( $this->args['admin_bar_text'], $allowed_adminbar_html ),
'meta' => array(
'title' => esc_attr__( 'Launch Your Site', 'newfold-module-coming-soon' ),
),
Expand Down

0 comments on commit ef1246e

Please sign in to comment.