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?


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;
| improve this answer | |

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