tier (free/pro), label. */ public static function all() { return array( 'guests' => array( 'tier' => 'pro', 'label' => __( 'Guest players: members add up to 3 non-members to a reservation', 'boardit' ), ), 'guest_fee' => array( 'tier' => 'pro', 'label' => __( 'Guest fee: members pay online for their guest players (Mollie)', 'boardit' ), ), 'all_names' => array( 'tier' => 'pro', 'label' => __( 'Show the names of all players on the board to logged-in members', 'boardit' ), ), 'sponsor_logos' => array( 'tier' => 'pro', 'label' => __( 'Sponsor logos at the bottom of every email', 'boardit' ), ), 'fixed_reservations' => array( 'tier' => 'pro', 'label' => __( 'Fixed reservations (once or weekly) for lessons, competitions, social evenings and maintenance', 'boardit' ), ), 'stats' => array( 'tier' => 'pro', 'label' => __( 'Statistics: busiest days and times, court occupancy, monthly trend and most active members', 'boardit' ), ), ); } /** * Is dit de Pro-versie met een geldige licentie? * * @return bool */ public static function is_pro() { return boardit_is_pro(); } /** * Mag deze functie gebruikt worden? * * @param string $feature Naam uit all(); onbekende namen gelden als gratis. * @return bool */ public static function can( $feature ) { $features = self::all(); if ( ! isset( $features[ $feature ] ) || 'pro' !== $features[ $feature ]['tier'] ) { return true; } return self::is_pro(); } /** * Omschrijvingen van de Pro-functies (voor de pagina "BoardIt Pro"). * * @return string[] naam => omschrijving. */ public static function pro_labels() { $labels = array(); foreach ( self::all() as $name => $feature ) { if ( 'pro' === $feature['tier'] ) { $labels[ $name ] = $feature['label']; } } return $labels; } /** * Adres van de pagina "BoardIt Pro" in het beheer. * * @return string */ public static function upgrade_page_url() { return admin_url( 'admin.php?page=' . Boardit_Admin_Upgrade::SLUG ); } }