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

Add a way to get the colophon back as a string, rather than echoing. #26

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

georgestephanis
Copy link
Contributor

This will remedy an issue where there can be fatal errors from nested output buffers with callbacks -- for example:

[01-Feb-2024 16:46:28 UTC] PHP Fatal error:  ob_start(): Cannot use output buffering in output buffering display handlers

As an added bonus, it lets us stop using output buffers in the shortcode version, and just ask for the string directly.

Alternate resolution to #25 -- enabling just calling the method directly, rather than filtering.

Changes proposed in this Pull Request

  • Less output buffering. More joy.

This will remedy an issue where there can be fatal errors from nested output buffers with callbacks -- for example:

```
[01-Feb-2024 16:46:28 UTC] PHP Fatal error:  ob_start(): Cannot use output buffering in output buffering display handlers
```

As an added bonus, it lets us stop using output buffers in the shortcode version, and just ask for the string directly.
Add fallback in case misconfigured and phpdoc for new param
@georgestephanis
Copy link
Contributor Author

georgestephanis commented Feb 1, 2024

Can be invoked safely directly instead of via action via

if ( function_exists( 'team51_credits' ) ) {
	$link = team51_credits(
		array(
			'return' => true
		)
	);
}

@Ninodevo
Copy link
Contributor

Ninodevo commented Feb 7, 2024

This will be useful, looks good! Only PHPCS fixes are required.

@mlaetitia
Copy link

@georgestephanis went ahead and fixed the pending linter issues . Also tested this on my test site and is working as expected. let me know if there's anything else i can do to move forward here :)

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.

3 participants