I’d guess that $data
is being treated as an integer, and therefore your stristr
is returning false.
Try explicitly casting $data
as a string:
if ( stristr( strval( $data ), $partial_match ) ) {
return $mapped_value;
}
Related Posts:
- How to add a data attribute to a WordPress menu item
- Order posts (across the whole site) by metadata date
- Relative URLs and hide /wp-content/themes/
- Disable visual editor on one specific page
- How to display random users with avatars
- Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?
- In a WordPress plugin, how do you output HTML code inside the DOM header? [closed]
- Slugs as breadcrumbs for Pages
- Different ‘WP_CONTENT_URL’ for different subsites in Multisite setup?
- Removing Unnecessary Text from Admin Menu without CSS
- Display WordPress Search
- Remove_filter (‘the_content’, ‘wpautop’) is not working
- Preferred Use of home_url()?
- Functions.php reverted to new one
- Where does function_exists() look to decide whether a function exists? [closed]
- Get page slug and assign a variable within functions.php
- Clean-up script tags
- Make “sidebar template” the default template for new pages
- Refactor create_function
- WordPress function for 1 to for many
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- Attach parent category template to all subcategories
- How to insert a text in all pages and posts before or after specific places?
- Add class or ID to any WordPress function
- How can you limit srcset on a single type of page?
- Remove Font-Awesome MaxCDN Link & Load Locally
- How to remove howdy dropdown menu content
- Change Admin Bar “Visit Site” URL
- exclude a category from a search on a specific page
- How to fix Warning: call_user_func_array()?
- Stop turning small dashes into longer ones
- How to get specified parent page title in my function
- Execute function after a post has been published
- Last updated date function
- Possible to display shortcode based on the category?
- I want to get product attirbute in the section below
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- How to set default archive image without overriding first attached image? [closed]
- Toggle User Roles with button
- Passing a variable via wp_head and then calling it on the page
- Load Woocommerce and WordPress Functions Outside
- How to make custom column Admin>Users sortable?
- How to know which ajax file or function is called for action
- How to filter $content in shortcode function
- Full page template function
- Redirect from “private” page and functions.php which tag add to add_action()?
- Display gallery on bottom after content
- watermarking gallery items
- Difficulty with PHP function that displays a post’s format in WordPress
- WordPress Shortcode function display outside of widget
- Get rid of the widget Item Class=”widget-item”
- Storing password (functions.php)
- Check if the image size is available and if not use ‘full’ image size
- Secondary Menu and Logged In Users
- Modify gform_other_choice_value for specific form and specific field in Gravity Forms
- Adding code before post title with the_title produces weird results
- Remove the month and year from a WordPress Date?
- How to insert class in each list of categories?
- Add Link to Users List (Backend) to open each users front-end profile
- Editing the formatting.php file vs functions.php file?
- How to make a new function that includes a template
- remove/hide wp-editor
- Function not saving unchecked checkbox
- Removing parent theme CSS without editing parent theme
- Entirely Different Functions.php per Page?
- Why is this function crashing my wordpress installation? [closed]
- Hide Author By-Line if After Certain Date
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- How to Override Page Template if URL matches query?
- wp_title() return random number
- Woocommerce Display Discount On cart
- How to offset main query without affecting other queries and backend
- ACF Date Form in Custom Admin Field
- How to add link rel tags on paginated posts?
- How to pass data from a plugin to functions.php
- Function to disable “href” anchor tags that contain “a data-name” on mobile only
- Execute jQuery with custom event listener after successfully add an item to the cart
- WordPress hooks to call a function inside a construct
- WordPress undefined function error on using add_action() in functions.php
- How to create admin ajax function for my contact form
- how to display featured image for single post for a specific category
- Database Query not working
- Load a Child Theme’s style.css just before the closing tag
- Can’t wrap my head around this function – any help would be appreciated
- Figure inlined width trigger distorted layout
- save_post hook – headers already sent?
- Exclude javascript in certain page url and all following url’s after forward slash
- How to use WP_rewrite?
- Wp get archive only text not link
- can not call functions in function.php
- Shortcode Variations?
- How to test for a class (from a plugin) in functions.php
- Child Theme not working – CSS gone
- Custom shortcode not being included in content paragraph [duplicate]
- Display post_meta-by_key on product catalogue
- What are the parameters are used in add_action and filters?
- Which template file to edit to edit homepage in Mystile [closed]
- Does functions.php apply to every page?
- Customizer cuistom CSS Priority ordre Issue
- WPDB query suddenly not working