Skip to content

Commit

Permalink
Update for 1.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
helen committed Jan 30, 2019
1 parent f9fc763 commit 724d279
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/).

## [ 1.3.8 ] - 2019-01-30
### Added
* Add `dt_after_set_meta` action.
* Add `dt_process_subscription_attributes` action.

### Fixed
* Ensure post types without excerpt support can be distributed.

## [ 1.3.7 ] - 2019-01-16
### Added
* Distribute plaintext URLs instead of full markup for automatic embeds (oEmbeds). This was causing issues for non-privileged users where the markup was subject to sanitization/kses.
Expand Down
4 changes: 2 additions & 2 deletions distributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Distributor
* Description: Makes it easy to syndicate and reuse content across your websites, whether inside of a multisite or across the web.
* Version: 1.3.7
* Version: 1.3.8
* Author: 10up Inc.
* Author URI: https://distributorplugin.com
* License: GPLv2 or later
Expand All @@ -17,7 +17,7 @@
exit; // Exit if accessed directly.
}

define( 'DT_VERSION', '1.3.7' );
define( 'DT_VERSION', '1.3.8' );
define( 'DT_PLUGIN_FILE', preg_replace( '#^.*plugins/(.*)$#i', '$1', __FILE__ ) );

// Define a constant if we're network activated to allow plugin to respond accordingly.
Expand Down
10 changes: 10 additions & 0 deletions includes/classes/API/SubscriptionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,16 @@ public function receive_item( $request ) {
\Distributor\Utils\set_media( $request['post_id'], $request['post_data']['distributor_media'] );
}

/**
* Action fired after receiving a subscription update from Distributor
*
* @since 1.3.8
*
* @param WP_Post $post Updated post object.
* @param WP_REST_Request $request Request object.
*/
do_action( 'dt_process_subscription_attributes', $post, $request );

$response = new \WP_REST_Response();
$response->set_data( array( 'updated' => true ) );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,10 @@ private function to_wp_post( $post ) {

if ( isset( $post['excerpt']['raw'] ) ) {
$obj->post_excerpt = $post['excerpt']['raw'];
} else {
} elseif ( isset( $post['excerpt']['rendered'] ) ) {
$obj->post_excerpt = $post['excerpt']['rendered'];
} else {
$obj->post_excerpt = '';
}

$obj->post_status = 'draft';
Expand Down
14 changes: 14 additions & 0 deletions includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ function set_meta( $post_id, $meta ) {
}
}
}

/**
* Fires after Distributor sets post meta.
*
* Note: All sent meta is included in the `$meta` array, including blacklisted keys.
* Take care to continue to filter out blacklisted keys in any further meta setting.
*
* @param array $meta All received meta for the post
* @param array $existing_meta Existing meta for the post
* @param int $post_id Post ID
*
* @since 1.3.8
*/
do_action( 'dt_after_set_meta', $meta, $existing_meta, $post_id );
}

/**
Expand Down
14 changes: 7 additions & 7 deletions lang/distributor.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the GPLv2 or later.
msgid ""
msgstr ""
"Project-Id-Version: Distributor 1.3.7\n"
"Project-Id-Version: Distributor 1.3.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/distributor\n"
"POT-Creation-Date: 2019-01-16 13:42:38+00:00\n"
"POT-Creation-Date: 2019-01-30 17:41:23+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -69,20 +69,20 @@ msgstr ""
msgid "No post data for update."
msgstr ""

#: includes/classes/API/SubscriptionsController.php:318
#: includes/classes/API/SubscriptionsController.php:328
msgid "Sorry, you are not allowed to create subscriptions."
msgstr ""

#: includes/classes/API/SubscriptionsController.php:333
#: includes/classes/API/SubscriptionsController.php:343
msgid "Cannot create existing subscription."
msgstr ""

#: includes/classes/API/SubscriptionsController.php:337
#: includes/classes/API/SubscriptionsController.php:347
msgid "Subscription post does not exist."
msgstr ""

#: includes/classes/API/SubscriptionsController.php:389
#: includes/classes/API/SubscriptionsController.php:412
#: includes/classes/API/SubscriptionsController.php:399
#: includes/classes/API/SubscriptionsController.php:422
msgid "Invalid post ID."
msgstr ""

Expand Down

0 comments on commit 724d279

Please sign in to comment.