| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | * on a WordPress multisite setup. |
| 47 | 47 | * |
| 48 | 48 | * @since 1.9.7.4 |
| 49 | 49 | * |
| 50 | - * @param WP_Site|int $site_or_blog_id WP_Site or Blog ID. | |
| 50 | + * @param mixed $site_or_blog_id WP_Site or Blog ID. | |
| 51 | 51 | */ |
| 52 | 52 | function convertkit_plugin_activate_new_site( $site_or_blog_id ) { |
| 53 | 53 | |
| 54 | 54 | // Check if $site_or_blog_id is a WP_Site or a blog ID. |
| @@ -125,34 +125,8 @@ | ||
| 125 | 125 | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | - * Helper method to get supported Post Types for Restricted Content (Member's Content) | |
| 130 | - * | |
| 131 | - * @since 2.1.0 | |
| 132 | - * | |
| 133 | - * @return array Post Types | |
| 134 | - */ | |
| 135 | -function convertkit_get_supported_restrict_content_post_types() { | |
| 136 | - | |
| 137 | - $post_types = array( | |
| 138 | - 'page', | |
| 139 | - ); | |
| 140 | - | |
| 141 | - /** | |
| 142 | - * Defines the Post Types that support Restricted Content / Members Content functionality. | |
| 143 | - * | |
| 144 | - * @since 2.0.0 | |
| 145 | - * | |
| 146 | - * @param array $post_types Post Types | |
| 147 | - */ | |
| 148 | - $post_types = apply_filters( 'convertkit_get_supported_restrict_content_post_types', $post_types ); | |
| 149 | - | |
| 150 | - return $post_types; | |
| 151 | - | |
| 152 | -} | |
| 153 | - | |
| 154 | -/** | |
| 155 | 129 | * Helper method to get registered Shortcodes. |
| 156 | 130 | * |
| 157 | 131 | * @since 1.9.6.5 |
| 158 | 132 | * |
| @@ -199,32 +173,8 @@ | ||
| 199 | 173 | |
| 200 | 174 | } |
| 201 | 175 | |
| 202 | 176 | /** |
| 203 | - * Helper method to get registered Block formatters for Gutenberg. | |
| 204 | - * | |
| 205 | - * @since 2.2.0 | |
| 206 | - * | |
| 207 | - * @return array Block formatters | |
| 208 | - */ | |
| 209 | -function convertkit_get_block_formatters() { | |
| 210 | - | |
| 211 | - $block_formatters = array(); | |
| 212 | - | |
| 213 | - /** | |
| 214 | - * Registers block formatters in Gutenberg for the ConvertKit Plugin. | |
| 215 | - * | |
| 216 | - * @since 2.2.0 | |
| 217 | - * | |
| 218 | - * @param array $block_formatters Block formatters. | |
| 219 | - */ | |
| 220 | - $block_formatters = apply_filters( 'convertkit_get_block_formatters', $block_formatters ); | |
| 221 | - | |
| 222 | - return $block_formatters; | |
| 223 | - | |
| 224 | -} | |
| 225 | - | |
| 226 | -/** | |
| 227 | 177 | * Helper method to return the Plugin Settings Link |
| 228 | 178 | * |
| 229 | 179 | * @since 1.9.6 |
| 230 | 180 | * |
| @@ -252,16 +202,9 @@ | ||
| 252 | 202 | * @return string ConvertKit Registration URL. |
| 253 | 203 | */ |
| 254 | 204 | function convertkit_get_registration_url() { |
| 255 | 205 | |
| 256 | - return add_query_arg( | |
| 257 | - array( | |
| 258 | - 'utm_source' => 'wordpress', | |
| 259 | - 'utm_term' => get_locale(), | |
| 260 | - 'utm_content' => 'convertkit', | |
| 261 | - ), | |
| 262 | - 'https://app.convertkit.com/users/signup' | |
| 263 | - ); | |
| 206 | + return 'https://app.convertkit.com/users/signup?utm_source=wordpress&utm_content=convertkit'; | |
| 264 | 207 | |
| 265 | 208 | } |
| 266 | 209 | |
| 267 | 210 | /** |
| @@ -272,16 +215,9 @@ | ||
| 272 | 215 | * @return string ConvertKit Login URL. |
| 273 | 216 | */ |
| 274 | 217 | function convertkit_get_sign_in_url() { |
| 275 | 218 | |
| 276 | - return add_query_arg( | |
| 277 | - array( | |
| 278 | - 'utm_source' => 'wordpress', | |
| 279 | - 'utm_term' => get_locale(), | |
| 280 | - 'utm_content' => 'convertkit', | |
| 281 | - ), | |
| 282 | - 'https://app.convertkit.com/' | |
| 283 | - ); | |
| 219 | + return 'https://app.convertkit.com/?utm_source=wordpress&utm_content=convertkit'; | |
| 284 | 220 | |
| 285 | 221 | } |
| 286 | 222 | |
| 287 | 223 | /** |
| @@ -292,80 +228,13 @@ | ||
| 292 | 228 | * @return string ConvertKit App URL. |
| 293 | 229 | */ |
| 294 | 230 | function convertkit_get_api_key_url() { |
| 295 | 231 | |
| 296 | - return add_query_arg( | |
| 297 | - array( | |
| 298 | - 'utm_source' => 'wordpress', | |
| 299 | - 'utm_term' => get_locale(), | |
| 300 | - 'utm_content' => 'convertkit', | |
| 301 | - ), | |
| 302 | - 'https://app.convertkit.com/account_settings/advanced_settings/' | |
| 303 | - ); | |
| 232 | + return 'https://app.convertkit.com/account_settings/advanced_settings/?utm_source=wordpress&utm_content=convertkit'; | |
| 304 | 233 | |
| 305 | 234 | } |
| 306 | 235 | |
| 307 | 236 | /** |
| 308 | - * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Form or Landing Page. | |
| 309 | - * | |
| 310 | - * @since 2.2.3 | |
| 311 | - * | |
| 312 | - * @return string ConvertKit App URL. | |
| 313 | - */ | |
| 314 | -function convertkit_get_new_form_url() { | |
| 315 | - | |
| 316 | - return add_query_arg( | |
| 317 | - array( | |
| 318 | - 'utm_source' => 'wordpress', | |
| 319 | - 'utm_term' => get_locale(), | |
| 320 | - 'utm_content' => 'convertkit', | |
| 321 | - ), | |
| 322 | - 'https://app.convertkit.com/forms/designers/new/' | |
| 323 | - ); | |
| 324 | - | |
| 325 | -} | |
| 326 | - | |
| 327 | -/** | |
| 328 | - * Helper method to return the URL the user needs to visit to edit ConvertKit forms. | |
| 329 | - * | |
| 330 | - * @since 2.2.3 | |
| 331 | - * | |
| 332 | - * @return string ConvertKit Form Editor URL. | |
| 333 | - */ | |
| 334 | -function convertkit_get_form_editor_url() { | |
| 335 | - | |
| 336 | - return add_query_arg( | |
| 337 | - array( | |
| 338 | - 'utm_source' => 'wordpress', | |
| 339 | - 'utm_term' => get_locale(), | |
| 340 | - 'utm_content' => 'convertkit', | |
| 341 | - ), | |
| 342 | - 'https://app.convertkit.com/forms' | |
| 343 | - ); | |
| 344 | - | |
| 345 | -} | |
| 346 | - | |
| 347 | -/** | |
| 348 | - * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Product. | |
| 349 | - * | |
| 350 | - * @since 2.2.3 | |
| 351 | - * | |
| 352 | - * @return string ConvertKit App URL. | |
| 353 | - */ | |
| 354 | -function convertkit_get_new_product_url() { | |
| 355 | - | |
| 356 | - return add_query_arg( | |
| 357 | - array( | |
| 358 | - 'utm_source' => 'wordpress', | |
| 359 | - 'utm_term' => get_locale(), | |
| 360 | - 'utm_content' => 'convertkit', | |
| 361 | - ), | |
| 362 | - 'https://app.convertkit.com/products/new/' | |
| 363 | - ); | |
| 364 | - | |
| 365 | -} | |
| 366 | - | |
| 367 | -/** | |
| 368 | 237 | * Helper method to enqueue Select2 scripts for use within the ConvertKit Plugin. |
| 369 | 238 | * |
| 370 | 239 | * @since 1.9.6.4 |
| 371 | 240 | */ |
| @@ -384,35 +253,6 @@ | ||
| 384 | 253 | function convertkit_select2_enqueue_styles() { |
| 385 | 254 | |
| 386 | 255 | wp_enqueue_style( 'convertkit-select2', 'https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css', array(), CONVERTKIT_PLUGIN_VERSION ); |
| 387 | 256 | wp_enqueue_style( 'convertkit-admin-select2', CONVERTKIT_PLUGIN_URL . 'resources/backend/css/select2.css', array(), CONVERTKIT_PLUGIN_VERSION ); |
| 388 | - | |
| 389 | -} | |
| 390 | - | |
| 391 | -/** | |
| 392 | - * Return the contents of the given local file. | |
| 393 | - * | |
| 394 | - * @since 2.2.2 | |
| 395 | - * | |
| 396 | - * @param string $local_file Local file, including path. | |
| 397 | - * @return string File contents. | |
| 398 | - */ | |
| 399 | -function convertkit_get_file_contents( $local_file ) { | |
| 400 | - | |
| 401 | - // Call globals. | |
| 402 | - global $wp_filesystem; | |
| 403 | - | |
| 404 | - // Load filesystem class. | |
| 405 | - require_once ABSPATH . 'wp-admin/includes/file.php'; | |
| 406 | - | |
| 407 | - // Initiate. | |
| 408 | - WP_Filesystem(); | |
| 409 | - | |
| 410 | - // Bail if the file doesn't exist. | |
| 411 | - if ( ! $wp_filesystem->exists( $local_file ) ) { | |
| 412 | - return ''; | |
| 413 | - } | |
| 414 | - | |
| 415 | - // Return file's contents. | |
| 416 | - return $wp_filesystem->get_contents( $local_file ); | |
| 417 | 257 | |
| 418 | 258 | } |