It turns out that some themes disable functions.php for the backend, in order to prevent a complete lockout. The way they do this, is by simply doing an is_admin()
check. However, since all AJAX is ran through admin-ajax.php, this returns true, and the theme functions are not loaded.
In this particular case (Genesis Framework (theme) with Dynamik website builder (child theme)) there was a setting to enable the theme functions in the backend too, though I personally think it would be much better if the theme just checked for !DOING_AJAX
in addition to is_admin()
Related Posts:
- Get URLs for AJAX Filter Checkboxes WordPress
- post value to function with Ajax and jQuery
- Issues with title-tag and document_title_parts
- Remove Actions/Filters added via Anonymous Functions
- Use AJAX in shortcode
- How to influence the information displayed on widget inside wp-admin
- Filter the query ONLY for the search results page
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Using add_filter() in Widgets
- Customize WordPress Media Manager – Media Window
- How to reduce original image quality on upload?
- Is it possible to use a forgot password url filter?
- Add body class of category parent
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Override a class function to include a custom template
- How to override filter in child theme?
- How to change a certain text or term of WordPress into a custom into the whole site?
- How do I call wp_mail from HTML?
- Unable to get_the_content(); of a post in WordPress via AJAX
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- Ajax call theme functions from front
- Show excerpt for only first post in query
- How would go about if I just want a temporary function?
- Generating rel=prev and rel=next only on wordpress categories
- How to make applyFilters function return false via functions.php
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- str_replace function in theme
- Ajax posts filter by date, comments, top views, top likes
- Modify a function without editing template
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Function call via ajax – can’t figure it out?
- How to add nav menu items to a specific position within a menu
- Passing values from a widget to a function within a plugin
- Publish/Update post is changing image links from file url to post url
- Disable auto-resizing of uploaded images, but only for certain filename
- Add to cart php not working [closed]
- Is possible add icon in title posts only in specific tag?
- create filter in functions.php
- How to search using ajax for exact phrase or words in an input field?
- Insert image in WordPress with HTML5 tag and caption function
- How to construct function for applying filter?
- Adding an external HTML link to a post thumbnail
- Replace a menu with widget or a custom template file programmatically
- woocommerce change currency per category [closed]
- Modify post filter to set custom number of posts per page and exclude child posts
- Make wp_link_pages() suitable for Twitter Bootstrap markup
- Setting a default text for excerpts of a particular category
- How to edit the Tags within the image file URLs?
- AJAX error handling for submit function in functions file
- Add_filter when value is no variable?
- (Woocommerce) Order by price when entering specific category
- How to edit classes in body tag?
- Possible to hook into Media Library preview File column and use a custom image?
- How to display the_archive_title() and the_archive_description() – “weird” interaction
- Native gallery custom html output
- The_content and Preg_replace in loaded Iframe [closed]
- How to edit/replace Parent functions.php function in Child Theme to add “Walker” class
- Functions Filter Question [closed]
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Insert Content Before div#main from the functions.php File
- contact form in template with jquery,validate and ajax
- Changing the text of Upload/Insert on Posts and Pages Screen
- Any adverse effects of adding apply_filters to a function?
- Message notification for user
- Woocommerce Variable Product Dropdown for Custom Shop Template
- Adding custom social icons to the social media icon block in the Gutenberg editor?
- Populate Product Regular Price with a calculated ACF Field Value
- How Do I Unhook This Parent Theme Function?
- price of product can’t return when get data of product in functions.php
- Allow user only create specific tags
- Child theme remove parent filter in functions
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- i can’t use wordpress functions in ajax loaded php file
- Multiple Notifications SetInterval
- Redirect specific author posts to another url
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Hide disclaimer from summary excerpts
- Load scripts into an AJAX div
- Load scripts into an AJAX div
- admin-ajax.php & my wp-admin folder url showing in header
- Only seems to be displaying one child when there are supposed to be multiple
- Best way to add image to recent posts widget?
- same get_posts function works diffrently in tag.php and functions.php
- Shortcode to eliminate and replace with
- previous_post_link inside of a function?
- Search and Replace Script Loader in Head Only Works in Footer
- Updating site content after an AJAX call without a page reload
- Error function main() is a non-object to construct my Ajax.php
- How to Add A Rel Filter to All Links?
- Print all inline styles to head
- child_of not working while searching
- Function Reference for custom link in Admin Menu Management Page
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- AJAX: WordPress filters inside $html do not work as intended
- AJAX values converted to PHP Variables?
- How can I json_encode the output of my function?
- function to show youtube videos within excerpt – if condition and apply_filters