Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WordPress to Buffer Pro: Change value of {url}
* Plugin Name: WP to Buffer Pro: Change URL
* Plugin URI:
* Version: 1.0.0
* Author: WP Zinc
* Author URI:
* Description: Changes the {url} from your Post's URL to something else. Change code in this Plugin as necessary to define the URL you want.
* Change the URL in the Status Message's Text, before it is sent to Buffer
* @since 1.0.0
* @param array $args Buffer Status Message Arguments
* @param WP_Post $post WordPress Post to share
* @param string $profile_id Buffer Profile ID
* @param string $service Social Media Service the Profile ID belongs to
* @param string $status Post Status (publish or update)
* @return array Buffer Status Message Arguments
function wp_to_buffer_pro_change_url( $args, $post, $profile_id, $service, $status ) {
// Define the URL you want to use instead
$new_url = '';
// Stop editing
// You shouldn't need to modify anything from here
$args['text'] = str_replace( get_bloginfo( 'url' ), $new_url, $args['text'] );
return $args;
add_filter( 'wp_to_buffer_pro_publish_build_args', 'wp_to_buffer_pro_change_url', 10, 5 );
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.