Skip to content

Commit

Permalink
New build
Browse files Browse the repository at this point in the history
  • Loading branch information
ebinnion committed Dec 7, 2017
1 parent 75ebf5e commit 7a2fd34
Show file tree
Hide file tree
Showing 4 changed files with 9,044 additions and 3 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,21 @@ function my_cta_button_url() {
}
```

### Customizing the from tracking argument

By default, when a site is connected to WordPress.com, a `from` argument gets appeneded to the connection URL which is used to track where the connection came from. Originally, this argument was simply `from=jpo`, but recently we started appending the version number to allow differentiating between versions. This looked like, `from=jpo-1.7.1`.

While that has helped, we've found that it didn't all use cases. So, we are adding the `jpo_tracking_from_arg` filter which will allow hosts that use Jetpack Onboarding to fine-tune the `from` argument.

Here is some example usage:

```php
add_filter( 'jpo_tracking_from_arg', 'modify_jpo_from', 10, 2 );
function modify_jpo_from( $from, $version ) {
return sprintf( 'jpo-%d-my-cool-host', $version );
}
```

## Inserting the JPO wizard onto other pages

By default, JPO runs in the welcome panel, but you can run it by inserting a div with the id 'jpo-welcome-panel' into any other page, like this:
Expand Down
6 changes: 4 additions & 2 deletions class.jetpack-onboarding-end-points.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Jetpack_Onboarding_EndPoints {
const BUSINESS_ADDRESS_SAVED_KEY = 'jpo_business_address_saved';
const MAX_THEMES = 3;
const NUM_RAND_THEMES = 3;
const VERSION = '1.7.3';
const VERSION = '1.7.4';
const WOOCOMMERCE_ID = 'woocommerce/woocommerce.php';
const WOOCOMMERCE_SLUG = 'woocommerce';
const HIDE_FOR_ALL_USERS_OPTION = 'jpo_hide_always';
Expand Down Expand Up @@ -774,7 +774,9 @@ static function configure_jetpack() {

$connect_url = add_query_arg( 'host', JETPACK_ONBOARDING_VENDOR_CODE, $connect_url );
$connect_url = add_query_arg( 'product', JETPACK_ONBOARDING_PRODUCT_CODE, $connect_url );
$connect_url = add_query_arg( 'from', 'jpo-' . self::VERSION, $connect_url );

$from_arg = apply_filters( 'jpo_tracking_from_arg', sprintf( 'jpo-%s', self::VERSION ), self::VERSION );
$connect_url = add_query_arg( 'from', $from_arg, $connect_url );

wp_send_json_success( array('next' => $connect_url) );
} else {
Expand Down
2 changes: 1 addition & 1 deletion jetpack-onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Jetpack Onboarding
* Plugin URI: https://github.com/automattic/jetpack-onboarding
* Description: Jetpack Onboarding Wizard.
* Version: 1.7.3
* Version: 1.7.4
*/

require_once( plugin_dir_path( __FILE__ ) . 'class.jetpack-onboarding-end-points.php' );
Expand Down
Loading

0 comments on commit 7a2fd34

Please sign in to comment.