You are getting that because the $post
variable isn’t set.
You’ll need to call global $post
at the beginning of your function.
function custom_content_filter_the_content( $content ) {
global $post;
...
Related Posts:
- start_lvl Ignored in Custom walker_nav_menu
- Enforcing password complexity
- Customize default settings on new sites on multisite
- How do I make my function add variables/values to the $post object?
- Check if a menu is empty?
- Dynamically change feature image in customiser
- Change comments form title on a page by page basis
- Creating wordpress user registration form
- Get the title before comma
- category not display in word press grammatically
- Setting up the child theme so as to enable right-to-left WordPress?
- Design view breaking on Pages
- Getting a fatal error while updating
- Hooking new functions to actions + passing parameters
- “Can’t use function return value in write context” error
- Display 4 chronological posts starting with a random post
- my function doesn’t return my post from today
- How to break down importing of feeds
- get_the_terms – only top level
- Have CSS Class Added with `is_page()` WP function
- Slide in Panel WordPress Post
- Use wp_get_recent_posts with search term
- Calculations in functions.php [closed]
- comments_number display outside specified span
- Choose To Display Post Views With An Options Panel
- Prevent Data Resubmission On Page refresh
- Get_avatar filter?
- Passing the custom field values in the wp_get_current_user array function
- Get value from shortcode to do something
- PHP 8, AJAX mail form to function.php doesn’t work
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- How to create a php variable using WordPress the_title() function
- Can’t find infinite loop cause
- how to make custom ajax handler?
- How to disable controls in theme customizer?
- register_taxonomy() take much queries
- is there a benefit in using a constant over get_stylesheet_directory_uri?
- WooCommerce Tabs [closed]
- ::before on open/close function [closed]
- REQUIRED: get_bloginfo(‘template_url’) was found in the file search.php. Use get_template_directory_uri() instead
- How to check if a PHP string is different than meta field?
- Displaying posts based on category
- Countdown to date function?
- Creating a mobile site by adding a new class to the body tag from functions.php
- calling a custom field value inside functions.php
- Export Form Data to a CSV then send it as an attachment – contact form 7
- Issue with fetching mysql data and displaying results via shortcode in webpage
- Noindex Posts From Certain Authors In WordPress
- Template Loop – add switch case php
- Show all tags within a category?
- WordPress check if current taxonomy has child
- This function is deprecated; use mysql_real_escape_string() instead
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- Custom Taxonomy Select Menu: Setting default option value?
- How can I alter this code to accept a slug as well as an ID?
- Enqueueing a code block from an options framework
- Conditional On custom field plugin metabox
- Adding a ‘style=’ bit to image_send_to_editor output
- Post Views Code Hacks
- Closing WP_LINK_PAGES DIV ID w/After Argmuent
- Exclude function from running on a certain page
- Auto create Nextgen Gallery on post creation [closed]
- Hide media for non logged in users
- Adding an “Upgrade Subscription” button to an Elementor page
- Jetengine Forms – Media upload path
- Using ACF Relationship field to set post type to draft or published status
- Custom function that re-writes page title breaks when the Yoast plugin is activated
- is_front_page is not working in my functions.php
- Is it possible to update the dataset using update_post_meta
- update_user_meta as multiple value but with same meta key
- Hide payment method based on user role AND minimum cart value
- Update $wpdb query with AJAX
- How to bind each “the_content” elements to a custom variables
- Permalink changes after several minutes after saving post
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- Trying to publish a little bit of Javascript on the homepage AND at the bottom
- Custom Bulk Actions handler not firing
- Get field in readable word
- All categories options or All categories not Populating
- WordPress load javascript file if something… (after the page is loaded)
- How can disable wordpress emails notifications?
- Wrapping shortcode content in a span or link
- main menu page redirects to user ID
- How to have Function of a plugin using global vars into a shortcode?
- Permission functions within wordpress
- WordPress display name string manipulation
- How can I clear the theme mod settings?
- Cant get theme to change footer color through theme customizer
- 2 small questions: How to redirect to a created page & show that pages title in wp, bp
- ACF Date fileds to Age Convert [closed]
- How do I get Roboto Google Font to display normal font-style? [closed]
- which table updated after logout?
- Accessing WordPress Functions get_permalink() in Vanilla PHP?
- Loop on a wordpress Page instead of content coming from the WP text editor
- Saving User Input to PHP Variable
- Why a class property becomes empty?
- Hide category by tag
- add_rewrite_rule image from /images/site2/favicon.ico to /favico.ico
- Background Tasks in a WP Cronjob?