You should not have the ()
on the callback field.
You shouldn’t need the add_action
so remove
add_action('load_comments', 'custom_comments');
And try:
wp_list_comments('type=comment&callback=custom_comments');
Also, you should extract the $args
so they are available in your function:
function custom_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
//etc
http://codex.wordpress.org/Function_Reference/wp_list_comments
Related Posts:
- remove_action on after_setup_theme not working from child theme
- Remove Actions/Filters added via Anonymous Functions
- Trying to use add_action and do_action with parameters
- Check if post is being published for the first time, or is an already published post being updated
- How to use the do_action () with parameter
- Perform an action when post is updated/published
- WordPress Theme Update Action?
- Extract image from content and set it as the featured image
- Do WordPress’ cron’s clean up expired transients?
- Remove Comments Metabox but still allow comments
- add_action in a function, is it possible?
- Using a private method as an action callback from within a class
- Refresh page after form action
- How to restrict actions and filters “properly” by conditions
- How to count number of functions attached to an action hook?
- Add action hook conditionally – only when home.php in use
- Using add_filter() in Widgets
- How can I remove the title “leave a reply” in the comment box in twentyeleven?
- How can I tell if I’m on a login page? [duplicate]
- change the comment time output to: X time ago instead of actual date and time
- How to get comments with mixed status using get_comments?
- How to prevent deleting of comments when deleting a post
- Change meta tags programatically
- Convert hyphen to underscore in permalinks
- Using get_terms for custom taxonomy in functions.php
- disable comments if array exists
- Fatal error: Call to undefined function add_action() – an untouched problem
- How to hook into the quick edit action?
- Remove “says” from comments
- Reuse variable in hook callback
- Display the number of user comments
- How do I find the code executed when wp_head() is called?
- template_redirect action only firing if logged in
- WordPress comment_form() does not display actual comments
- WordPress comment processing . Default unapproved comments detection before posting
- How to use wp_enqueue_script properly?
- How do I change where “You must be logged in to comment” directs users?
- How do I make the comment disappear after deleting from the database?
- Using get_terms for custom taxonomy in functions.php
- Issue passing action class to nested function. Admin Columns
- Does hook have an effect on increasing the page load?
- How to Override Page Template if URL matches query?
- Save_post – Warning: Cannot modify header information
- What is the earliest Hook a Script can use?
- How do I trigger WP CLI DB export using a PHP function?
- If has action not working as expected
- Modifying a WordPress Plugin
- post value to function with Ajax and jQuery
- Is_Page doesnt detect my page
- How do you insert code into the sidebar?
- How Do I Unhook This Parent Theme Function?
- Remove nofollow from internal comment links via functions.php
- How to show only specific category post by user role without plugin and restrict all other cats
- How can I automatically delete comments that contain a URL?
- Postback redirect through add_action is not triggered
- Warning and fatal error
- use add_action in a shortcode (gravity form – WordPress)
- wp_footer hook causing text to show on bottom of page
- Remove action hook from Class, understanding OOP
- How to change form action of wp-login page with a function
- Comment function for page
- How to identify author in wordpress comments?
- Which method is more correct for removing WooCommerce Extensions menu item?
- WordPress hooks to call a function inside a construct
- True parameter but jquery register in header and not in the footer with wp_register_script
- Fatal error: Call to undefined function add_action() – an untouched problem
- Sending Messages Back to the Template After Processing?
- How can I return the result of my custom function?
- Newest comments first not working
- Pass arguments to function class with do_action()
- previous_post_link inside of a function?
- get_comments not working properly after WordPress v4.4 update
- custom COOKIE on custom page
- What add_action reference should I be using or should I use do_action?
- Settings in functions.php used by a plugin
- Increase Comment Author Gravatar Size On WordPress Default Comment Function
- Custom Nested WordPress Comments with avatar
- Undo a function that is not (seemingly) hooked to an action?
- function to return comma separated list of meta values
- Comment Function
- WP Custom Comment Callback Not Responding
- How to remove “login to reply” from individual comments [duplicate]
- Do something when user creates post (that’s pending)
- add variable to actions/functions across different files (woocommerce)
- Getting full code of wp_list_comments instead of replacing it
- Comment turned Invisible
- User’s Comments Number: Storing it in a meta field for different uses
- HELP: Code To Check Status And Write Debug Entry
- delete_term is not working properly with add_action()
- Add functionality to block comment authors in the Comment edit pag
- How to get variable from other function inside class function using add_action for Ajax call
- Function attached to cron job not running but will run if called manually
- comments_template() doesn’t work with ajax call
- Submit CF7 form programmatically with WP-Cron?
- How to use: WP_AJAX_GET_COMMENTS
- disable a specefic sidebar when user is log out
- wp_update_post breaks my function
- WP backend, Show only own comments (give to users who wrote/published/assigned) posts
- is there a list of actions on WordPress
- Remove Actions/Filters added via Anonymous Functions