diff --git a/README.txt b/README.txt index f746947..1333a6c 100755 --- a/README.txt +++ b/README.txt @@ -3,7 +3,7 @@ Contributors: sailthru-wp Tags: personalization, email, Requires at least: 5.5 Tested up to: 5.5.1 -Stable tag: 4.0.0 +Stable tag: 4.0.1 Provides an integration with Sailthru diff --git a/changelog.md b/changelog.md index 7d9e835..5df3bb5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,9 +1,15 @@ # Changelog +## v4.0.1 (2020-12-03) +Fixed warning where post_type not set properly + ## v4.0.0 (2020-10-14) Supports Wordpress version 5.5. This version isn't backwards compatible with older Wordpress versions. +## v3.6.2 (2020-12-03) +Fixed warning where post_type not set properly + ## v3.6.1 (2020-10-14) Fixed bug where double opt-in option adds users to list immediately diff --git a/classes/class-sailthru-content.php b/classes/class-sailthru-content.php index a44dd18..a4d59b5 100644 --- a/classes/class-sailthru-content.php +++ b/classes/class-sailthru-content.php @@ -291,15 +291,18 @@ function generate_payload( $post, $post_id ) { $url = get_permalink( $post->ID ); $url_with_correct_protocol = set_url_scheme( $url ); - $data = [ - 'url' => $url_with_correct_protocol, - 'title' => $post->post_title, - 'author' => get_the_author_meta( 'display_name', $post->post_author ), - 'date' => $post->post_date, - 'vars'['post_type'] => $post->post_type, - 'spider' => $spider_value == "false" ? 0 : 1, - 'description' => $post->post_excerpt - ]; + $data = array( + 'url' => $url_with_correct_protocol, + 'title' => $post->post_title, + 'author' => get_the_author_meta( 'display_name', $post->post_author ), + 'date' => $post->post_date, + 'vars' => array( + 'post_type' => $post->post_type, + ), + 'spider' => "false" == $spider_value ? 0 : 1, + 'description' => $post->post_excerpt, + ); + if ( empty( $post->post_excerpt ) ) { $data['description'] = wp_trim_words( $post->post_content, 250, '' ); } diff --git a/plugin.php b/plugin.php index 3608180..c6901b5 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ Plugin Name: Sailthru for WordPress Plugin URI: http://sailthru.com/ Description: Add the power of Sailthru to your WordPress set up. -Version: 4.0.0 +Version: 4.0.1 Requires at least: 5.5 Author: Sailthru Author URI: http://sailthru.com @@ -36,7 +36,7 @@ * @var const $version The current version of the plugin. */ if ( ! defined( 'SAILTHRU_PLUGIN_VERSION' ) ) { - define( 'SAILTHRU_PLUGIN_VERSION', '4.0.0' ); + define( 'SAILTHRU_PLUGIN_VERSION', '4.0.1' ); } if ( ! defined( 'SAILTHRU_PLUGIN_PATH' ) ) {