Properties

$connected_services

$connected_services

Services that are currently connected to the given user through publicize.

$services

$services

Sservices that are supported by publicize. They don't neccessarly need to be connected to the current user.

$ADMIN_PAGE

$ADMIN_PAGE

key names for post meta

$POST_MESS

$POST_MESS

$POST_SKIP

$POST_SKIP

$POST_DONE

$POST_DONE

$USER_AUTH

$USER_AUTH

$USER_OPT

$USER_OPT

$PENDING

$PENDING

$POST_SERVICE_DONE

$POST_SERVICE_DONE

$default_prefix

$default_prefix

default pieces of the message used in constructing the content pushed out to other social networks

$default_message

$default_message

$default_suffix

$default_suffix

$GLOBAL_CAP

$GLOBAL_CAP

What WP capability is require to create/delete global connections? All users with this cap can unglobalize all other global connections, and globalize any of their own Globalized connections cannot be unselected by users without this capability when publishing

Methods

__construct()

__construct()

Sets up the basics of Publicize

get_connection_id()

get_connection_id( $connection)

Functions to be implemented by the extended class (publicize-wpcom or publicize-jetpack)

Parameters

$connection

connect_url()

connect_url( $service_name)

Parameters

$service_name

disconnect_url()

disconnect_url( $service_name,  $id)

Parameters

$service_name
$id

get_connection_meta()

get_connection_meta( $connection)

Parameters

$connection

get_services()

get_services( $filter)

Parameters

$filter

get_connections()

get_connections( $service,  $_blog_id,  $_user_id)

Parameters

$service
$_blog_id
$_user_id

get_connection()

get_connection( $service,  $id,  $_blog_id,  $_user_id)

Parameters

$service
$id
$_blog_id
$_user_id

flag_post_for_publicize()

flag_post_for_publicize( $new_status,  $old_status,  $post)

Parameters

$new_status
$old_status
$post

test_connection()

test_connection( $service_name,  $connection)

Parameters

$service_name
$connection

get_profile_link()

get_profile_link( $service_name,  $c)

Returns an external URL to the connection's profile

Parameters

$service_name
$c

get_display_name()

get_display_name( $service_name,  $c)

Returns a display name for the connection

Parameters

$service_name
$c

get_service_label()

get_service_label( $service_name)

Parameters

$service_name

show_options_popup()

show_options_popup( $service_name,  $c)

Parameters

$service_name
$c

user_id()

user_id()

blog_id()

blog_id()

is_enabled()

is_enabled( $service,  $_blog_id,  $_user_id)

Returns true if a user has a connection to a particular service, false otherwise

Parameters

$service
$_blog_id
$_user_id

save_meta()

save_meta( $post_id,  $post)

Fires when a post is saved, checks conditions and saves state in postmeta so that it can be picked up later by @see ::publicize_post()

Parameters

$post_id
$post

post_type_is_publicizeable()

post_type_is_publicizeable(string $post_type)

Is a given post type Publicize-able?

Not every CPT lends itself to Publicize-ation. Allow CPTs to register by adding their CPT via the publicize_post_types array filter.

Parameters

string $post_type

The post type to check. $return bool True if the post type can be Publicized.

test_publicize_conns()

test_publicize_conns()

Runs tests on all the connections and returns the results to the caller