\'Bricks builder\' must be installed and activated, in order to activate \'' . self::TITLE . '\'
' ); } } /* Add admin menu item */ public static function admin_menu() { // Return: Current user has no access to Bricks if ( \Bricks\Capabilities::current_user_has_no_access() ) { return; } global $menu; $menu_exists = false; foreach ( $menu as $item ) { if ( array_search( 'bricks', $item ) !== false ) { $menu_exists = true; break; } } add_submenu_page( 'bricks', self::TITLE, self::TITLE, 'manage_options', self::PREFIX . 'menu', array( __CLASS__, 'menu_item' ) ); } /* Add settings link to plugin page */ public static function settings_link( $links ) { $url = esc_url( add_query_arg( 'page', self::PREFIX . 'menu', get_admin_url() . 'admin.php' ) ); // Create the link. $settings_link = "" . __( 'Settings' ) . ''; // Adds the link to the beginning of the array. array_unshift( $links, $settings_link ); return $links; } /* Setup the plugin updater */ public static function plugin_updater() { // retrieve our license key from the DB. $license_key = trim( get_option( self::PREFIX . 'license_key' ) ); // setup the updater. $edd_updater = new BricksExtrasUpdater( self::STORE_URL, __FILE__, array( 'version' => self::VERSION, // current version number 'license' => $license_key, // license key (used get_option above to retrieve from DB) 'item_id' => self::ITEM_ID, // ID of the product 'item_name' => self::TITLE, 'author' => 'BricksExtras', // author of this plugin 'url' => home_url(), 'beta' => false, ) ); } /* Clean database on uninstall */ public static function clean_db_on_uninstall() { foreach ( wp_load_alloptions() as $option => $value ) { if ( strpos( $option, 'bricksextras_' ) === 0 ) { delete_option( $option ); } } } /* Settings page styles */ public static function admin_settings_styles($hook_suffix) { wp_enqueue_style( 'x_admin_css', BRICKSEXTRAS_URL . 'includes/css/admin.css', false, '1.0.0' ); } public static function enqueue_defaults() { wp_enqueue_script( 'x-frontend', BRICKSEXTRAS_URL . 'components/assets/js/frontend.js', '', '1.0.0', true ); } /* Settings page tabs */ public static function menu_item() { $tab = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : false; ?>