Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('the_title', function ($post_title, $post_id) {
- $post = get_post($post_id);
- if ('product' == $post->post_type && !is_single($post_id) && !is_admin()) {
- $length = 22;
- $post_title = (mb_strlen($post_title) > $length) ? (mb_substr($post_title, 0, $length) . "...") : $post_title;
- }
- return $post_title;
- }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement