Skip to content

Commit

Permalink
Merge pull request #6186 from Automattic/fix/always-fire-publicize-if…
Browse files Browse the repository at this point in the history
…-connections

Always fire publicize if there are any connections
  • Loading branch information
ebinnion authored Jan 27, 2017
2 parents f76d6bf + a959187 commit 8fe1ff8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions modules/publicize/publicize-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function admin_page_load() {
if ( is_wp_error( $verification ) ) {
$url = Jetpack::admin_url( 'jetpack#/settings' );
wp_die( sprintf( __( "Jetpack is not connected. Please connect Jetpack by visiting <a href='%s'>Settings</a>.", 'jetpack' ), $url ) );

}
$stats_options = get_option( 'stats_options' );
$wpcom_blog_id = Jetpack_Options::get_option( 'id' );
Expand Down Expand Up @@ -454,7 +454,7 @@ function test_connection( $service_name, $connection ) {
function save_publicized( $post_ID, $post, $update ) {
// Only do this when a post transitions to being published
if ( get_post_meta( $post->ID, $this->PENDING ) && $this->post_type_is_publicizeable( $post->post_type ) ) {
$connected_services = $this->get_services( 'connected' );
$connected_services = Jetpack_Options::get_option( 'publicize_connections' );
if ( ! empty( $connected_services ) ) {
/**
* Fires when a post is saved that has is marked as pending publicizing
Expand All @@ -480,7 +480,7 @@ function set_post_flags( $flags, $post ) {
return $flags;
}

$connected_services = $this->get_services( 'connected' );
$connected_services = Jetpack_Options::get_option( 'publicize_connections' );

if ( empty( $connected_services ) ) {
return $flags;
Expand Down
4 changes: 2 additions & 2 deletions modules/publicize/publicize.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ function save_meta( $post_id, $post ) {
// Did this request happen via wp-admin?
$from_web = isset( $_SERVER['REQUEST_METHOD'] )
&&
'post' == strtolower( $_SERVER['REQUEST_METHOD'] )
&&
'post' == strtolower( $_SERVER['REQUEST_METHOD'] )
&&
isset( $_POST[$this->ADMIN_PAGE] );

if ( ( $from_web || defined( 'POST_BY_EMAIL' ) ) && isset( $_POST['wpas_title'] ) ) {
Expand Down

0 comments on commit 8fe1ff8

Please sign in to comment.