├── README.md
├── add-extra-currency.php
├── add-gtm-to-signup.php
├── add-intercom-to-signup.php
├── adduserrole.php
├── changetooltip.php
├── conversion-pixel.php
├── hidemetabox.php
├── insertclassonsignuppages.php
├── move-steps-to-top.php
└── prefill.php
/README.md:
--------------------------------------------------------------------------------
1 | # WP Ultimo Snippets
2 |
3 | This is a directory of WP Ultimo snippets that you can download and place on your wp-content/mu-plugins folder to instantly achieve a given goal.
4 |
5 | The snippets are commented, specifically telling which portions you should customize/modify.
6 |
7 | Enjoy!
8 |
9 | ## Snippets
10 | - Add Google Tag Manager to WP Ultimo's Sign-up - File: add-gtm-to-signup.php
11 | - Add Intercom to WP Ultimo's Sign-up - File: add-intercom-to-signup.php
12 | - Add name fields (first and last name) to the Account step on the sign-up flow - File: name-fields.php
13 | - Add extra currency to the list of WP Ultimo currencies - File: add-custom-currency.php
14 | - Add tracking code to capture conversions on user first access of the admin panel - File: conversion-pixel.php
15 | - Add user role on sign up - File: adduserrole.php
16 | - Change tool tip on WP Ultimo sign up fields - File: changetooltip.php
17 | - Hide WP Ultimo meta box on admin dashboard - File: hidemetabox.php
18 | - Insert class on WP Ultimo sign up pages for custom styling. - File: insertclassonsignuppages.php
19 | - Prefill domain title and URL fields on sign up - File: prefill.php
20 | - Move steps navigation to top of the page - File: stepsnavontop.php
21 |
22 | ## Contributing
23 |
24 | If you have a snippet you want to include here, you can either open a PR or send it to us on support@wpultimo.com.
25 |
--------------------------------------------------------------------------------
/add-extra-currency.php:
--------------------------------------------------------------------------------
1 | __('Omani Rial', 'wp-ultimo'),
14 | );
15 |
16 | return array_merge($extra, $currencies);
17 |
18 | });
19 |
--------------------------------------------------------------------------------
/add-gtm-to-signup.php:
--------------------------------------------------------------------------------
1 | and
9 | * which you can find in line 24.
10 | *
11 | * @author Arindo Duque - NextPress
12 | * @since 0.0.1
13 | *
14 | */
15 |
16 | /**
17 | * Adds the main GTM code to the header.
18 | *
19 | * @return void
20 | */
21 | function wu_add_gtm_code() { ?>
22 |
23 |
24 |
25 |
26 |
27 |
37 |
38 |
39 |
40 |
41 |
42 | and
10 | * then paste your new set of intercom code on the same spot.
11 | *
12 | * To change the app_id and leave the rest of the code intact, juse replace the value of APP_ID variable found on line 23
13 | *
14 | *
15 | * @return void
16 | */
17 | function wu_add_intercom() { ?>
18 |
19 |
20 |
21 |
30 |
31 |
32 |
33 |
34 |
35 | add_role('editor');
11 | *
12 | */
13 |
14 | add_action('wp_ultimo_registration', function($site_id, $user_id) {
15 |
16 | switch_to_blog($site_id);
17 |
18 | $curr_user = get_user_by('id', $user_id);
19 | $curr_user->add_role('author');
20 |
21 | restore_current_blog();
22 |
23 | }, 10, 2);
24 |
--------------------------------------------------------------------------------
/changetooltip.php:
--------------------------------------------------------------------------------
1 | with the tracking code and drop this onto your wp-content/mu-plugins folder.
9 | * If that folder does not exists, you can simply create it.
10 | */
11 | add_action('in_admin_footer', function() {
12 |
13 | if (!function_exists('wu_get_current_subscription')) {
14 |
15 | return;
16 |
17 | } // end if;Í
18 |
19 | $sub = wu_get_current_subscription();
20 |
21 | if ($sub) {
22 |
23 | $converted = get_user_meta($sub->user_id, 'wu_converted', true);
24 |
25 | if (!$converted) { ?>
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | user_id, 'wu_converted', 1);
39 |
40 | } // end if;
41 |
42 | } // end if;
43 |
44 | });
45 |
--------------------------------------------------------------------------------
/hidemetabox.php:
--------------------------------------------------------------------------------
1 |
14 |
25 |
14 |
15 |
23 |
24 | results = array('errors' => new WP_Error);
24 |
25 | $signup->results = array_merge($signup->results, array(
26 | 'blogname' => $name,
27 | ));
28 |
29 | } // end if;
30 |
31 | $fields['url_preview']['content'] = wu_get_template_contents('signup/steps/step-domain-url-preview', array(
32 | 'signup' => $signup,
33 | ));
34 |
35 | } // end if;
36 |
37 | foreach (array('blog_title', 'blogname') as $field) {
38 |
39 | if (isset($fields[$field]) && isset($_GET['new'])) {
40 |
41 | $name = esc_attr($_GET['new']);
42 |
43 | if ($field == 'blog_title') {
44 |
45 | $name = ucfirst($name);
46 |
47 | } // end if;
48 |
49 | $fields[$field]['attributes'] = array(
50 | 'value' => $name,
51 | );
52 |
53 | } // end if;
54 |
55 | } // end foreach;
56 |
57 | return $fields;
58 |
59 | });
60 |
--------------------------------------------------------------------------------