Check for the post type with the post ID:
if (
$post['post_id']
&& get_post( $post['post_id'] )
&& 'post' === get_post_type( $post['post_id'] )
)
Related Posts:
- What is the meaning of %s, %1$s etc.? [closed]
- Include WP_Query in my own PHP file?
- Show the most popular post per week
- Has anyone tried putting PHP ActiveRecord on WordPress?
- Copyright info change in Theme Child PHP
- Add footer.php to WordPress child theme
- I want to remove the links from the term list returned by get_the_term_list
- Can I run custom php on specific pages in wordpress?
- Successful or Error Message after running mysql code in functions.php
- Can I view my own wordpress php source code on my hosted web server?
- How do I get a list of popular posts by views?
- How do i get (unique) page name?
- How to display posts of specific category using a custom Query in WordPress?
- How to display php source code inside a post using visual editor?
- The custom logo, site title, and description doesn’t appear at the same time
- Hide wordpress field if data is empty in post!
- How to get the POST TITLE using the POST ID?
- Latest post in a specific menu
- Cause of Blank Lines Being Added to WP FIles?
- How to save checkbox values for logged in users?
- Insert custom PHP head above in WP pages
- Log in / Log Out Custom Button
- How to do a code in php and have text before it? [closed]
- PHP nested If statement syntax
- Display Data in Table from External Database in WP using Shortcodes
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- Code snippet to show current php version inside “At a Glance” box in admin
- Fatal error: Uncaught Error: Call to undefined function get_header() [closed]
- using wp enqueue style to create a CSS file specifically for a page template
- Accidentally deleted php code in WordPress website [closed]
- random reason on refresh
- Insert PHP code in Text
- PHP code snippet to remove microdata
- Counting number of posts in multiple (sub)categories using shortcode
- Need help for some PHP code
- Woocommerce display orders with products from specific categories to specific admins
- Woocommerce template file outputting tags
- Copying and pasting to WordPress “code editor” code via the front end and clipboard
- How to preload header logo image in WordPress? like what’s the code and where do I put it?
- How to put 2 php codes in functions.php without site crashing
- Displaying SQL query result from user input via wpdb
- Query to show average # of months all accounts with specific role have been active
- admin-ajax.php 400 bad request – whats wrong with my code?
- style.min.css code issue
- Add disclaimer before certain posts and pages
- Jetpack: Display Site Title when no Site Logo
- how to run a php code in widget?
- how to add number value in front for variable [closed]
- Blog only showing code
- Display pages from specific page template
- why is markup routinely placed in functions in wordpress?
- Themes with variable width or single columns? I want to display source code
- Open all external links in new window – need help with the code
- How to get the Woocoomerce subtotal value without tax in the hardcode? [closed]
- Where to put include php file?
- Can you not edit the HTML and PHP of your WordPress without paying?
- Dynamically added text at bottom of article – non searchable by PHP code
- how to create twitter card without plugin in wordpress website?
- WordPress theme options error
- Moving code from theme header to functions.php
- Woocommerce Email attachments not working – file not being attached
- Best way to use a large array in function
- AJAX button action in foreach
- register_setting & add_settings_error validation issues with multiple fields
- WordPress wp-admin redirect and exception
- Validate and Sanitize WP REST API Request using WP JSON Schema?
- Function Reference/human time diff for future posts
- export a mysql table to csv with column headers
- How do I correct the code in php? [closed]
- Dynamically adding filters
- Reusable code that I can store in the function.php and apply to other templates as need. Dry Code
- Comment_author_url doing nothing
- How can I tell which of my pages are single-view pages?
- Get category id when SEO URL is turned on
- How to sort WooCommerce products page by latest in-stock items first?
- WP_Query for woocommerce products with a pattern as a post_title
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) through wp_admin_ajax.php
- Get WooCommerce products with similar SKU
- Ajax filter with loadmore button
- Showing search results on a page
- How do I properly upgrade WordPress’s PHP within an OpenLiteSpeed GCP instance? [closed]
- How do I disable cache for a certain page?
- Fetch commens from a specific post
- Set notification if is two product category in cart
- Add parent menu item in sub-menu in custom nav_walker
- Reverse Cross-Sells (WooCommerce)
- Allowing HTML elements in title widgets spacing problem
- Pull a div from one WordPress site into another WordPress site
- Can not manually create a database ( db, user, pass ) for a plugin
- Rewrite url for custom post type not working
- Jquery and Sticky
- How to style this wp_list_pages markup
- Get permalink for a post from inside WordPress and route to a related site
- WordPress format json in postmeta table
- How to list all the posts in a personalized page? WordPress
- get_page_by_title() doesn’t return the post object if the title has inverted comma (‘)
- notify users when changed database
- Check user last login date
- create custom post type and populate custom fields using php
- Want to add custom post type for facebook feed