You are missing 2 parameters in your function report_spam
. Also the priority should not be 1. Try the code below.
add_action('transition_comment_status', 'report_spam', 10, 3);
function report_spam($new_status, $old_status, $comment){
if($new_status == 'spam'){
var_dump($comment->comment_author_IP);
die;
}
}
I’ve set die
so that you can check and manipulate what you want.
Related Posts:
- Comment `Reply` link doesn’t work if comments are loaded from ajax
- Show comments fields in two columns
- how to load the comment template from a plugin
- Removing the “Website” Field from Comments and Replies?
- Writing a plugin that notify my friends of new post that mentions(@) them
- Check spam in custom form – akismet
- Why are two functions over-riding each other?
- comment_email hook doesn’t seem to work for comment editor field
- preprocess_comment array doesn’t have comment_ID
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- Can wp_list_comments output into variable?
- Comments do not respect display_name setting, how to make plugin to overcome this
- $reverse_top_level works the opposite way according to Codex?
- Saving value of a selection option in comment form as comment meta
- How to integrate CLEditor to comment system?
- Add a default WP comment form to forum template
- Get attachments from a post
- is pre_get_comments not working?
- How to replace default comments with custom HTML?
- Custom avatars in wordpress comments?
- How to get the number of pages when paginating comments?
- How does “Your comment is awaiting moderation” work?
- Add a Custom Field in Comment Box next to the Text area
- how to get the top 10 popular blogs
- disable defaault wordpress comments from a plugin
- WordPress comment processing . Default unapproved comments detection before posting
- How to show comments from different Plugins to same post type?
- How to check if `comment_meta` exists before inserting the comment?
- How to get the `comment_post_ID`?
- Email content as comment
- Stop theme displaying comments
- isset($_POST[‘submit’]) ignored on comment submission
- How to hide and disable URL and email fields from comments?
- How to remove website url field from comment form completely?
- Remove Permalink Meta Box not working?
- How do i remove the title from a specific page
- Can / should a widget plugin define its own Widget Area?
- WordPress actions for plugin admin UI page
- How to get changed post title in my custom plug-in which fires when ‘save_post’ is called?
- wp_insert_user keeps echoing values
- Rewriting Image URLs from dynamic to original
- Getting posts by taxonomy
- WordPress templating system for custom plugins
- Lead form that submits to 2 external APIs
- Creating open content area and restricted content area
- How do I duplicate a single post, with all its properties, and save it as a different post?
- Remove Meta-boxes (Yoast SEO plugin) [duplicate]
- Can I use a custom post type as a custom taxonomy for a different custom post type?
- custom comment_form fields not displaying
- WooCommerce currency converter support [closed]
- Woocommerce – looping product images
- How Can I Add Code To A Preexisting Function Without Editing it
- JQuery Slider – Similar to www.internetmarketinginc.com [closed]
- Changing permalink structure breaks link to .php file which generates files dynamically
- Is there an action_filter hook to add content before the post title?
- CSS not being applied using wp_enqueue_style
- wp_enqueue_scripts in a plugin’s class
- Is there a way to add a link with add_post_meta?
- Proper way to create an administration page without adding it to the menu
- WordPress Plugin Authoring question about jquery and css
- How to output CSS to the beginning of the stylesheet in a WordPress Plugin
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Adding Permalink to Slides with ‘Simple Nivo Slider’ plugin?
- Loading Images from Javascript on the Front End
- How to add a new taxonomy link to the admin menu
- Many Single Sites, One Plugin directory – adjust plugins_url()
- insufficient permissions; coding an action for plugin governed by custom capability
- wp_insert_post generated mixed permalinks
- Adjust query on single
- How to call function from another plugin?
- Get coordinates of selected area to use in image maps [closed]
- Plugin won’t activate
- Adding tables to dashboard pages programmatically?
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- How to exclude categories from get_categories() select list inside a widget admin panel
- Setting a post’s category
- Plugin access to average users not only admin
- Setting post_id for single.php based on URL without a redirect
- Why doesn’t update_post_meta work for certain strings?
- WP 3.3 makes it possible to add meta box to Category Editor Screen?
- How to automatically activate a plugin on install
- How to add captcha to publish widget
- using admin functions on frontend
- Widget internal hooks and functions
- Javascript Function Called Too Early in PHP Script
- Pause plugin option page until all data manipulation is complete
- How to display TinyMCE HTML view?
- WordPress plugin advice: suggestions for writing a plugin the correct way
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Why doesn’t my Table get created?
- Modify code for functions.php with specific twitter user url and hashtags
- Need Help Determining Where Header Error is Happening
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- can members have multiple registration using the same password?
- Extract Information from post content (using regex?)
- Using jQuery prepend() with file include
- post content and shortcode content displaying out of order
- rewrite_rules problem
- Is it possible to have instead mypage.com/?page_id=81 to have mypage.com/cool/?
- User Data Handling between two plugins