Skip to content

Commit 03535f5

Browse files
Add empty content checks to content filter functions
Added early return for empty content in wedevs_pm_get_content and wedevs_pm_filter_content_url to prevent unnecessary filter application and potential errors.
1 parent 4cfce95 commit 03535f5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

libs/functions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,12 +661,20 @@ function wedevs_pm_tb_prefix() {
661661
* @return string
662662
*/
663663
function wedevs_pm_get_content( $content ) {
664+
if (empty($content)) {
665+
return $content;
666+
}
667+
664668
$content = apply_filters( 'wedevs_pm_get_content', $content );
665669

666670
return $content;
667671
}
668672

669673
function wedevs_pm_filter_content_url( $content ) {
674+
if (empty($content)) {
675+
return $content;
676+
}
677+
670678
$content = apply_filters( 'wedevs_pm_get_content_url', $content );
671679

672680
return $content;

0 commit comments

Comments
 (0)