Title: Example function for filters?
Last modified: August 21, 2016

---

# Example function for filters?

 *  Resolved [BK_@_UC](https://wordpress.org/support/users/bk_uc/)
 * (@bk_uc)
 * [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/)
 * Do you have a sample function to use in functions.php to modify the output for
   the filters?
 *     ```
       add_filter('bawmrp_thumb_size','hack_plugin_manual_related_posts');
       function hack_plugin_manual_related_posts(){
   
        //what should be here? should it return a variable? This requires an array in the core file.
   
       }
       ```
   
 *     ```
       add_filter( 'bawmrp_li_style', 'hack_bawmrp_li_style' );
       function hack_bawmrp_li_style(){
       	$style =  "max-height:10px;overflow:hidden;list-style:none;text-align:center;";
       }
       ```
   
 * How should these be used? Thanks much!
 * [https://wordpress.org/plugins/baw-manual-related-posts/](https://wordpress.org/plugins/baw-manual-related-posts/)

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

 *  Plugin Author [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/#post-4875641)
 * Hello
 *     ```
       add_filter('bawmrp_thumb_size','hack_plugin_manual_related_posts');
       function hack_plugin_manual_related_posts(){
   
         return array( '600', '300' ); // width x height 
   
       }
       ```
   
 *     ```
       add_filter( 'bawmrp_li_style', 'hack_bawmrp_li_style' );
       function hack_bawmrp_li_style(){
       	$style = "max-height:10px;overflow:hidden;list-style:none;text-align:center;"; // modify what you need
         return $style;
       }
       ```
   
 * In a next update (2.0) i will add a template engine 😉
 *  Thread Starter [BK_@_UC](https://wordpress.org/support/users/bk_uc/)
 * (@bk_uc)
 * [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/#post-4875693)
 * Great! Thanks so much.
 *  Thread Starter [BK_@_UC](https://wordpress.org/support/users/bk_uc/)
 * (@bk_uc)
 * [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/#post-4875697)
 * Hello, I would like to hire you to write a customized output function if you 
   are available.
 * I need this plugin to output a version of the featured image that uses a custom
   image size. Basically it would be the same url as the featured image, but with“-
   300×250” appended to the end but before the file extension.
 * before
    imagepath/imagename.png
 * after
    imagepath/imagename-300×250.png
 * Are you available? What would the cost be?
 * Thanks in advance!
 *  Plugin Author [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/#post-4875728)
 * hello
 *     ```
       i've got a hook for this logically
       add_filter('bawmrp_thumb_size','hack_plugin_manual_related_posts');
       function hack_plugin_manual_related_posts(){
   
       return( array( 300, 050 ) );
   
       }
       ```
   
 * test and feedback me
 *  Thread Starter [BK_@_UC](https://wordpress.org/support/users/bk_uc/)
 * (@bk_uc)
 * [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/#post-4875740)
 * Again, thanks for the personal attention!
 * I have tried a variety of things but not gotten the result I need. My sidebar
   has a ads that are 300×250 images and the site is responsive so they scale. Thus
   my Related Posts need to be images that are the same size so they stay in proportion
   with other sidebar elements.
 * To solve this I have created a custom image size in the Media uploader @ 300×
   250 so the large images are uploaded, then featured image and ad sizes are created
   as well with hard crop.
 * WordPress automatically appends “-300×250”:
    Birth_11_styleguide-002-300×250.
   jpg
 * I just need the post image with the “-300×250” appended to the path and no image
   sizes written into the tag and everything will fall into place.
 * `<img src="http://website.com/wp-content/uploads/2014/04/tpl-ad-300x250.png" 
   alt="Ad Space GR1">`
    ` I imagine the way to do this is to get into the get_the_post_thumbnail()
   core function, but if there is a way to do this with an existing plugin filter
   that would be more future proof.
 * Thanks for any thoughts.
 *  Plugin Author [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * (@juliobox)
 * [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/#post-4875751)
 * ok look the next major update will include a template engine, so you should set
   the output yourself, easily
    thanks for your patience

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

The topic ‘Example function for filters?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/baw-manual-related-posts_fefdfd.svg)
 * [Manual Related Posts](https://wordpress.org/plugins/baw-manual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/baw-manual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/baw-manual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/baw-manual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/baw-manual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/baw-manual-related-posts/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Julio Potier](https://wordpress.org/support/users/juliobox/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/example-function-for-filters/#post-4875751)
 * Status: resolved