Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jquery event after submitting a new comment (when comments done loading) #12

Open
Pizza1 opened this issue Dec 14, 2024 · 3 comments
Open

Comments

@Pizza1
Copy link

Pizza1 commented Dec 14, 2024

Feature Request

What would you like to add or change in regards to Ajaxify Comments?

Wondering if there is a javascript event which fires after comments are refreshed (after submitting a new comment)

Describe any solutions you've considered

Help us by discussing any solutions or alternatives you've seen that relate to the feature request.

Looking through the files to find such hook

How important is this feature to you?

Please describe how you would use the feature on your site.

Need to add jQuery functionality to specific comments (this functionality gets removed after submitting a new comment, as submitting a new comment seems to refresh all comments)

Is your feature request related to a problem? Please describe.

Is this related to a bug or other issue? Please reference them here.

Screenshots or Videos

Add any screenshots or videos of the feature you'd like.

Additional context

Add any other context about the feature request here.

@Pizza1
Copy link
Author

Pizza1 commented Dec 15, 2024

So I'm trying to do

jQuery(document).on('wpacAfterPostComment', function() {alert("Hello"); });

But the event doesn't seem to fire

@Pizza1 Pizza1 changed the title Hook for when comments done loading (after submitting a new comment) Jquery event after submitting a new comment (when comments done loading) Dec 15, 2024
@Pizza1
Copy link
Author

Pizza1 commented Dec 15, 2024

WPACCallbacks.afterPostComment = "", so the condition doesn't equate to true
image

@Pizza1
Copy link
Author

Pizza1 commented Dec 15, 2024

Ok, so the workaround was

jQuery(document).ready(function(){
		WPACCallbacks.afterPostComment=true;
		WPACCallbacks.wpacAfterUpdateComments = true;

			
		});

setting those to something other than "";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant