summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
committerAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
commita6b006c0f1ef757f23375f7906193370337d8bd7 (patch)
tree4467c6423b2c54e6ef8c3e79241a833fb17833a5 /plugins/jetpack/modules/publicize/publicize-jetpack.php
parentUpdate akismet 4.0.7 (diff)
downloadblogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.gz
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.bz2
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.zip
Update jetpack 6.2
Diffstat (limited to 'plugins/jetpack/modules/publicize/publicize-jetpack.php')
-rw-r--r--plugins/jetpack/modules/publicize/publicize-jetpack.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/publicize/publicize-jetpack.php b/plugins/jetpack/modules/publicize/publicize-jetpack.php
index 0923af21..9834fe20 100644
--- a/plugins/jetpack/modules/publicize/publicize-jetpack.php
+++ b/plugins/jetpack/modules/publicize/publicize-jetpack.php
@@ -138,6 +138,27 @@ class Publicize extends Publicize_Base {
return false;
}
+ function get_all_connections_for_user() {
+ $connections = Jetpack_Options::get_option( 'publicize_connections' );
+
+ $connections_to_return = array();
+ if ( ! empty( $connections ) ) {
+ foreach ( (array) $connections as $service_name => $connections_for_service ) {
+ foreach ( $connections_for_service as $id => $connection ) {
+ $user_id = intval( $connection['connection_data']['user_id'] );
+ // phpcs:ignore WordPress.PHP.YodaConditions.NotYoda
+ if ( $user_id === 0 || $this->user_id() === $user_id ) {
+ $connections_to_return[ $service_name ][ $id ] = $connection;
+ }
+ }
+ }
+
+ return $connections_to_return;
+ }
+
+ return false;
+ }
+
function get_connection_id( $connection ) {
return $connection['connection_data']['id'];
}
@@ -395,6 +416,10 @@ class Publicize extends Publicize_Base {
}
function flag_post_for_publicize( $new_status, $old_status, $post ) {
+ if ( ! $this->post_type_is_publicizeable( $post->post_type ) ) {
+ return;
+ }
+
if ( 'publish' == $new_status && 'publish' != $old_status ) {
/**
* Determines whether a post being published gets publicized.