get_url( array( 'tab' => 'addons' ) ); // if there's an Event Aggregator license key, add the Facebook API fields if ( get_option( 'pue_install_key_event_aggregator' ) ) { $fb_token = tribe_get_option( 'fb_token' ); $fb_token_expires = tribe_get_option( 'fb_token_expires' ); $fb_token_scopes = tribe_get_option( 'fb_token_scopes' ); $missing_fb_credentials = ! $fb_token || ! $fb_token_scopes || ! $fb_token_expires || $fb_token_expires <= time(); if ( ! $missing_fb_credentials ) { /** * Allow developers to filter how many seconds they want to be warned about FB token expiring * @param int */ $boundary = apply_filters( 'tribe_aggregator_facebook_token_expire_notice_boundary', 4 * DAY_IN_SECONDS ); // Creates a Boundary for expire warning to appear, before the actual expiring of the token $boundary = $fb_token_expires - $boundary; $diff = human_time_diff( time(), $boundary ); $passed = ( time() - $fb_token_expires ); $original = date( 'Y-m-d H:i:s', $fb_token_expires ); $time[] = ''; if ( $passed > 0 ) { $time[] = sprintf( esc_html_x( 'about %s ago', 'human readable time ago', 'the-events-calendar' ), $diff ); } else { $time[] = sprintf( esc_html_x( 'in about %s', 'in human readable time', 'the-events-calendar' ), $diff ); } $time[] = ''; $time = implode( '', $time ); } ob_start(); ?>
array( 'type' => 'html', 'html' => '' . esc_html__( 'You need to connect Event Aggregator to Facebook to import your events from Facebook.', 'the-events-calendar' ) . '
', ), 'fb_token_button' => array( 'type' => 'html', 'html' => $facebook_token_html, ), 'meetup-start' => array( 'type' => 'html', 'html' => '' . esc_html__( 'You need a Meetup API Key to import your events from Meetup.', 'the-events-calendar' ) . '
', ), 'meetup_api_key' => array( 'type' => 'text', 'label' => esc_html__( 'Meetup API Key', 'the-events-calendar' ), 'tooltip' => sprintf( __( '%s to view your Meetup API Key', 'the-events-calendar' ), '' . __( 'Click here', 'the-events-calendar' ) . '' ), 'size' => 'medium', 'validation_type' => 'alpha_numeric', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, ), ); if ( ! tribe( 'events-aggregator.main' )->api( 'origins' )->is_oauth_enabled( 'facebook' ) ) { unset( $internal['fb-start'], $internal['fb-info-box'], $internal['fb_token_button'] ); } } $internal = apply_filters( 'tribe_addons_tab_fields', $internal ); $fields = array_merge( array( 'addons-box-start' => array( 'type' => 'html', 'html' => '' . __( 'Some features and add-ons require you to enter an API key or log into a third-party website so that The Events Calendar can communicate with an outside source.', 'the-events-calendar' ) . '
', ), 'addons-box-end' => array( 'type' => 'html', 'html' => '