The content is a property of the post object, not of the query object.
Use $post or get_post() :
if( '' !== get_post()->post_content ) {
// do something
}
Related Posts:
- function deactivate_plugins does not exist
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Make Categories and Tags required in admin
- Getting wrong relationship value in $args in wp_Query?
- wp_schedule_event in a class
- custom XMLRPC method plus authentication of user & WooCommerce order
- How to extend LINK TO functionality in ATTACHMENT DISPLAY SETTINGS
- How do I Make a Theme “plugin-ready”?
- How to iterate through custom posts and add the title to an array
- WordPress Terminology Options Vs. Settings
- How to modify post content before writing to database?
- Display only certain posts based on visitor’s country?
- Is it possible to create an action hook using do_action() within add_action()?
- Custom user profile, registration, login page with theme
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- Possible to preset a widget’s contents via a plugin script?
- $wp_filesystem returns NULL. What are the dependencies?
- Need specific kind of “Poll Voting” for WordPress [closed]
- Install widget on plugin activation
- Synchronize custom post type tags with WordPress default post type tags
- Prevent Javascript Facebook SDK Conflicts in plugin
- Integrating Stripe PHP library into a custom WordPress Plugin
- How to change the URL pattern for single post view
- What for the tables ending with the meta used in database of wordpress?
- How to create custom field in worpdress default widgets?
- Ensure function has completed before allowing another Ajax call
- Loading scripts with wp_register_script and wp_enqueue_script
- Change the ‘published on’ text?
- WordPress is automatically linking plain text email addresses
- Is Using WordPress Supplied WYSIWYG Advisable?
- How do I add a filter to wp_list_categories() to make links nofollow?
- How to hook into publish post events in wordpress 4.7.5
- What is the best way to embed an JS App in a WordPress Page?
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- How to serve different thumbnails/images depending on users browser/platform
- Plugin development – How to use a specific wp_options into the real rendered code in the front end?
- Show disclaimer with accept button before redirecting to the payment gateway website
- Why is the temporary upload always 4.1K
- Problem with dinamic add_rewrite_rule()
- Gravity Forms Perks – Nested Forms
- Remove custom post type slug from URL and add taxonomy Slug
- How do I get the sub categories of the parent when in a sub category?
- Add Minimum Dimensions Text to Featured Image
- custom permalink’s rewrite rule for page id
- how to get context information inside my funcion
- Is disabling test_form in wp_handle_upload a security concern?
- How to connect my wordpress plugin to a remote database securely?
- How to create a backend for a custom theme?
- admin_post equivalent for guest user?
- Update custom plugin with WP-CLI
- Delete data from database using row action
- When echoing my own shortcode, it keeps adding a 1 at the end of my blogpost
- Update wordpress Core Remotely
- How to create templates for a custom module to show on the front end within my theme?
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Translating plugin settings page – dropdown list
- settings api – add_settings_section not working
- How to redirect home page to another page after login for all user?
- add_filter img_caption_shortcode not implemented
- How to overwrite iris color pallates from theme to plugin
- in_array function Problem
- Best practice for plugin: always detect admin-ajax call?
- How to hide page links from theme menu
- Thickbox in Plugin settings page?
- Remove Meta-boxes (Yoast SEO plugin) [duplicate]
- Can I use a custom post type as a custom taxonomy for a different custom post type?
- WooCommerce currency converter support [closed]
- Woocommerce – looping product images
- How to add text editor in plugin menu?
- wp_schedule_single_event is set correctly but sometimes not fired
- Console errors in 6.0-RC1 Widget screen
- Pass Values in URL on WooCommerce Product Page
- Plugin Install Issue “-1” Appended to end of plugin name
- Information and Page from WordPress Plugin
- How to control ajax calls without effecting memory of server?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- ajax response strips multidimensional array and unable to decode
- Multiple instances of $opt_name in redux framework
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- The Events Calendar featured image as body background?
- using wordpress acf shortcods in tables goes outside the table
- Pass javascript result to shortcode executer function
- Not able to Update database while creating a custom module
- How to load css file after a certain css file
- Plugins and how to assign urls to content
- Deactivate Other Incompatible Plugin Upon Activation
- How to make auto installer Plugin?
- Can’t get query string in ajax call
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- first_name property missing inside register_user action hook
- Pass results of custom query to loop – when writing a plugin
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- user can login from single account detail from multiple locations(computer) at the same time [closed]
- WP Cron registers hook without any action (does not call the function)
- Call API on post save/update and show the result in admin area
- Is there any other ways to replicating changes on live from staging without pushing from git
- upload image to wordpress media library failed for custom post type