Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.