OK, so there’s a bunch of admin functions in wp-admin/includes. These are loaded at some point between the loading of the theme’s functions.php and the admin_init hook. But that are ONLY loaded for admin-side pages. They are not loaded for front-end pages or AJAX calls.
If you want to use these functions in front-end pages of AJAX calls then you need to do:
require_once( ABSPATH . 'wp-admin/admin-functions.php' );
I would suggest using this sparingly as it will, inevitably, slow your site down.
Related Posts:
- get_template_directory_uri pointing to parent theme not child theme
- Include PHP file in Content using [shortcode]
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- What is the most efficient method for loading widgets in functions.php
- PHP files included in functions.php don’t seem to work
- Include files in child themes, declare in functions.php
- using `require` in my functions.php breaks the site
- Calling a Function in Functions.php from an external PHP script
- Automatically include all php files in a child theme directory
- Impossible to call wordpress function inside an include?
- Can I have an additional functions.php file in WordPress?
- wp_star_rating() – Adding a 5 star rating system to theme
- Unable to point the child theme directory even using get_stylesheet_directory()
- Can I include a custom PHP function in a WordPress function?
- Why should I use get_template_directory() when include files?
- WordPress functions.php conditional include another functions file
- Including admin-options.php file in Child Themes
- Undo a function that is not (seemingly) hooked to an action?
- 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)
- In a WordPress plugin, how do you output HTML code inside the DOM header? [closed]
- 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
- Preferred Use of home_url()?
- How to enqueue JavaScript for specific WordPress pages only?
- Functions.php reverted to new one
- Exclude Empty Child Categories in Menu
- Get page slug and assign a variable within functions.php
- 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
- Custom Shortcode, functions PHP WP_Query loop
- How to insert a text in all pages and posts before or after specific places?
- Add class or ID to any WordPress function
- How to filter out shortcode when displaying the_excerpt() in the loop?
- wpautop – disable tags, keep tags
- How to remove howdy dropdown menu content
- Change Admin Bar “Visit Site” URL
- exclude a category from a search on a specific page
- How do I pass arguments for multiple functions hooked to a single action?
- Last updated date function
- Possible to display shortcode based on the category?
- 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?
- Theme functions.php file auto delete everyday [closed]
- Two Types of settings in WP – The Doubt
- How to know which ajax file or function is called for action
- How to filter $content in shortcode function
- Generating dynamic css into custom file [closed]
- Difficulty with PHP function that displays a post’s format in WordPress
- Events: Check for other event with same start date and category [closed]
- 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?
- Reset postdata not working on WP_Query in functions.php
- Filter nav menu items HTML tags and wrap inner text with span
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Using Static HTML instead of the `home_url()` WP function
- How to append classname to body tag if guest user
- Why is it so hard to add a class to the tag in the sidebar widget?
- Parent theme styles overriding child theme CSS [closed]
- How to add a new image size and apply it to posts only?
- 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)
- How do I preserve changes to a theme’s functions.php across updates?
- Why is this function crashing my wordpress installation? [closed]
- colorbox not loading in
- how can I change all wordpress media file url to custom cdn url?
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- How to Override Page Template if URL matches query?
- Save_post – Warning: Cannot modify header information
- Woocommerce Display Discount On cart
- Modify content inside post before first publish
- Pass an argument into a function to extract from array
- how to remove a tag in the_category function
- Copying a widget class to functions.php results on a blank page
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Changing the register url is not working
- Newest comments first not working
- Pass arguments to function class with do_action()
- How to a override parent theme page that has been included with require_once?
- Database Query not working
- Can I use a function to return HTML and the result of another function?
- Excerpt length: get 2 paragraphs
- How to use WP_rewrite?
- Wp get archive only text not link
- can not call functions in function.php
- What are the parameters are used in add_action and filters?
- Does functions.php apply to every page?
- Creating mixture of shortcodes to use in the visual/text editor
- function to show youtube videos within excerpt – if condition and apply_filters
- How to automatically load Google Fonts on pages only as they’re used?