Make sure you’re namespacing the class that is declaring the function, within chapters.php
– namespace absf/Chapters
Within down-latest-videos.php
:
use function absf\Chapters\get_down_latest_videos; // This pulls in the function from chapters.php
$latest_four_vids = get_down_latest_videos( $post_id );
Your function get_down_latest_videos
is expecting one argument to be passed – $post_id
.
You’re passing it two – $curated_posts
and $program_ids
.
Since you’re filtering the posts within the WP_Query
, you don’t need to pass in a $post_id
or any arguments, unless you’re using those in the function itself to add to the filter. Currently you’re not using $post_id
anywhere within the function.
Related Posts:
- What does this PHP function code mean? [closed]
- Get the ID of the latest post
- Possible to change the URL for the regular post type without affecting the URL of other custom post types?
- Change permalinks for posts but not for custom post types
- Front end post editing using a form
- Set posts of a custom post type to be private by default?
- How to add a button to custom post type’s posts-page
- How can I add a column/s to wp_posts table?
- How make get_next_post() return first post when viewing last one
- post_row_actions for custom post type
- modify all posts of a category to “no comments allowed”
- Getting a div content of a post in wordpress?
- How can I add dropdown widget/box to admin post page?
- Custom permalinks – post type – hierarchical taxonomy’s
- How to show related posts by category or custom post type?
- ascending order custom post type
- add_meta_box: Datepicker like the one for postdate?
- [Plugin: Posts 2 Posts] Changing display order of connections
- Display taxonomy term only if there’s a value
- How to show post title outside of loop? [closed]
- How do you use JavaScript to detect the homepage
- How to delete all posts from a custom post type?
- Update content of multiple pages/posts at once?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- CPT’s archive and single page not working [closed]
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to post twitter like updates on wordpress
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- apply filters only to specific post listing without check the url parameters
- How Can I Set the Post Author of a Post I Just Created With PHP?
- WordPress Orderby Numeric Value Not Working
- is there a way to retrieve posts that do not have a featured image assigned?
- Missing Posts in Custom Taxonomy List
- Post image in WordPress not appearing on home page
- custom post type category count shortcode
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- How to sort posts in a custom post type by title in ascending order by default?
- Conditional for a Single Post That Belongs to a Category?
- $post not working working in AJAX plugin with custom post type
- Create new custom post and post category of same name
- Multiple pages per post (not pagination)
- Variable not working in WP_Query
- What’s an efficient way to change the post status of many posts at once?
- Query within a foreach within a query (queryception)
- How to implement a different permalink structure for custom post type?
- Modify Posts from Custom_Post_Type within the plugin
- How do I edit the WordPress post.php file?
- Posts are not rendering perfectly [closed]
- How I can made a custom post type to page templates?
- List all posts in taxonomy term
- list posts of two post types in a single template
- how to redirect to a custom post template
- Post/Custom Post Type URL Access
- Adding /blog in front of single posts (only)
- Add a form in every post and save data in post meta
- list articles in admin showing nested categories or slugs?
- Search CPT by tag ids
- Post template with breadcrumb needs to show page navigated from
- Define multiple prefixes for custom post type
- Publishing failed. The response is not a valid JSON response
- add all blog posts to folder
- Limiting the Number of User Posts to Their Own Posts
- Correct way adding External classes to Custom Post type and output their methods to template
- Show posts from WP Custom Post Type selected from a field in a metabox
- order custom post type posts by custom date
- How to show posts of the same category on a page?
- Assign a Post to a User
- Cannot save pages after migration
- News post with multiple permalinks? When opened from different page
- custom post type to post association in wordpress
- Rest Api not working with Iframe in form data
- Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?
- Display title of all custom posts from same taxonomy term on a custom post template
- Use WP pagination functions on a custom page template
- Rewrite url post_tag for custom post type
- How to get all posts related to a taxonomy?
- call a function when insert and update a custom post type
- Work and Display a Custom Post Type as a normal Post
- Most efficient way of showing children posts?
- Limit or filter edit view in the dashboard to a specific ID only?
- Custom post type with two templates
- One Post with different content, depending on a Page
- Custom Post Type
- Popup panel is only displaying 1 entry ignoring all others
- Custom Post Status & Taxonomies
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- How to Arrange Support => Thumbnail
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Front-end form submission not creating post
- Post being scheduled that shouldnt be schedulded
- Post type cloud like tag cloud?
- Change permalinks for posts but not custom post type?
- Get custom post type parent category
- How to delete unnecessary custom post types in the UI
- show the most recent date of all posts to display on front end
- Error 403 when posting comments to a custom post type from a different page
- How to automate the creation of advanced layout article/post
- Sort ACF by custom taxonomy