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); }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Feature: Update filter’ is closed to new replies.