Skip to content

Instantly share code, notes, and snippets.

@n7studios
Last active June 17, 2019 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n7studios/cefdf12f38abe8f854341c84c907e2b5 to your computer and use it in GitHub Desktop.
Save n7studios/cefdf12f38abe8f854341c84c907e2b5 to your computer and use it in GitHub Desktop.
WordPress to Buffer: Modify Excerpt in Status
<?php
/**
* Plugin Name: WP to Buffer: Modify Excerpt in Status
* Plugin URI: http://www.wpzinc.com/
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Modify the {excerpt} output, immediately before it is sent to Buffer.
*/
/**
* Modifies the Post Excerpt generated from using the {excerpt} status tag,
* immediately before the status is sent to Buffer.
*
* @since 0.0.1
*
* @param string $excerpt Post Excerpt
* @param WP_Post $post WordPress Post
* @return string Post Excerpt
*/
function wp_to_buffer_publish_modify_excerpt( $excerpt, $post ) {
// Return full excerpt
return $post->post_excerpt;
}
// Filter for Free version of Plugin
add_filter( 'wp_to_buffer_publish_get_excerpt', 'wp_to_buffer_publish_modify_excerpt', 10, 2 );
// Filter for Pro version of Plugin
add_filter( 'wp_to_buffer_pro_publish_get_excerpt', 'wp_to_buffer_publish_modify_excerpt', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment