URL output Trim or Character Limit

This topic contains 2 replies, has 2 voices, and was last updated by  Timothy Sullivan 6 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #402792

    Timothy Sullivan
    Buyer
    Post count: 63

    HI, I recently added a function that displays the Social Media URLs as a URL instead of the word “Instagram”, “Twitter” etc.

    This is the function I added:

    add_filter( ‘geodir_custom_field_website_name’, ‘geodir_change_website_field_display_name’, 10, 3 );
    function geodir_change_website_field_display_name($name,$website,$post_id){
    if($name==’Twitter’ || $name==’Instagram’ || $name==’Website’){return $website ; }
    else{return $name;}
    }

    The function is working great, but I’m running into the issue of the URL length being too long and running out of the display box.

    Would there be a way to TRIM the $website variable output to remove the “http://www.”?

    OR

    impose a character limit to the entire URL display?

    Thank you!
    Timothy

    #402799

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    The default display is the word ‘website’to avoid this sort of problem.

    This would be considered a customization on top of a customization, and a perfect excuse to hire a developer.

    #402801

    Timothy Sullivan
    Buyer
    Post count: 63

    Got it. thank you

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket