| @@ 1221-1235 (lines=15) @@ | ||
| 1218 | * @param array $args arguments that need to have the source added. |
|
| 1219 | * @return array $amended arguments. |
|
| 1220 | */ |
|
| 1221 | public static function apply_activation_source_to_args( $args ) { |
|
| 1222 | list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' ); |
|
| 1223 | ||
| 1224 | if ( $activation_source_name ) { |
|
| 1225 | // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode |
|
| 1226 | $args['_as'] = urlencode( $activation_source_name ); |
|
| 1227 | } |
|
| 1228 | ||
| 1229 | if ( $activation_source_keyword ) { |
|
| 1230 | // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode |
|
| 1231 | $args['_ak'] = urlencode( $activation_source_keyword ); |
|
| 1232 | } |
|
| 1233 | ||
| 1234 | return $args; |
|
| 1235 | } |
|
| 1236 | ||
| 1237 | /** |
|
| 1238 | * Generates two secret tokens and the end of life timestamp for them. |
|
| @@ 4995-5005 (lines=11) @@ | ||
| 4992 | return self::connection()->get_assumed_site_creation_date(); |
|
| 4993 | } |
|
| 4994 | ||
| 4995 | public static function apply_activation_source_to_args( &$args ) { |
|
| 4996 | list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' ); |
|
| 4997 | ||
| 4998 | if ( $activation_source_name ) { |
|
| 4999 | $args['_as'] = urlencode( $activation_source_name ); |
|
| 5000 | } |
|
| 5001 | ||
| 5002 | if ( $activation_source_keyword ) { |
|
| 5003 | $args['_ak'] = urlencode( $activation_source_keyword ); |
|
| 5004 | } |
|
| 5005 | } |
|
| 5006 | ||
| 5007 | function build_reconnect_url( $raw = false ) { |
|
| 5008 | $url = wp_nonce_url( self::admin_url( 'action=reconnect' ), 'jetpack-reconnect' ); |
|