Beatles links in wordpress

I use the BitlyWordpress plugin and feature wp_get_shortlink(). On simple posts, it works fine, but in custom post types links are not converted, and when I share on Twitter, my link to link is similar to domain/?p=43432.

How can I solve my problem?

+3
source share
1 answer

This VIP plugin by default does not support post_typevalues ​​for the "post", but this convenient function should solve it for you:

/**
 * Add Bitly to CPT's
 */
function my_add_bitly_cpts( $post_types ) {
    $post_types[] = 'my_custom_post_type_name';
    return $post_types;
}
add_filter( 'bitly_post_types' , 'my_add_bitly_cpts' );
0
source

All Articles