Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How to handle this specific case of custom post type?

The question is: How do you want to handle it?

From what I understand, you’re currently trying to build up a song (“track post”) database, from which users should be able to pick from for their playlists. With every user being able to add new songs.

You could solve this in a similar fashion to how StackExchange works: add a Community user. Whenever a song is created, its ownership gets transferred to the Community user. Then add custom capabilities which refer to that Community user. Who can edit posts, who delete, …?

In this basic version, it might turn out that a user is not able to edit/delete a song s/he initially created. You can even achieve that by saving the original creator as a meta field, hooking into user_has_cap.

Related Posts:

  1. How to assign specific users the capability to edit specific pages / posts / custom post types
  2. REST API: How can I restrict a custom post type to only be accessible by authenticated users?
  3. Allow Users Access to Custom Post Type Only
  4. Custom post type capabilities require “create_posts” to access the edit posts list page
  5. How to restrict CPT post’s fronted view only for specific user roles?
  6. Restrict Access to Posts based on Custom User and Post Meta Data
  7. How can I get some of a posts meta data whilst it is still inserting?
  8. How can I remove “Add new” button on custom post type
  9. Query all posts where a meta key does not exist
  10. Capabilities and Custom Post Types
  11. Can the Next/Prev Post links be ordered by menu order or by a meta key?
  12. what is the correct way to compare dates in a WP query_posts meta_query
  13. Allow member to have access to custom post type only. Permission to only edit their own posts
  14. Advanced search form with filters for custom taxonomies and custom fields
  15. Possible to hide Custom Post Type UI/Menu from specific User Roles?
  16. With Rest V2 (WP4.7) how does one restrict certain RESTFUL verbs?
  17. Meta query with boolean true/false value
  18. Custom post type role permissions won’t let me read
  19. Get post with multiple meta keys and value
  20. Correctly delete posts with meta and attachments [duplicate]
  21. Allowing custom role access to custom post type in back end
  22. Storing revisions of metadata for custom post type
  23. Custom field values deleted when trashing custom post type
  24. How to get all custom fields of any post type
  25. Update CPT meta data using REST API
  26. Admin Area Custom Type Search By Meta Fields Without Title & Content
  27. Get post ID from wp_insert_post()
  28. Echo all meta keys of a custom-post TYPE
  29. Change capability type of post type registered by plugin
  30. Custom Post type – how to get checkbox to update meta field to null
  31. Allow user to Edit Posts but not Add New?
  32. How can I filter posts by post_parent in the admin?
  33. Defining capabilities for custom post type
  34. How do I Paginate Search Results for Custom Post Types?
  35. WP insert post and custom taxonomy
  36. Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
  37. Can I make user role that can only access a certian content type?
  38. Ordering posts having multiple post-meta date fields
  39. Custom Post Type with Input fields to seperate table on database.
  40. How do I remove all the metaboxes for a custom post type?
  41. Customize users’ capabilities to change a custom post’s post status
  42. Show custom post type endpoint in REST API just if user has capability
  43. Custom Queries: Joining On Meta Values From Two Custom Post Types
  44. Gutenberg how to make attribute to save to meta
  45. Notice: map_meta_cap was called incorrectly
  46. How do I programmatically add items of content to a custom post type?
  47. How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
  48. Post metadata deletes itself
  49. How to create a mini directory in WordPress?
  50. How Can I save multiple records in same meta key?
  51. Not Able to Insert Taxonomy Term Using wp_insert_post()
  52. Create user role restricted to specific CPT
  53. How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
  54. Custom Post Types – Capability Type
  55. Get all posts from custom post type and insert in select input as metabox
  56. Detect meta value changes when post is updated (post_updated)
  57. Custom Post Type Capabilities — Enable Edit, Disable Create and Delete
  58. Search everything (posts, pages, tags, cpt, meta)
  59. Add Capabilities to Custom Post Type after it has been created [duplicate]
  60. How to not allow custom roles to edit published custom post types?
  61. When you create a custom post type, does that also create capabilities for editing/deleting that post type automatically?
  62. Permalinks using event date (year & month) instead of publication date
  63. Custom Post Type: Set post_title equal to a custom post type field
  64. I can’t set meta_key in my custom post type query
  65. Grossly inefficient wordpress loops!
  66. Compare 3 custom fields and sort by oldest
  67. Using Custom Meta Capabilities on Custom Post Type
  68. Remove Custom Post Type menu for non-administrator users.
  69. How I upload, save and set a featured image from my frontend?
  70. How Do I Use WP_Query to Run This Database Query as Search Result?
  71. WordPress Admin Panel search posts with custom post meta values along with title
  72. Creating a custom post type upon registration
  73. How to automatically apply a password to all posts within a custom post type
  74. How to Update post status using meta data in Custom post TYpe
  75. How to restrict specific post types from being read or added by specific user roles (eg. author)?
  76. Trying to save custom post type from frontend partially working
  77. create a back-end wordpress content submission using custom post type
  78. Rest Api v2 orderby meta_key in custom post type
  79. bulk Update post_meta with default values
  80. Reason action hook won’t work with update_post_meta from frontend form? Alternative?
  81. How do I code access to the built-in UI of a CPT when it’s placed as submenu of another CPT that is protected by role?
  82. wp_insert_post custom taxonomy
  83. Can’t sort order of wp_query with 2 meta keys
  84. Showing Meta Data for Custom Post Types?
  85. How to get source of custom meta image?
  86. Assign category to front end post
  87. Having trouble with custom post type / meta box
  88. Query for posts from any post type but only add instock products
  89. How can I include meta box content when searching?
  90. update a post meta from a single table cell TablePress
  91. update custom post type meta from a shortcode
  92. WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
  93. Custom Meta Boxes – Nonce Issue – Move to trash issue
  94. How can I programmatically save data into custom fields that contain serialized data?
  95. Displaying Meta Box Image
  96. Custom post type category not displaying in custom post type
  97. What hook should be used to programmatically create a post only when master post is updated?
  98. WordPress capability_type arguments
  99. How to make custom post meta wp_editor translatable?
  100. Custom role capabilities to administrator not taking effect (no plugin)
Categories custom-post-types Tags capabilities, custom-post-types, post-meta, user-access, wp-insert-post
How to show custom field on specific custom post type posts only when filled
WordPress.org: How to add a plugin for certain countries?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress