Skip to content

Commit

Permalink
[FIX_ARRAY] Fix post_type array bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsaycooper committed Dec 3, 2020
1 parent 8dcbe63 commit 3f3aede
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: brownac, lcooper, asilverman, nickgundry, sailthru-wp, automattic,
Tags: personalization, email,
Requires at least: 3.6
Tested up to: 5.4
Stable tag: 3.6.1
Stable tag: 3.6.2

This plugin provides fast and easy integration of the core Sailthru features into your Wordpress site.

Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v3.6.2 (2020-12-03)
Fixed bug where post_type not set properly

## v3.6.1 (2020-10-14)
Fixed bug where double opt-in option adds users to list immediately

Expand Down
21 changes: 12 additions & 9 deletions classes/class-sailthru-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '' );
}
Expand Down
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: 3.6.1
Version: 3.6.2
Author: Sailthru
Author URI: http://sailthru.com
Author Email: [email protected]
Expand Down Expand Up @@ -35,7 +35,7 @@
* @var const $version The current version of the plugin.
*/
if ( ! defined( 'SAILTHRU_PLUGIN_VERSION' ) ) {
define( 'SAILTHRU_PLUGIN_VERSION', '3.6.1' );
define( 'SAILTHRU_PLUGIN_VERSION', '3.6.2' );
}

if ( ! defined( 'SAILTHRU_PLUGIN_PATH' ) ) {
Expand Down

0 comments on commit 3f3aede

Please sign in to comment.