Title: Missing filters
Last modified: December 8, 2021

---

# Missing filters

 *  [Jonas Lundman](https://wordpress.org/support/users/jonas-lundman/)
 * (@jonas-lundman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/missing-filters-3/)
 * Thanks for a very useful plugin – working as a charm in all kind of installs,
   by many clients. However, we been missing some filters for a while and would 
   like to request following.
 * The pinterest output is hard to control. We manage to walk around the lack of
   description filter, by filter the post meta to belive there is a populated meta
   for the post. But still, the size of the image cant be filtered, and replacing
   the url is messy as the attachement_id is commonly delivered by those statements:
 * `$pinterest_img = $this->pinterest_image() ? $this->pinterest_image() : $this-
   >attributes['image'];`
 * Where-ever the attributes[‘image’] or pinterest_image() are populated, we would
   like a filter.
 * This filter is found:
 * `return apply_filters( 'scriptlesssocialsharing_image_url', isset( $source[0])?
   $source[0] : '' );`
 * Not so useful. We need a filter for the image size before there. And as $id not
   provided, we must track the image all over again to change the url (if has thumbnail…
   get_the_ID…attachment_id…get..)
 * Same for the pinterest own description, a final filter (with all args provided)
   would be nice:
 *     ```
              /**
       	 * Get the description for Pinterest.
       	 *
       	 * @since 2.2.0
       	 *
       	 * @return string
       	 */
       	protected function get_pinterest_description() {
       		$pinterest_alt = get_post_meta( get_the_ID(), '_scriptlesssocialsharing_description', true );
       		if ( $pinterest_alt ) {
       			return $pinterest_alt;
       		}
       		$pinterest_img = $this->pinterest_image() ? $this->pinterest_image() : $this->attributes['image'];
       		$pinterest_alt = get_post_meta( $pinterest_img, '_wp_attachment_image_alt', true );
   
       		return $pinterest_alt ? $pinterest_alt : $this->attributes['title'];
       	}
       ```
   
 * In this case we would prefer:
 *     ```
       $description = $pinterest_alt ? $pinterest_alt : $this->attributes['title'];
       $attachment_id = $this->pinterest_image() ? $this->pinterest_image() : $this->attributes['image'];
   
       return apply_filters('scriptlesssocialsharing_pinterest_description', $description, $attachment_id, $pinterest_alt, $this->attributes['title']);
       ```
   
 * Thanks – and cheers for all good work!
    -  This topic was modified 4 years, 6 months ago by [Jonas Lundman](https://wordpress.org/support/users/jonas-lundman/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Robin Cornett](https://wordpress.org/support/users/littlerchicken/)
 * (@littlerchicken)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/missing-filters-3/#post-15153950)
 * Hi Jonas!
 * There is an earlier filter to change the Pinterest image size which may be what
   you want:
 *     ```
       apply_filters( 'scriptlesssocialsharing_pinterest_image_size', 'large' )
       ```
   
 * You can update that to use any registered image size name. I’ll look into adding
   parameters to the image URL filter–you are right, that would be a lot more helpful!
 * If you want to modify the Pinterest description in the final button output, you
   can use the existing `scriptlesssocialsharing_pinterest_query_args` filter and
   modify the `description` in the array, but I agree, having a filter in that method
   would be helpful–I’ll look into adding that as well.
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/jonas-lundman/)
 * (@jonas-lundman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/missing-filters-3/#post-15154983)
 * Hi and thanks for the answer.
 * That filter seems only to affect the “hidden” pinterest at the end of the content
   of using manual inserted in edit post box.
 * We need to filter the button url.
 * Thanks
 *  Plugin Author [Robin Cornett](https://wordpress.org/support/users/littlerchicken/)
 * (@littlerchicken)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/missing-filters-3/#post-15156281)
 * Ah, I see. I think it would be reasonable to apply the same image filter there,
   so I can make that change.
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/jonas-lundman/)
 * (@jonas-lundman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/missing-filters-3/#post-15157406)
 * Hi and thanks again for your time. The filter would be great, also consider to
   pass the calculated id as argument in the mentioned filter, so we know the image
   we are dealing with, “unique” for that post (saved in post edit meta box) or 
   the featured image found and propably in the `$this->attributes['image']`
 * Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Missing filters’ is closed to new replies.

 * ![](https://ps.w.org/scriptless-social-sharing/assets/icon-256x256.jpg?rev=1361689)
 * [Scriptless Social Sharing](https://wordpress.org/plugins/scriptless-social-sharing/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/scriptless-social-sharing/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/scriptless-social-sharing/)
 * [Active Topics](https://wordpress.org/support/plugin/scriptless-social-sharing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/scriptless-social-sharing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/scriptless-social-sharing/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jonas Lundman](https://wordpress.org/support/users/jonas-lundman/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/missing-filters-3/#post-15157406)
 * Status: not a support question