add_node([ 'id' => self::ADMIN_BAR_NODE, 'parent' => 'top-secondary', 'title' => $container, ]); } /** * The simple toolbar is its own markup, not admin-bar nodes. * * @return void */ public function renderToolbarMountPoint() { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Mount escapes echo self::container(Slots::FRONTEND_TOPBAR); } /** * Toolbar\Frontend loads only for partners with the flag, so asking it * directly drops the core-bar node for everyone else. * * @return bool */ private static function simpleToolbarActive() { return (bool) \apply_filters('extendify_simple_toolbar_active', false); } /** * Partner messaging aimed at the site owner, so visitors never see the bars. * * @return string */ private static function container(string $slot) { if (\is_admin() || !\is_user_logged_in() || !\current_user_can(Config::$requiredCapability)) { return ''; } // A bar pinned over the Customizer preview covers the site being previewed. if (\is_customize_preview()) { return ''; } return Mount::container($slot); } }