public function setUp() { parent::setUp(); $this->publicize = publicize_init(); $this->fired_publicized_post = false; $this->publicized_post_id = null; $post_id = $this->factory->post->create(array('post_status' => 'draft')); $this->post = get_post($post_id); add_action('jetpack_publicize_post', array($this, 'publicized_post'), 10, 1); }
public function admin_setup() { if (!current_user_can('manage_options')) { return; } if (!is_admin() && !$this->is_customize_preview()) { return; } $this->publicize = publicize_init(); $publicize_services = $this->publicize->get_services('connected'); $this->services = array_intersect(array_keys($publicize_services), $this->theme_supported_services); add_action('publicize_connected', array($this, 'check_links'), 20); add_action('publicize_disconnected', array($this, 'check_links'), 20); add_action('customize_register', array($this, 'customize_register')); add_filter('sanitize_option_jetpack_options', array($this, 'sanitize_link')); }