Jeśli skasuję całą funkcję z wp-content/plugins/buddypress/bp-core/bp-core-template.php i wkleję ją do functions.php szablonu to działa i mogę dowolnie modywikować parametry typu $length = 200 i nie muszę tego zmieniać za każdym razem gdy aktualizuję plugin. Wygląda na to że trzeba najpierw zdeaktywować bp_create_excerpt i z tego co się orientuję to służy to tego:
remove_action( $tag, $function_to_remove, $priority, $accepted_args );
http://codex.wordpress.org/Function_Reference/remove_actionTylko nie wiem jakich parametrów użyć żeby zdeaktywować poniższe funkcje
function bp_create_excerpt
( $text, $length = 200
, $options = array() ) { // Backward compatibility. The third argument used to be a boolean $filter_shortcodes
$filter_shortcodes_default = is_bool( $options ) ?
$options : true;
'ending' => __( ' ...', 'buddypress' ),
'exact' => false,
'html' => true,
'filter_shortcodes' => $filter_shortcodes_default
);
$r = wp_parse_args( $options, $defaults );
// Save the original text, to be passed along to the filter
$original_text = $text;
// Allow plugins to modify these values globally
$length = apply_filters( 'bp_excerpt_length', $length );
$ending = apply_filters( 'bp_excerpt_append_text', $ending );
// Remove shortcodes if necessary
if ( !empty( $filter_shortcodes ) ) $text = strip_shortcodes( $text );
// When $html is true, the excerpt should be created without including HTML tags in the
// excerpt length
// The text is short enough. No need to truncate
if ( mb_strlen
( preg_replace( '/<.*?>/', '', $text ) ) <= $length ) { return $text;
}
$totalLength = mb_strlen
( strip_tags( $ending ) ); $truncate = '';
// Find all the tags and put them in a stack for later use
preg_match_all( '/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER
); foreach ( $tags as $tag ) {
// Process tags that need to be closed
if ( !preg_match( '/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2
] ) ) { } else if ( preg_match('/<\/([\w]+)[^>]*>/s', $tag[0
], $closeTag ) ) { if ( $pos !== false ) {
}
}
}
$truncate .= $tag[1];
$contentLength = mb_strlen
( preg_replace( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3
] ) ); if ( $contentLength + $totalLength > $length ) {
$left = $length - $totalLength;
$entitiesLength = 0;
if ( preg_match_all( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3
], $entities, PREG_OFFSET_CAPTURE
) ) { foreach ( $entities[0] as $entity ) {
if ( $entity[1] + 1 - $entitiesLength <= $left ) {
$left--;
$entitiesLength += mb_strlen( $entity[0] );
} else {
break;
}
}
}
$truncate .= mb_substr( $tag[3], 0 , $left + $entitiesLength );
break;
} else {
$truncate .= $tag[3];
$totalLength += $contentLength;
}
if ( $totalLength >= $length ) {
break;
}
}
} else {
if ( mb_strlen( $text ) <= $length ) {
return $text;
} else {
$truncate = mb_substr( $text, 0, $length - mb_strlen( $ending ) );
}
}
// If $exact is false, we can't break on words
$spacepos = mb_strrpos( $truncate, ' ' );
if ( isset( $spacepos ) ) { if ( $html ) {
$bits = mb_substr( $truncate, $spacepos );
preg_match_all( '/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER
); if ( !empty( $droppedTags ) ) { foreach ( $droppedTags as $closingTag ) {
if ( !in_array( $closingTag[1
], $openTags ) ) { }
}
}
}
$truncate = mb_substr( $truncate, 0, $spacepos );
}
}
$truncate .= $ending;
if ( $html ) {
foreach ( $openTags as $tag ) {
$truncate .= '</' . $tag . '>';
}
}
return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options );
}
add_filter( 'bp_create_excerpt', 'stripslashes_deep' );
add_filter( 'bp_create_excerpt', 'force_balance_tags' );
function bp_core_set_avatar_constants() {
if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) ) define( 'BP_AVATAR_THUMB_WIDTH', 50
);
if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) ) define( 'BP_AVATAR_THUMB_HEIGHT', 50
);
if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) ) define( 'BP_AVATAR_FULL_WIDTH', 200
);
if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) ) define( 'BP_AVATAR_FULL_HEIGHT', 200
);
if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_WIDTH' ) ) define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 200
);
if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) { if ( !isset( $bp->site_options['fileupload_maxk'] ) ) { define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 120000
); // 5mb } else {
define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024
); }
}
if ( !defined( 'BP_AVATAR_DEFAULT' ) ) define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL
. 'bp-core/images/mystery-man.jpg' );
if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) ) define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL
. 'bp-core/images/mystery-man-50.jpg' ); }
add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 );
2. funkcję można usunąć dodając do functions.php:
remove_action
ale jak usunąć 1. funkcję to nie mam pojęcia