Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Add a line break in Woocommerce Product Titles

add_filter( 'the_title', 'custom_product_title', 10, 2 );
function custom_product_title( $title, $post_id ){
    $post_type = get_post_field( 'post_type', $post_id, true ); 

    if( in_array( $post_type, array( 'product', 'product_variation') ) ) {
        $title = str_replace( '|', '<br/>', $title ); // we replace "|" by "<br>"
    }
    return $title;
}
Comment

PREVIOUS NEXT
Code Example
Php :: after jquery validation ajax call in php 
Php :: veue laravel remove #/ 
Php :: remove public laravel 
Php :: Laravel API ResourceCollection doesnt works 
Php :: laravel media library regenerate 
Php :: php to python converter online free 
Php :: many isset posts 
Php :: yoast seo alternative for laravel 
Php :: Add Recent Posts by Category Using PHP 
Php :: wordpress programmatically set acf taxonomy term 
Php :: php pesos en letras rutina 
Php :: php objects 
Php :: php json array push in js file 
Php :: Collapse all codes in PHP Storm IntelliJ 
Php :: laravel ffmpeg color filter effects 
Php :: delete request php-salesforce-rest-api 
Php :: search posts by post title in worpress 
Php :: laravel resourece type 
Php :: wordpress custom end point 
Php :: Multiple trait declaration in PHP 
Php :: push to aws instance ssh without using laravel 
Php :: gan_sql 
Php :: Yii2 Dynamic Relational, Lazy loading 
Php :: php artisan reset --force 
Php :: OR criteria 
Php :: $var = 1 / 2; in php 
Php :: ph form 
Php :: twig global 
Php :: Grab files matching particular file types in a directory 
Php :: drupal 7 hook_node_insert 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =