Admin filter/error if post title is too long

The key thing I think you’re missing is understanding that WordPress doesn’t use a linear path for saving posts. Because posts are autosaved you’ll want to handle this in a way that defines it according to it’s publish status rather than it’s save state. Basically, instead of trying to truncate or adjust the title, do … Read more

Filter on widget-title does not work with custom links

The “Links” widget uses wp_list_bookmarks, which outputs a nested list similar to: <li> <h2>[category]</h2> <ul class=”xoxo blogroll”> [links] </ul> </li> You can override [category] using the link_category filter: function wpse_147543_link_category( $title ) { $title=”title”; return $title; } add_filter( ‘link_category’, ‘wpse_147543_link_category’ );

How to add a class to Buddypress avatars in the Activity stream? [closed]

When calling bp_loggedin_user_avatar(), you can set the ‘html’ attribute to false and it will return just the URL of the avatar (instead of the full HTML). Then you can style it how you want. Something like: $avatar_url = bp_loggedin_user_avatar( ‘html=false’ ); echo ‘<img class=”media-object” src=”https://wordpress.stackexchange.com/questions/157817/. $avatar_url .” width=”‘ . bp_core_avatar_thumb_width() . ‘” height=”‘ . bp_core_avatar_thumb_height() … Read more