Title: Feature: Update filter
Last modified: August 21, 2016

---

# Feature: Update filter

 *  Resolved [Justin Frydman](https://wordpress.org/support/users/defunctlife/)
 * (@defunctlife)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/feature-update-filter/)
 * I am trying to filter the content to add a direct edit link to users who can 
   edit the text block (similar to how tablepress does it) but there isn’t a proper
   hook that includes the id.
 * I updated your function to include an updated filter so it would now be possible.
   It would be awesome if you added it to the core.
 *     ```
       // SHOW TEXT BLOCK
       function show_text_block($id, $plain = false)
       {
       	// IF ID IS NOT NUMERIC CHECK FOR SLUG
       	if(!is_numeric($id))
       	{
       		$page = get_page_by_path( $id, null, 'text-blocks' );
       		$id = $page->ID;
       	}
   
       	if( !$id ) return false;
   
       	if($plain)
       	{
       		return apply_filters( 'text_blocks_shortcode_html', get_post_field('post_content', $id), $id);
       	}
   
       	$content = apply_filters( 'the_content', get_post_field('post_content', $id) );
       	return apply_filters( 'text_blocks_shortcode_html', $content, $id);
       }
       ```
   
 * [https://wordpress.org/plugins/reusable-text-blocks/](https://wordpress.org/plugins/reusable-text-blocks/)

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

 *  Plugin Author [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * (@halgatewood)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/feature-update-filter/#post-4765986)
 * I will do so soon. Thanks for the idea!
 *  Plugin Author [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * (@halgatewood)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/feature-update-filter/#post-4766018)
 * Can you post your version? This looks like the one that is currently there. Unless
   I just don’t see what you did.
 *  Thread Starter [Justin Frydman](https://wordpress.org/support/users/defunctlife/)
 * (@defunctlife)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/feature-update-filter/#post-4766141)
 * Hi,
 * Sorry for the REALLY late reply!
 * The update would be to line 299 in the current version of the plugin:
 * From: `return apply_filters( 'text_blocks_shortcode_html', $content, $atts );`
 * To: `return apply_filters( 'text_blocks_shortcode_html', $content, $atts, $id);`
 * Adding $id to the filter allows me to create an edit post link based on the post
   id of the text block.
 * Thanks!
 *  Plugin Author [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * (@halgatewood)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/feature-update-filter/#post-4766142)
 * Great addition. Just got it added to 1.4.7.
 * Thanks!

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

The topic ‘Feature: Update filter’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/reusable-text-blocks_53c8f2.svg)
 * [Reusable Text Blocks](https://wordpress.org/plugins/reusable-text-blocks/)
 * [Support Threads](https://wordpress.org/support/plugin/reusable-text-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/reusable-text-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reusable-text-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reusable-text-blocks/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/feature-update-filter/#post-4766142)
 * Status: resolved