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

force_user_connection()

force_user_connection()

admin_page_warning()

admin_page_warning()

get_connections()

get_connections( $service,  $_blog_id,  $_user_id)

Parameters

$service
$_blog_id
$_user_id

get_connection_id()

get_connection_id( $connection)

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

Parameters

$connection

get_connection_meta()

get_connection_meta( $connection)

Parameters

$connection

admin_page_load()

admin_page_load()

display_connection_error()

display_connection_error()

display_disconnected()

display_disconnected()

globalization()

globalization()

api_url()

api_url( $service,  $params)

Parameters

$service
$params

connect_url()

connect_url( $service_name)

Parameters

$service_name

refresh_url()

refresh_url( $service_name)

Parameters

$service_name

disconnect_url()

disconnect_url( $service_name,  $id)

Parameters

$service_name
$id

get_services()

get_services( $filter)

Parameters

$filter

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

save_publicized()

save_publicized( $new_status,  $old_status,  $post)

Save a flag locally to indicate that this post has already been Publicized via the selected connections.

Parameters

$new_status
$old_status
$post

options_page_facebook()

options_page_facebook()

Options Code

options_save_facebook()

options_save_facebook()

options_page_tumblr()

options_page_tumblr()

get_basehostname()

get_basehostname( $url)

Parameters

$url

options_save_tumblr()

options_save_tumblr()

options_page_twitter()

options_page_twitter()

options_page_linkedin()

options_page_linkedin()

options_page_path()

options_page_path()

options_page_google_plus()

options_page_google_plus()

options_save_twitter()

options_save_twitter()

options_save_linkedin()

options_save_linkedin()

options_save_path()

options_save_path()

options_save_google_plus()

options_save_google_plus()

options_save_other()

options_save_other( $service_name)

Parameters

$service_name

publicize_checkbox_default()

publicize_checkbox_default( $checked,  $post_id,  $name,  $connection)

Already-published posts should not be Publicized by default. This filter sets checked to false if a post has already been published.

Parameters

$checked
$post_id
$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