ablocks-install-banner
id, array( 'dashboard', 'themes' ) ) ) { return false; } // Check AJAX actions. if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { return false; } // Hide from network admin. if ( is_network_admin() ) { return false; } // Check if use can 'manage_options'. if ( ! current_user_can( 'manage_options' ) ) { return false; } // Check if use can 'install_plugins'. if ( ! current_user_can( 'install_plugins' ) ) { return false; } // Block editor context. if ( null !== $screen && $screen->is_block_editor() ) { return false; } return true; } /** * ablocks plugin status. */ function is_ablocks_plugin_status(): string { $plugin_slug = 'ablocks/ablocks.php'; $status = 'not-installed'; if ( is_plugin_active( $plugin_slug ) ) { return 'activated'; } if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) { return 'installed'; } return $status; } /** * Localize js. */ function localize_welcome_notice_js( $plugin_status ): array { return array( 'nonce' => wp_create_nonce( 'ariafse-dismiss-welcome-notice-nonce' ), 'ajaxUrl' => esc_url( admin_url( 'admin-ajax.php' ) ), 'pluginStatus' => $plugin_status, 'pluginSlug' => 'ablocks', 'activationUrl' => esc_url( add_query_arg( array( 'plugin_status' => 'all', 'paged' => '1', 'action' => 'activate', 'plugin' => rawurlencode( 'ablocks/ablocks.php' ), '_wpnonce' => wp_create_nonce( 'activate-plugin_ablocks/ablocks.php' ), ), admin_url( 'plugins.php' ) ) ), 'activating' => __( 'Activating', 'aria-fse' ) . '…', 'installing' => __( 'Installing', 'aria-fse' ) . '…', 'done' => __( 'Done', 'aria-fse' ), ); }