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

PRESS10-42 Fix/transients filters #109

Merged
merged 11 commits into from
Dec 5, 2024
Merged

Conversation

BrianHenryIE
Copy link
Contributor

Proposed changes

https://jira.newfold.com/browse/PRESS10-42

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@BrianHenryIE BrianHenryIE marked this pull request as ready for review November 15, 2024 19:53
@BrianHenryIE BrianHenryIE marked this pull request as draft November 15, 2024 19:53
GiuseppeArcifa
GiuseppeArcifa previously approved these changes Nov 20, 2024
Copy link
Contributor

@GiuseppeArcifa GiuseppeArcifa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the filters and actions used in the WP Transient have been reproduced in the Transient.php class, I just added few things to make sure PHPCS was applied.

@BrianHenryIE BrianHenryIE marked this pull request as ready for review November 20, 2024 16:40
Copy link

@fralicandro fralicandro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any reasons why the delete transient method (includes/Helpers/Transient.php:109) has no WP actions?
I think it should be something like:

public static function delete( $key ): bool {
	if ( self::should_use_transients() ) {
		return \delete_transient( $key );
	}

	do_action( "delete_transient_{$key}", $key );

	if ( \delete_option( $key ) ) {
		do_action( 'deleted_transient', $key );

		return true;
	}
	
	return false;
}

@BrianHenryIE BrianHenryIE removed the request for review from GiuseppeArcifa December 3, 2024 18:24
Copy link
Member

@wpscholar wpscholar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GiuseppeArcifa - I left a comment. However, we should also review the comment by @fralicandro regarding the delete function also needing some filters.

@GiuseppeArcifa GiuseppeArcifa merged commit 40bc054 into main Dec 5, 2024
13 checks passed
@wpscholar wpscholar deleted the fix/transients-filters branch December 5, 2024 16:04
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

Successfully merging this pull request may close these issues.

5 participants