/** * Share_Push7 constructor. * * @param $id * @param array $settings * @since 0.0.1-dev */ public function __construct($id, array $settings) { parent::__construct($id, $settings); if ('official' == $this->button_style) { $this->smart = true; } else { $this->smart = false; } }
function process_request($post, array $post_data) { $url = add_query_arg(array('utm_source' => 'jetpack-sharing', 'utm_medium' => 'whatsapp', 'utm_campaign' => 'mobile'), $this->get_share_url($post->ID)); $params = array('text' => __('Look at this', 'jetpack-whatsapp') . ': ' . $this->get_share_title($post->ID) . ' - ' . $url); $whatsapp_url = 'whatsapp://send?' . http_build_query($params); // Record stats parent::process_request($post, $post_data); // Redirect to WhatsApp wp_redirect($whatsapp_url); die; }
public function process_request($post, array $post_data) { $skype_url = sprintf('https://web.skype.com/share?url=%1$s&lang=%2$s=&source=jetpack', rawurlencode($this->get_share_url($post->ID)), 'en-US'); // Record stats parent::process_request($post, $post_data); // Redirect to Skype wp_redirect($skype_url); die; }
public function set_service($id, Sharing_Source $service) { // Update the options for this service $options = get_option('sharing-options'); // No options yet if (!is_array($options)) { $options = array(); } /** * Get the state of a sharing button. * * @module sharedaddy * * @since 1.1.0 * * @param array $args { * State of a sharing button. * * @type string $id Service ID. * @type array $options Array of all sharing options. * @type array $service Details about a service. * } */ do_action('sharing_get_button_state', array('id' => $id, 'options' => $options, 'service' => $service)); $options[$id] = $service->get_options(); update_option('sharing-options', array_filter($options)); }
public function set_service($id, Sharing_Source $service) { // Update the options for this service $options = get_option('sharing-options'); // No options yet if (!is_array($options)) { $options = array(); } do_action('sharing_get_button_state', array('id' => $id, 'options' => $options, 'service' => $service)); $options[$id] = $service->get_options(); update_option('sharing-options', array_filter($options)); }
public function process_request($post, array $post_data) { // Record stats parent::process_request($post, $post_data); $pocket_url = esc_url_raw('https://getpocket.com/save/?url=' . rawurlencode($this->get_share_url($post->ID)) . '&title=' . rawurlencode($this->get_share_title($post->ID))); wp_redirect($pocket_url); exit; }
public function process_request($post, array $post_data) { $pinterest_url = esc_url_raw('http://pinterest.com/pin/create/button/?url=' . rawurlencode($this->get_share_url($post->ID)) . '&description=' . rawurlencode($post->post_title) . '&media=' . rawurlencode(esc_url_raw($this->get_post_image($post->post_content)))); // Record stats parent::process_request($post, $post_data); // Redirect to Pinterest wp_redirect($pinterest_url); die; }
public function process_request($post, array $post_data) { if (isset($post_data['state'])) { $this->state = $post_data['state']; } // Record stats parent::process_request($post, $post_data); die; }
public function process_request( $post, array $post_data ) { // Record stats parent::process_request( $post, $post_data ); // If we're triggering the multi-select panel, then we don't need to redirect to Pinterest if ( !isset( $_GET['js_only'] ) ) { $pinterest_url = esc_url_raw( 'http://pinterest.com/pin/create/button/?url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&description=' . rawurlencode( $post->post_title ) . '&media=' . rawurlencode( esc_url_raw( $this->get_post_image( $post ) ) ) ); wp_redirect( $pinterest_url ); } else { echo '// share count bumped'; } die(); }
public function process_request($post, array $post_data) { global $current_user; $blogs = get_blogs_of_user($current_user->ID); if (empty($blogs)) { wp_redirect(get_permalink($post->ID)); die; } $blog = current($blogs); $url = $blog->siteurl . '/wp-admin/press-this.php?u=' . urlencode(apply_filters('sharing_permalink', get_permalink($post->ID), $post->ID, $this->id)) . '&t=' . urlencode($post->post_title) . '&v=4'; if (isset($_GET['sel'])) { $url .= '&s=' . urlencode($_GET['sel']); } // Record stats parent::process_request($post, $post_data); // Redirect to Press This wp_redirect($url); die; }