There is a section that should look like this:
defined( 'ABSPATH' ) || define( 'ABSPATH', __DIR__ . "https://wordpress.stackexchange.com/" );
require_once( ABSPATH . 'wp-settings.php' );
add_filter() is available after that, you are probably using it too early.
Related Posts:
- Customize WooCommerce Error Message
- Which built-in WordPress files are safe to edit?
- Cannot change the definition of AUTOMATIC_UPDATER_DISABLED
- Filter Hook callback error, is it due to using $this inside a filter or something else?
- Remove classes from body_class
- wp_headers vs send_headers. When to use each?
- Filter any HTTP request URI?
- How to appending to the_content using add_filter with custom post type?
- Is it possible to filter comments in a post so a user can only see the comments they have written?
- Where to hook into post content?
- Adding a filter to qTranslate to change display of language chooser
- What hook do I use to edit the post statuses option in admin?
- Check if a filter or function has been already been called
- Custom Rewrite Rules Not Sticking
- Filter Widget Title Wrap
- Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes)
- How to add attribute to output with wp_video_shortcode add_filter
- Remove WPML’s home_url filter
- Change default settings used by gallery shortcode
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Please explain me what the do_action does
- How Can I Have A URL Changed Based on the Originating URL?
- Is it possible to Hook/Filters Attachment Creation?
- Add ‘if exists’ to filter
- how to remove filter from wordpress shortcode output
- Change email from and display name with a filter action
- How to check if “media_send_to_editor” is audio?
- Changing Order of Filters
- Please help me through this example with a filter to understand how they work
- Filter custom post types in archive
- WordPress tag cloud add more links
- How can I filter block registration based on post-type? (Block alignment settings)
- wp_insert_post_data filter not working correctly after upgrade to WordPress 5
- Modify site URL via functions.php of a theme
- Yoast SEO hooks overriding themselves
- Passing variable from child theme to parent theme
- Question about how do wordpress filters/actions work
- How to center oEmbedded content
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- Add Sortable Column For All Post Types
- Two functions utilizing registration_errors filter
- “There doesn’t seem to be a wp-config.php file.” despite wp-config.php in root
- How to take options from form fields and turn them in to links?
- When to use add_action when registering/enqueuing scripts
- How add a group by to the query used by the media library?
- add_filter(allowed_block_types) -> adding core/paragraph bugs Gutenberg editor
- How to properly modify WP Vary or any existing headers?
- How to remove medium size class in gravity form for input tag?
- wp_mail works with add_action(‘save_post’, …) but not an ajax action
- How to check if a protected hook is hooked?
- Can i use multiple ‘the_content’ filters?
- Is it possible to put the add-filter()-hook into a function?
- How can I return shortcode output to the top of the content?
- separate categories with comma and srounded by single quote
- Filter for when the post is updated
- term_link filter gives less atributes
- Filter a pluggable function
- Add mime types with plugin
- Filter media upload attachment meta
- Filter have_posts()/ the_post()
- Filter wp_redirect() to stop redirect under certain condition
- How to add filter in custom rss feed
- Echo string in admin panel footer beside version no
- How to change default text for specific post type
- Add PHP code after title in single post pages?
- How to stop the deduction in “wp_term_taxonomy” count, when the post is deleted?
- How To Get Search Term and Use in Function
- Same URL for portfolio and for a page creates 404 error. Is there any filter that i can use for a child page?
- How to pass a variable between filter/action functions?
- Filter the title to only affect the_title() template function
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- how to unescape wordpress output
- How can I limit access to uploaded media depending on the logged in user’s user role?
- Database & Post Search
- login_url filter creates permanent wp-admin -> wp-login redirection loop
- How can I filter same content in page
- How can I change the button text of a custom widget?
- WordPress Tag Cloud Filter Prevents Widget HTML from loading
- the_content filter not working when Jetpack activated. Any idea?
- Adding Filter | Page Title | Template | Why the_title affecting on menu?
- gettext filter does nothing
- Code restricted to dashboard, running unexpectedly in the frontend (pre_get_post and admin-ajax.php)
- Restrict access to custom post type and filter from every query
- Why none of xmlrpc filters work
- How to use the filter ‘widget_text’ to a particular text widget with id
- Custom xmlrpc request does not pass parameters?
- Hook into ‘when user logs in’ [persistent login]
- Filter on widget-title does not work with custom links
- How to reset/remove added filters ‘posts_join’ and ‘posts_orderby’ after the loop is completed?
- How to turn this customized core function into a filter/action in functions.php?
- Categorize posts on a page o the basis of category of other post on the same page
- manage_users_custom_columns filter not firing callback functions
- Conditionally including JS based on whether ACF field is set [closed]
- How to use apply_filters(‘get_calendar’) to change get_calendar() output?
- How to add custom HTML attribute to reusable block div in WordPress admin
- Add a filter conditionally based on frontpage
- custom post filter based on Visitors country
- How to correctly override a filter?
- Is it possible to modify a WP search query to return results for private pages when not logged in?
- Accidentally created 2 pages, same name. Changing permalink on one changes both