Ask pro wordpress giúp với nào

Hi cậu,

Chắc cậu có cài plugin BBCode cho site. Bạn chỉ cần thêm đoạn code này khi edit function shortcode_url() của plugin :

Code:
function shortcode_url( $atts = array(), $content = NULL ) {
$atts = $this->attributefix( $atts );
// [url="http://www.google.com/"]Google[/url]
if ( isset($atts[0]) ) {
$url = $atts[0];
$text = $content;
}
// [url]http://www.google.com/[/url]
else {
$url = $text = $content;
}
if ( empty($url) ) return '';
if ( empty($text) ) $text = $url;
 
//Thêm code ở đây ;D
 
$length = strlen($url)/3;
$text = substr($url, 0, $length)."...".substr($url,-$length);
 
return '<a href="' . $url . '">' . do_shortcode( $text ) . '</a>';
}

Site bạn là gì? Mình có thể trao đổi exchange link ko? :)
 
Ấy, cái đó là khi cậu post thì có thể copy và set được. Còn những bài posts của authors khác thì cái này nó làm cho mình.

Nhưng đó là khi link nằm giữa tag
 

Announcements

Forum statistics

Threads
421,058
Messages
7,104,904
Members
173,139
Latest member
cameraquansat1

Most viewed of week

Most discussed of week

Most viewed of week

Most discussed of week

Back
Top Bottom