You should use standard php function
if class_exists('WC_Product_Variation') { ...}
Related Posts:
- How do I get the current edit page ID in the admin?
- Does hooking into the same action multiple times drain memory?
- Apply custom role capabilities to administrator (without plugin)
- Different wp_mail_from and wp_mail_from_name for specific situations
- register_post_type for Pages?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- Linking thumbnail to full size image
- is_front_page not working in functions.php
- VERY new to coding – keep breaking site trying to add to functions.php
- Restrict user registration to emails on a single domain
- Call to undefined add_action() in theme’s functions.php
- How can I rename the WordPress AJAX URL? [duplicate]
- How to enqueue JavaScript for specific WordPress pages only?
- Passing HTML in WordPress Shortcode arguments
- Can I use require() function in a template file?
- What is the most efficient method for loading widgets in functions.php
- Enqueue script o style only if a template part is loaded
- Exclude Empty Child Categories in Menu
- Can I pass two roles to the function get_users?
- Convert User ID’s to User Names in a single.php file
- Custom roles can’t access to wp-admin
- How to specify which Gutenberg blocks are available in the editor for a page template
- password protected post policy
- Custom Shortcode, functions PHP WP_Query loop
- How to filter out shortcode when displaying the_excerpt() in the loop?
- wpautop – disable tags, keep tags
- Logout hyperlink within a sub-menu
- How do I pass arguments for multiple functions hooked to a single action?
- Manipulate Permalink
- Change the HTML of the comment form that is generating somewhere from the core WordPress
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Theme functions.php file auto delete everyday [closed]
- How to get the index number of the posts?
- Removing wp_login_viewport_meta
- Two Types of settings in WP – The Doubt
- Custom Attachment Caption Fields
- Generating dynamic css into custom file [closed]
- How to call particular funcion when the check box is checked in plugin options page
- Call WordPress function outside of WordPress
- Move Custom Fields on General Settings Page to New Location
- Events: Check for other event with same start date and category [closed]
- Remove adjacent_posts_rel_link under 3.2?
- enqueue_script with filemtime javascript not working
- WP function won’t work on 404 template page
- How to obtain the recent posts without their content in an efficient way?
- Function coding error concatenating quotes I think
- Need print logo without any ID & class
- Can we create our own theme’s function.php?
- Not all CSS elements transferring via parent to child?
- Limit dimensions of “Full” size images
- Reset postdata not working on WP_Query in functions.php
- Filter nav menu items HTML tags and wrap inner text with span
- Output a specific link in WordPress post if the single post’s category’s name contain certain word
- Using Static HTML instead of the `home_url()` WP function
- How to append classname to body tag if guest user
- add_filter to specific WooCommerce Category
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- Passing user enetered value in widget: number of words, for example
- Can I include a custom PHP function in a WordPress function?
- Adding a section in line at the end of the main navigation menu in php
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Function to replace comment’s accented characters before posting
- wp_nav_menu work in functions.php but not in the theme
- Only echo Page Content (not page title & page content together)
- update_post_meta is Updating with two page id
- How do I preserve changes to a theme’s functions.php across updates?
- Custom Image Size in Insert Media
- Unable to Change “Pages:” Before WP_LINK_PAGES
- Looking for Functions File that doesn’t Exist
- sort metabox columns in listing Single
- wp_nav_menu displaying all pages
- Fetch URL parameter
- Updating custom query var with multiple values
- Why should I use get_template_directory() when include files?
- Redirect to one of two pages after data submitted, depending on the current url
- WordPress wp_dequeue_script remove all other scripts
- Error in “class-wp-hook.php”
- How to replace ACTION url from original wordpress login form?
- Add Javascript code to functions.php childtheme
- Ajax in plugin fails – but only on one blog – no idea why
- Why does my wp_enqueue_script() only insert the script for logged in users
- Problem with email function
- method to fetch entire tag list on archive.php
- MCAPI.class.php showing some error
- Remove post from latest posts after a month only with certain tag
- Display list of pages that contain a certain string within the slug
- I need to completely ‘wp_dequeue_script’; what’s the best way?
- $content is empty while using DOMDocument
- Change the second role depending on the first
- How can I return the result of my custom function?
- wordpress not calling peliegro functions.php?
- Sanitize html, where to sanitize
- How to display data from custom fields in my custom shortcode?
- Modify function Shortcode_atts
- function to return comma separated list of meta values
- I want to add the alt attribute to all the photos!
- Need to use an external variable inside a function
- Creating mixture of shortcodes to use in the visual/text editor
- Correct php syntax to add an image in wp functions.php
- Problem with removing characters “<” – WpAllImport