Skip to content

Commit 292d89d

Browse files
authored
Merge pull request #27 from mailchimp/feat/wp-65-compat
Feat: WordPress 6.5.4 Compatibility
2 parents 00b1321 + 5e4f17e commit 292d89d

File tree

6 files changed

+6
-102
lines changed

6 files changed

+6
-102
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
js/scrollTo.js
21
tests

js/mailchimp.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
});
2222
$('#mc_submit_type').val('js');
2323
}
24-
$.scrollTo('#mc_signup', { offset: { top: -28 } });
24+
window.scrollTo({
25+
top: document.getElementById('mc_signup').offsetTop - 28,
26+
behavior: 'smooth',
27+
});
2528
}
2629

2730
$(function ($) {

js/scrollTo.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

mailchimp.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://mailchimp.com/help/connect-or-disconnect-list-subscribe-for-wordpress/
55
* Description: Add a Mailchimp signup form widget to your WordPress site.
66
* Version: 1.5.8
7-
* Requires at least: 2.8
7+
* Requires at least: 6.1
88
* Requires PHP: 7.0
99
* PHP tested up to: 8.3
1010
* Author: Mailchimp
@@ -105,7 +105,6 @@ function mailchimp_sf_load_resources() {
105105
// JS
106106
if ( get_option( 'mc_use_javascript' ) === 'on' ) {
107107
if ( ! is_admin() ) {
108-
wp_enqueue_script( 'jquery_scrollto', MCSF_URL . 'js/scrollTo.js', array( 'jquery' ), MCSF_VER, true );
109108
wp_enqueue_script( 'mailchimp_sf_main_js', MCSF_URL . 'js/mailchimp.js', array( 'jquery', 'jquery-form' ), MCSF_VER, true );
110109
// some javascript to get ajax version submitting to the proper location
111110
global $wp_scripts;

mailchimp_compat.php

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -31,95 +31,9 @@ function mailchimp_sf_display_widget( $args = array() ) {
3131
}
3232
}
3333

34-
3534
/* Shortcodes */
3635
add_shortcode( 'mailchimpsf_widget', 'mailchimp_sf_shortcode' );
3736

38-
39-
/* Functions for < WP 3.0 Compat */
40-
41-
if ( ! function_exists( 'home_url' ) ) {
42-
/**
43-
* Retrieve the home url for the current site.
44-
*
45-
* Returns the 'home' option with the appropriate protocol, 'https' if
46-
* is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
47-
* overridden.
48-
*
49-
* @package WordPress
50-
* @since 3.0.0
51-
*
52-
* @uses get_home_url()
53-
*
54-
* @param string $path (optional) Path relative to the home url.
55-
* @param string $scheme (optional) Scheme to give the home url context. Currently 'http','https'
56-
* @return string Home url link with optional path appended.
57-
*/
58-
function home_url( $path = '', $scheme = null ) {
59-
return get_home_url( null, $path, $scheme );
60-
}
61-
}
62-
63-
if ( ! function_exists( 'get_home_url' ) ) {
64-
/**
65-
* Retrieve the home url for a given site.
66-
*
67-
* Returns the 'home' option with the appropriate protocol, 'https' if
68-
* is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
69-
* overridden.
70-
*
71-
* @package WordPress
72-
* @since 3.0.0
73-
*
74-
* @param int $blog_id (optional) Blog ID. Defaults to current blog.
75-
* @param string $path (optional) Path relative to the home url.
76-
* @param string $scheme (optional) Scheme to give the home url context. Currently 'http','https'
77-
* @return string Home url link with optional path appended.
78-
*/
79-
function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
80-
$orig_scheme = $scheme;
81-
82-
if ( ! in_array( $scheme, array( 'http', 'https' ), true ) ) {
83-
$scheme = is_ssl() && ! is_admin() ? 'https' : 'http';
84-
}
85-
86-
if ( empty( $blog_id ) || ! is_multisite() ) {
87-
$home = get_option( 'home' );
88-
} else {
89-
$home = get_blog_option( $blog_id, 'home' );
90-
}
91-
92-
$url = str_replace( 'http://', "$scheme://", $home );
93-
94-
if ( ! empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) {
95-
$url .= '/' . ltrim( $path, '/' );
96-
}
97-
98-
return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );
99-
}
100-
}
101-
102-
if ( ! function_exists( 'is_multisite' ) ) {
103-
/**
104-
* Whether Multisite support is enabled
105-
*
106-
* @since 3.0.0
107-
*
108-
* @return bool True if multisite is enabled, false otherwise.
109-
*/
110-
function is_multisite() {
111-
if ( defined( 'MULTISITE' ) ) {
112-
return MULTISITE;
113-
}
114-
115-
if ( defined( 'VHOST' ) || defined( 'SUNRISE' ) ) {
116-
return true;
117-
}
118-
119-
return false;
120-
}
121-
}
122-
12337
/**
12438
* Deprecates functions for plugin version 1.6.0
12539
*

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== Mailchimp List Subscribe Form ===
22
Contributors: Mailchimp
33
Tags: mailchimp, email, newsletter, signup, marketing
4-
Tested up to: 4.5
4+
Tested up to: 6.5
55
Stable tag: 1.5.8
66
License: GPL-2.0-or-later
77
License URI: https://spdx.org/licenses/GPL-2.0-or-later.html

0 commit comments

Comments
 (0)