str_contains( string $haystack, string $needle )
Polyfill for str_contains()
function added in PHP 8.0.
Description
Performs a case-sensitive check indicating if needle is contained in haystack.
Parameters
- $haystack
-
(Required) The string to search in.
- $needle
-
(Required) The substring to search for in the haystack.
Return
(bool) True if $needle
is in $haystack
, otherwise false.
Source
File: wp-includes/compat.php
function str_contains( $haystack, $needle ) {
return ( '' === $needle || false !== strpos( $haystack, $needle ) );
}
Related
Used By
Used By | Description |
---|---|
wp-admin/includes/theme.php: resume_theme() |
Tries to resume a single theme. |
wp-includes/https-detection.php: wp_is_local_html_output() |
Checks whether a given HTML string is likely an output from this WordPress site. |
wp-includes/classicpress/class-cp-customization.php: CP_Customization::cp_translations() |
Returns the matching ClassicPress URL. |
wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php: WP_REST_Autosaves_Controller::get_items() |
Gets a collection of autosaves using wp_get_post_autosave. |
wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php: WP_REST_Plugins_Controller::create_item() |
Uploads a plugin and optionally activates it. |
wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php: WP_REST_Plugins_Controller::does_plugin_match_request() |
Checks if the plugin matches the requested parameters. |
wp-includes/general-template.php: wp_get_code_editor_settings() |
Generates and returns code editor settings. |
wp-includes/cron.php: _wp_cron() |
Runs scheduled callbacks or spawns cron for all scheduled events. |
wp-includes/general-template.php: user_can_richedit() |
Determines whether the user can access the visual editor. |
wp-includes/general-template.php: get_bloginfo() |
Retrieves information about the current site. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::check_user_password() |
Check a user password for the REST API. |
wp-includes/widgets/class-wp-widget-text.php: WP_Widget_Text::is_legacy_instance() |
Determines whether a given instance is legacy and should bypass using TinyMCE. |
wp-includes/template.php: get_attachment_template() |
Retrieves path of attachment template in current or parent template. |
wp-includes/bookmark-template.php: _walk_bookmarks() |
The formatted output of a list of bookmarks. |
wp-includes/vars.php: wp_is_mobile() |
Test if the current browser runs on a mobile device (smart phone, tablet, etc.) |
wp-includes/link-template.php: get_avatar_data() |
Retrieves default data about the avatar. |
wp-includes/link-template.php: get_adjacent_post() |
Retrieves the adjacent post. |
wp-includes/link-template.php: get_feed_link() |
Retrieves the permalink for the feed type. |
wp-includes/link-template.php: get_permalink() |
Retrieves the full permalink for the current post or post ID. |
wp-includes/link-template.php: get_attachment_link() |
Retrieves the permalink for an attachment. |
wp-includes/ms-deprecated.php: wpmu_admin_redirect_add_updated_param() |
Adds an ‘updated=true’ argument to a URL. |
wp-includes/rewrite.php: url_to_postid() |
Examines a URL and try to determine the post ID it represents. |
wp-includes/post-template.php: get_the_content() |
Retrieves the post content. |
wp-includes/canonical.php: redirect_canonical() |
Redirects incoming links to the proper URL based on the site url. |
wp-includes/ms-functions.php: maybe_add_existing_user_to_blog() |
Adds a new user to a blog by visiting /newbloguser/{key}/. |
wp-includes/ms-functions.php: check_upload_mimes() |
Checks an array of MIME types against a list of allowed types. |
wp-admin/menu-header.php: _wp_menu_output() |
Display menu. |
wp-admin/includes/class-automatic-upgrader-skin.php: Automatic_Upgrader_Skin::feedback() |
Stores a message about the upgrade. |
wp-admin/includes/class-bulk-upgrader-skin.php: Bulk_Upgrader_Skin::feedback() | |
wp-admin/includes/class-core-upgrader.php: Core_Upgrader::upgrade() |
Upgrade ClassicPress core. |
wp-admin/includes/class-core-upgrader.php: Core_Upgrader::_auto_update_enabled_for_versions() |
Determines if an automatic update should be applied for a given set of versions and auto-update constants. |
wp-admin/includes/plugin.php: get_admin_page_parent() |
Gets the parent file of the current admin page. |
wp-admin/includes/plugin.php: get_plugin_data() |
Parses the plugin contents to retrieve plugin’s metadata. |
wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::prepare_items() |
Prepares the list of sites for display. |
wp-admin/includes/privacy-tools.php: wp_privacy_generate_personal_data_export_group_html() |
Generate a single group for the personal data export report. |
wp-admin/includes/class-wp-ajax-upgrader-skin.php: WP_Ajax_Upgrader_Skin::error() |
Stores an error message about the upgrade. |
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |