1

This question already has an answer here:

I couldn't find a way to change this in an upgrade friendly way, and I know I mustn't touch the core!

I need to change the value 'number' to 10 in wp-includes/default-widgets.php

wp_tag_cloud( apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy, 'number' => 10) ) );

How can I do this without changing the core?

marked as duplicate by Johannes Pille, TheDeadMedic, birgire, mrwweb, gmazzap Sep 5 '14 at 12:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

As you see there is the apply_filters() call, with the $tag parameter, which is the name of the hook, set to widget_tag_cloud_args. As starting point for getting into hooks, filters and actions I'd suggest you read the codex page about the Plugin API. You can use the hook to change the arguments, e.g. like this:

add_filter( 'widget_tag_cloud_args', 'wspe160041_change_tag_cloud_number_arg' );
function wspe160041_change_tag_cloud_number_arg( $args ) {
    $args[ 'number' ] = 10;
    return $args;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.