• Resolved Tristan

    (@tristanmsg)


    I have the following shortcode,

    [ajax_load_more
      id="products_list"
      ...
      custom_args="rating:5"
    ]

    connected to the following filter in a code snippet.

    add_filter(
      'alm_query_args_products_list',
      'alm_do_stuff', 10, 2
    );
    
    function alm_do_stuff( $args, $id ) {
    
      if ( isset( $args['rating'] ) )
      {
        // do stuff
      }
    
      return $args;
    }
    
    

    The value of $args['rating'] in the filter code should be 5, but it’s undefined.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom argument not defined in ‘alm_query_args_{id}’ hook’ is closed to new replies.