$comment_id can be passed as second parameter to your function.
Modify you add_filter:
add_filter('comment_notification_text', 'myfunction', 10, 2);
Then get $comment and $post from $comment_id:
function myfunction( $notify_message, $comment_id ) {
$comment = get_comment( $comment_id );
$post = get_post($comment->comment_post_ID);
Related Posts:
- Enabling Sessions in WordPress 3.0
- How to let a single post have its own domain name
- simple wp_insert_post example
- Best way to pass arguments to another page in WordPress
- Set user loggin status?
- How to remove tag cloud from taxonomy admin edit page?
- Access post meta in future_to_publish function
- Author Tracking Code!
- Problem with custom function from jQuery slider tutorial
- Different profile page by role
- Add array of post id’s to a category?
- Where are Additional CSS files stored
- How to use more than 256MB of memory in the admin?
- Localization: I want the backend: english and frontend in defined language
- How to get current_cat in navbar, in single post
- wordpress custom walker for thumbnails with custom menu
- Change comments form title on a page by page basis
- Adding an email column to a Custom Post Types Admin Screen?
- Selecting An image from the Media LIbrary on the frontend
- WordPress audio player has two different styles
- Allow Users to Set Password During Registration
- WordPress 3.1 removing ‘category’ from the slug
- Why does WordPress 3.0.4 keep deleting the contents of the .htaccess file?
- How do you output custom code between posts in the loop?
- Add new Control to Customizer to modify Headings (h1, h2, h3…) Color
- Is there a filter hook that I can use to change how taxonomy term names are displayed?
- Custom Theme Blog page not showing Posts
- Gutenberg Blocks – Attributes from comment delimiter or from HTML?
- How to change URL Custom Page?
- How to Add a Random Custom Gravatar in the WordPress Comments?
- Comments not nesed with custom template
- How to mass-delete inline styles in WordPress custom post type automatically?
- Limiting allowed html elements/strip harmful scripts from editor
- PHP can I add line numbers to file_get_contents()
- Customizing default Mediaelement player
- How do I fix unexpected redirection of visitors after enabling multisite on WP3?
- Add more then one site logo – custom-logo theme support
- Send a custom WooCommerce email when custom order change [closed]
- Can not sanitize select control in customize api
- Putting tag outside tag on generated Menu
- Advanced Custom Fields: Sorting custom columns with custom fields sorts only by date
- Custom static page get_header error
- Multiple RSS feeds scroller in one sidebar
- How to encode author ID in the author permalink
- Oxygen builder custom Elements
- how do I remove the shipping from woocommerce thankyou page and from the email
- redirect post id to post full url
- Silo Structure; Will links from home page to a Sub-category or Post undermine silo seo advantage? [closed]
- Manage multiple domains from one backend
- Static admin page for all multisite users
- Using custom image resizing script in a page
- How can I create a permalink with two categories, with the order based on the parent category?
- How do I add a promotional message to my posts?
- Customize option – add two image uploader under same section
- Toggle custom fields?
- Simplify the admin end
- Creating a shortcode by pulling in a custom field from a plugin
- Divi: how to hide/show specific menu according current page?
- “woocommerce_form_field()” function having issues after latest woocommerce update [closed]
- Hide Customizer’s Widget Choices From The List
- Custom Post Types database persistance. Why not?
- Edit specific text on a static page
- Customise the Category Widget
- How to add icon over specific thumb
- Showing Meta Box via Jquery Checkbox
- custom user meta query
- Help on conditional statement to accompany wp_insert_post function please?
- Create new network instance, import old single installs AND keep the urls?
- Any Good WordPress Client Like Live Writer To Create Static Pages
- WordPress homepage hangs in IE browsers
- Don’t update modify time post on Quick Edit
- Header menu aligned right on all pages except for single-post page [closed]
- Style WooCommerce Product Search Widget
- Avoid showing the same phrase in the loops
- Problems with setting up a subdomain to serve images and scripts
- Why does a custom php code inside a custom template not get executed?
- Disable “-mp4-image” screenshots from appearing in Media?
- wordpress custom posts page not showing
- Wrap WordPress Login Form in custom Div
- Automatically reject a comment if website field contains anything
- Custom permalink structure for posts in certain categories
- Replace publish date in blog module with custom field
- Need help with drop down list on the profile
- Hosing a website within a WordPress directory/folder
- Adding A New Widget to WordPress Disables the Existing Widgets
- Custom Single Template
- how to auto fille conatct form 7 when user is logined
- Creating WordPress staging environment software
- How to add H1 Tag on Homepage?
- Use another theme template in my theme
- Display popular posts by how many hits it got within 30 days of publishing
- How to make my wordpress site responds for 2 domains
- User registration add user ID?
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- Can’t Auto-Update, but permissions are good?
- How to answer, and we aren’t using WordPress to manage your site? [closed]
- WooCommerce customise checkout billing form [closed]
- Is there a way to have information on one page automatically feed into another? [closed]
- How to Add Extra Text In WordPress Title Before Post Publish
- Problem with removing characters “<” – WpAllImport