-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds monitoring for acf option pages and introduces Utils class for helpers. * formatting * more formatting * check if acf_get_options_pages is returning an array Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com>
- Loading branch information
1 parent
45a9e0c
commit 0bcf795
Showing
2 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace WPGatsby\Utils; | ||
|
||
class Utils { | ||
|
||
/** | ||
* Checks if any of the strings in $substr_array is a substring in the $haystack. | ||
* | ||
* @since 2.1.2 | ||
* | ||
* @param string $haystack | ||
* @param array $substr_array | ||
* @param int $offset | ||
* | ||
* @return bool | ||
*/ | ||
public static function str_in_substr_array(string $haystack, array $substr_array, int $offset = 0): bool { | ||
foreach ( $substr_array as $substr ) { | ||
if ($substr && strpos($haystack, $substr, $offset) !== false ) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
} |