| @@ 1281-1295 (lines=15) @@ | ||
| 1278 | * @param array $args arguments that need to have the source added. |
|
| 1279 | * @return array $amended arguments. |
|
| 1280 | */ |
|
| 1281 | public static function apply_activation_source_to_args( $args ) { |
|
| 1282 | list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' ); |
|
| 1283 | ||
| 1284 | if ( $activation_source_name ) { |
|
| 1285 | // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode |
|
| 1286 | $args['_as'] = urlencode( $activation_source_name ); |
|
| 1287 | } |
|
| 1288 | ||
| 1289 | if ( $activation_source_keyword ) { |
|
| 1290 | // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode |
|
| 1291 | $args['_ak'] = urlencode( $activation_source_keyword ); |
|
| 1292 | } |
|
| 1293 | ||
| 1294 | return $args; |
|
| 1295 | } |
|
| 1296 | ||
| 1297 | /** |
|
| 1298 | * Generates two secret tokens and the end of life timestamp for them. |
|
| @@ 5132-5142 (lines=11) @@ | ||
| 5129 | return self::connection()->get_assumed_site_creation_date(); |
|
| 5130 | } |
|
| 5131 | ||
| 5132 | public static function apply_activation_source_to_args( &$args ) { |
|
| 5133 | list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' ); |
|
| 5134 | ||
| 5135 | if ( $activation_source_name ) { |
|
| 5136 | $args['_as'] = urlencode( $activation_source_name ); |
|
| 5137 | } |
|
| 5138 | ||
| 5139 | if ( $activation_source_keyword ) { |
|
| 5140 | $args['_ak'] = urlencode( $activation_source_keyword ); |
|
| 5141 | } |
|
| 5142 | } |
|
| 5143 | ||
| 5144 | function build_reconnect_url( $raw = false ) { |
|
| 5145 | $url = wp_nonce_url( self::admin_url( 'action=reconnect' ), 'jetpack-reconnect' ); |
|