• Resolved chinaraj

    (@chinaraj)


    I’m filter the arguments for the wp_list_pages function that the widget uses but when I add a walker argument, nothing happens.

    My filter function:

    function cxc_ccchildpages_widget_pages_args($args) {
      $args['link_after'] = '</div>';
      $args['link_before'] = '<div>';
      $arg['walker'] = new Svg_Icon_Walker();
      return $args;
    }
    add_filter('ccchildpages_widget_pages_args', 'cxc_ccchildpages_widget_pages_args');

    When I var_dump args the walker item is not there.

    https://wordpress.org/plugins/cc-child-pages/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author caterhamcomputing

    (@caterhamcomputing)

    Hi.

    If the above is copied and pasted from your code, I think the problem lies with the line specifying the custom walker:

    $arg['walker'] = new Svg_Icon_Walker();

    should read

    $args['walker'] = new Svg_Icon_Walker();

    I’ve had a look at my code, and can see no other obvious reason for you experiencing problems.

    Please let me know if this fixes the problem …

    Thread Starter chinaraj

    (@chinaraj)

    Hi, thanks for getting back to me. I feel so silly now missing that typo.
    That must have been the problem. Guess I needed a second pair of eyes.
    Thanks again for taking the time to respond.

    Plugin Author caterhamcomputing

    (@caterhamcomputing)

    No problem … I’ve spent days chasing that kind of problem myself 🙂

    Glad that it is working OK for you …

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Walker for widget’ is closed to new replies.