__group__ ticket summary owner _component _version priority severity milestone type _status workflow _created modified _description _reporter Slated for Next Release 59027 Weekly wp_get_archives has invalid link (link for month instead of year) Posts, Post Types 0.71 normal normal 6.6 defect (bug) new needs-unit-tests 2023-08-09T13:43:54Z 2024-02-05T20:34:38Z "If you call `wp_get_archives` function with `type` set to weekly, the resulted link contains two parameters: m => year, w => week. This results in unwanted behaviour, as you get a month like `2023` which is invalid. The link should contain ?y={year}&w={week}. " filipac Tickets Awaiting Review 56599 """All"" view not selected for all relevant views for custom post type" Posts, Post Types 4.2 normal trivial Awaiting Review defect (bug) new has-patch 2022-09-19T10:58:34Z 2022-09-19T14:24:10Z When the screen options get saved, the parameter `mode=list` gets appended to the URL. For the posts table, the “All” view gets the `.current` HTML class, since `\WP_Posts_List_Table::is_base_request()` returns `true`. For all other post types—including pages—it returns `false`. alpipego Tickets Awaiting Review 49355 """Publishing failed. Error message: Could not update post in the database"" caused by encoding" Posts, Post Types 5.3.2 normal normal Awaiting Review defect (bug) new 2020-02-04T01:30:57Z 2023-07-02T14:44:32Z "I have some text that I am copying into the title of a post. I get the following error: ""Publishing failed. Error message: Could not update post in the database"" The text is: 𝐀 𝐖𝐢𝐧 𝐟𝐨𝐫 𝐚 𝐉𝐮𝐬𝐭𝐢𝐜𝐞 𝐂𝐞𝐧𝐭𝐫𝐞 𝐂𝐥𝐢𝐞𝐧𝐭! I am having trouble understanding what encoding this text is. Why is this failing to save to the database? My database is set to utf8mb4. Why WordPress is choking on it?" 1000camels Tickets Awaiting Review 48954 """Sticky"" post state shows even for non-Post post-types" Posts, Post Types normal normal Awaiting Review defect (bug) new 2019-12-12T21:54:48Z 2019-12-12T22:15:24Z "Reported in the support forums: https://wordpress.org/support/topic/sticky-tag-remains/ When users of my Post Type Switcher plugin switch a Post into a Page, that page still shows as ""Sticky"" in the Pages list-table UI, even though Pages do not support the ""sticky"" functionality." johnjamesjacoby Tickets Awaiting Review 56686 """internal"" post status practical usage?" Posts, Post Types normal normal Awaiting Review defect (bug) new dev-feedback 2022-09-29T08:19:08Z 2022-10-04T17:01:02Z "https://developer.wordpress.org/reference/functions/register_post_status/ has an ""internal"" param, however I couldn't find what practical use/meaning this has. What happens if we set ""internal"" true in practical terms when doing a WP_Query? Does it affect anything else besides WP_Query? It seems this is legacy and without any practical use? (maybe deprecate and remove?)" malthert Tickets Awaiting Review 40585 'Update' vs 'Schedule' Posts, Post Types normal normal Awaiting Review defect (bug) reopened has-patch 2017-04-27T16:48:26Z 2017-05-08T18:44:30Z "Hi, today i work with WordPress and i noticed a problem. My timeline event is: 1) I have an article ""X"" published of the 26 april at 20.00. 2) Today, 27 april at 18.02 i start the edit the article 3) At 18.15 finish edit article and modified date of article in pubblication in 27 april at 18.15 4) Now i don't look button ""Update"" but i look button ""Planning"". I have feeling that WordPress don't check date in this moment (18.15) but check date open edit article (18.02). The article is pubblished in all cases but theoretically the article is deleter on the google serp for some minutes. Sorry for my english :)" micheleconversano Tickets Awaiting Review 41128 404 Page not found after using same URL in post / page Posts, Post Types 4.8 normal normal Awaiting Review defect (bug) new 2017-06-22T15:40:28Z 2017-06-22T17:13:21Z "Starting from a clean Wordpress 4.8 installation. 1. Configure permalinks to: http://domain.com/post-title/ 2. Create a post with title 'new' 3. Remove the post with title 'new' to trash 4. Create a new page with title 'new' 5. Remove post 'new' from trash (not necessarily, both cases result in 404) 6. The page you created trows a 404 due to a database error since it has two different objects with the same URL, though different objects. " jpgos Tickets Awaiting Review 39939 A Contributor cannot preview their own post if it's scheduled Posts, Post Types normal minor Awaiting Review defect (bug) new needs-unit-tests 2017-02-22T12:52:02Z 2017-02-23T05:36:25Z "Steps to reproduce: 1. A Contributor writes a post and submits it for review. At this point they can preview their post. 2. An Editor or Administrator approves the post and schedules it for publication at a later date. 3. The contributor viewing the Posts listing table can no longer preview their post. Previously: #33694 " johnbillion Tickets Awaiting Review 41324 Action of password-protect form. Posts, Post Types normal normal Awaiting Review defect (bug) new 2017-07-14T12:38:49Z 2017-07-14T12:43:17Z "The default form action too-easily (I think just two submissions of a blank or incorrect password) loads wp-login.php?action=postpass with a 'service unavailable' message'). Simple validation to ensure correct password can prevent this. " gulliver Tickets Awaiting Review 53195 Add $post or $post_id to the quick_edit_custom_box hook Posts, Post Types normal normal Awaiting Review defect (bug) new 2021-05-12T11:17:34Z 2021-05-12T11:17:34Z "Right now when you're adding a custom box to quick edit, you can't set an existing value without using JavaScript, cause you don't have acces to the post. For a more elaborate explanation, see the User Contributed Notes, top one by stevenlinx: https://developer.wordpress.org/reference/hooks/quick_edit_custom_box/ It would be more elegant if we could just use the post within the hook I think." tomjdevisser Tickets Awaiting Review 59986 Add a filter into the $wp_meta_boxes output loop to provide the ability to change data Posts, Post Types normal normal Awaiting Review defect (bug) new 2023-11-29T13:52:42Z 2023-11-29T15:43:44Z "I have a metabox added via plugin that connects a custom post type with users. But I don't like the name of the Meta Box, it obscures the purpose of the box. So, the plugin doesn't have this option, and I have to change global $wp_meta_boxes for the desired effect, which isn't the correct thing to do. Of course, I could write a plugin author plea to add a filter (and it will be the third ""brilliant idea"" from me in two days 🙈), but it is possible to stumble across this need with another plugin as well. This is why I think it is necessary to add the filter to the core. Related ticket: https://core.trac.wordpress.org/ticket/39969" oglekler Tickets Awaiting Review 40500 Adding custom capabilities to a custom post type seems to break permalink link on post edit screen Posts, Post Types 4.7.3 normal normal Awaiting Review defect (bug) new 2017-04-20T16:28:46Z 2019-11-27T20:38:26Z "Added custom capabilities to a wordpress custom post type to be used in conjunction with a role scoper plugin .... see: https://www.dropbox.com/s/7gzvma9t3lm028j/Screenshot%202017-04-20%2010.27.15.png?dl=0) ... seems to make the permalink link that shows up on the post edit screen, beneath the title, non-functional (ie, no URL is actually outputted). Also does not have the ""view [custom post type]"" link that typically appears in the black wordpress admin toolbar. Otherwise, everything works as designed. Confirmed on two separate hosts with plugins disabled and default theme. Confirmed that removing custom capabilities fixes the issue. Confirmed that adding capability using alternative method of simply 'capability_type' => array('print', 'prints'), also has the same result. " finitejest Tickets Awaiting Review 42146 Admin side menu id not displaying proper when name is long Posts, Post Types 4.8.2 normal normal Awaiting Review defect (bug) new has-patch 2017-10-08T10:30:32Z 2017-10-08T10:41:38Z "I am registering one custom post type. Post type menu name is too long without space. If menu name is ""mycustomedesignerbywordpressdeveloper"" then it goes outside of admin menu." arzookansagra Tickets Awaiting Review 55248 Ajax call has stop to work (single custom post content) Posts, Post Types 5.9.1 normal normal Awaiting Review defect (bug) new 2022-02-24T13:31:54Z 2022-03-01T12:40:41Z "Ajax call which should get a content from a single custom post item has stop to work. On other hand, Ajax call which is getting more Portfolio items (more custom post items) works fine (you have all in the video - sorry for my English). All was fine until the WP ver 5.9 but the bug is there after updating on ver 5.9.1 Video link - https://www.youtube.com/watch?v=Gcxtm4FF58E" zak87 Tickets Awaiting Review 35538 "AllPosts page UI: link ""All"" has incorrect color" Posts, Post Types 4.4.1 normal trivial Awaiting Review defect (bug) new 2016-01-19T23:15:48Z 2023-07-09T20:45:45Z "STEPS TO REPRODUCE: 1) Log in (administrator), remove all posts. 2) Create new post. Go to AllPosts page. 3) Remove post to trash by clicking ""Trash"" menu item. EXPECTED RESULT: ""All (0)"" link color #000 ACTUAL RESULT: ""All (0)"" link color #0073aa" antonrinas Tickets Awaiting Review 41949 Allow multiple values for the same meta key to be passed to `wp_insert_post()` Posts, Post Types 4.4 normal normal Awaiting Review defect (bug) new has-patch 2017-09-22T02:03:21Z 2023-08-25T07:51:09Z [33910] introduced the `meta_input` argument to `wp_insert_post()`. However, there is no way to pass multiple values for the same meta key to be stored individually. desrosj Tickets Awaiting Review 31416 An accessibility issue with the Publish metabox Posts, Post Types 4.1.1 normal normal Awaiting Review defect (bug) new 2015-02-22T22:03:33Z 2018-12-09T20:28:05Z "Taking a closer look at the Publish metabox for posts I realise that it has what I would call a bug. Take a look at the image attached. It tells me a post is published, while it's still asking for confirmation to be published. This screen shows up when first a post is set to private -and so gets published privately- and next is set to public, without hitting the 'Publish' button. The post is actually published privately, which should show up as it's status, as it normally does. It tells me though it's published (which impies it should be published publicly). I stumbled upon this, while I was searching for a more intiutive solution for inexperienced posters on one of my sites to post privately. I found two threads in forums which adress this issue: https://wordpress.org/support/topic/how-to-set-new-post-visibility-to-private-by-default?replies=14 http://wordpress.stackexchange.com/questions/118970/set-posts-of-a-custom-post-type-to-be-private-by-default Neither of threads mention (or seem to be aware?) of this shortcoming, while both try to solve the same issue I'm having. I question whether this problem can be solved, while the Publish metabox has such shortcomings. I hope that by fixing this little bug, it might actually be possible to create a more accessisble Publish metabox for guests on a site, maybe by a hack or plugin, but preferably within the WP core files. [[Image(http://www.basbva.nl/wp-content/uploads/2015/02/publish-metabox-bug.jpg)]]" basbva Tickets Awaiting Review 60796 An error for page and post without revisions support Posts, Post Types 6.4 normal normal Awaiting Review defect (bug) new 2024-03-18T10:03:04Z 2024-03-18T10:03:04Z "Since **6.4.0** the `$revisions_enabled` argument was added to the arguments array of `register_meta()` function (https://developer.wordpress.org/reference/functions/register_meta/#changelog). For post and page with disabled revisions support there is an error: Error: Function register_meta was called incorrectly. Meta keys cannot enable revisions support unless the object subtype supports revisions. Please see Debugging in WordPress for more information. (This message was added in version 6.4.0.). In register_block_core_footnotes() function `revisions_enabled` argument is permanently set to true and it's makes this error." danielpietrasik Tickets Awaiting Review 52519 Anchor links not working on password-protected pages (on first click) Posts, Post Types 5.6.1 normal normal Awaiting Review defect (bug) new 2021-02-13T17:40:11Z 2021-02-14T07:31:00Z When first clicking an anchor link, the target of which is a password-protected page, and entering the password, the page is loaded without the #anchor in the URL and without jumping to the anchor content. The person has to go back and click the link again after entering the password to jump to the anchor on the page. chrslcy Tickets Awaiting Review 49109 Array offset access notice problem with `remove_meta_box()` and `add_meta_box()` function. Posts, Post Types 5.3.2 normal critical Awaiting Review defect (bug) new 2019-12-31T13:57:29Z 2020-02-26T10:56:19Z "When I use `remove_meta_box()` function: {{{#!php post_content, '' ) && ( ! $multipage || $page == 1 ) ) }}} as you see, $post->post_content is queried. Then if $post is null, the program falls. A solution can be to check: {{{#!php false`. But here is the interesting part: {{{ 'delete_post' => null, 'delete_posts' => false, }}} To prevent deletion, I need to specify exactly like above, otherwise I will get notices from WP. In my opinion, we should have 1 approach, like `false`" slaFFik Tickets Awaiting Review 59085 Command Palette - switching posts wrong url redirect for non FSE sites Posts, Post Types 6.3 normal normal Awaiting Review defect (bug) new 2023-08-12T12:24:23Z 2023-08-12T12:24:23Z "With the new update to WordPress 6.3, they introduced the command palette. This is great for quickly and easily switching between posts and other things. It is enabled for all sites (including sites not using a FSE theme) However, when trying to switch to a different post, it redirects me to: {{{/wp-admin/site-editor.php?postType=post&postId=12621}}} Which I then get the error: {{{The theme you are currently using is not compatible with the Site Editor.}}} The command should change the slug it tries to visit depending on if your site supports FSE or not. Either: {{{/wp-admin/post.php?post=12621&action=edit}}} or {{{/wp-admin/site-editor.php?postType=post&postId=12621}}} " tdrayson Tickets Awaiting Review 40079 Content of static pages does not show when you have a count_post in the theme Posts, Post Types 4.7.3 normal normal Awaiting Review defect (bug) new 2017-03-09T14:08:13Z 2017-03-09T14:14:38Z "in page.php when you have elsewhere: {{{#!php publish; $numberofcats = wp_count_terms('category'); echo ""

"".$posts."" articles in "".$numberofcats. "" categories:

""; ?> }}} then the content inside the loop of a static page will display the content of an article. well for me i fixed it with: {{{#!php "".$count_posts->publish."" articles in "".$numberofcats. "" categories:

""; ?> }}} I am testing it on a custom theme but with plain code you will see this too. tested it on a plain installation with custom theme in page.php: {{{

Categories:

publish; $numberofcats = wp_count_terms('category'); echo ""

"".$posts."" articles in "".$numberofcats. "" categories:

""; ?>

"">

}}} " devlink1337 Tickets Awaiting Review 57741 "Core throwing 'Attempt to read property ""post_type"" on null'" Posts, Post Types 6.1.1 normal normal Awaiting Review defect (bug) new 2023-02-17T04:04:23Z 2023-02-17T10:25:39Z "A calls B. B calls C. C is calling get_post() passing in args from B. C then proceeds to immediately use the results of get_post() ($post->post_type) without checking the response, resulting in an edge condition where a warning is thrown: Attempt to read property ""post_type"" on null A: https://github.com/WordPress/WordPress/blob/f0789b64238a97adc3ce0c9b8cdf33c1753f550c/wp-admin/post.php#L186-L189 B: https://github.com/WordPress/WordPress/blob/f0789b64238a97adc3ce0c9b8cdf33c1753f550c/wp-admin/edit-form-blocks.php#L249-L253 C: https://github.com/WordPress/WordPress/blob/f0789b64238a97adc3ce0c9b8cdf33c1753f550c/wp-includes/media.php#L4552-L4558" haykuro Tickets Awaiting Review 29117 Custom Field metabox shows table header information even though it has no data to show. Posts, Post Types 2.9 normal normal Awaiting Review defect (bug) new has-patch 2014-08-05T13:33:42Z 2019-06-20T12:36:47Z This can be verified by adding a post and then submitting an empty meta key and meta value. A validation error occurs but at the same time the table header information is displayed. Ankit K Gupta Tickets Awaiting Review 47041 Custom Post type author empty Posts, Post Types 5.1.1 normal normal Awaiting Review defect (bug) new 2019-04-25T11:30:05Z 2020-04-22T06:20:09Z "If I created Custom post type with rest enabled [ for Gutenberg support ] and I try to created/publish custom post type then Post author is empty instead of the current user I checked with bbPress Post type forum, For enabled rest support, refer the following code {{{#!php function twentyseventeen_rest_support_bbpress() { global $wp_post_types; $forum_post_type = bbp_get_forum_post_type(); if (isset($wp_post_types[$forum_post_type])) { $wp_post_types[ $forum_post_type ]->show_in_rest = true; } } add_action('init', 'twentyseventeen_rest_support_bbpress', 25); }}} " dipesh.kakadiya Tickets Awaiting Review 59766 Custom post type archive URLs are being resolved in an unexpected way if a page with the same slug exists and the URL's casing doesn't exactly match the custom post type's rewrite slug Posts, Post Types 6.3.2 normal normal Awaiting Review defect (bug) new has-patch 2023-10-30T13:34:38Z 2024-01-18T20:19:53Z "== Steps to reproduce: - Have a custom post type with an archive slug of `/projects/` - Have a post with post_type `page` with an identical slug, e.g. ""Projects"", with a slug of ""/projects/"" - Visit ""https://example.com/Projects"" (note the Titlecase spelling here) - Observe how the request is being resolved to the single page ""Projects"" instead of the (expected) post type archive page, even though the rule for the post type comes first. == Proposed solution - I was able to fix this behavior locally by making all archive rewrite rules for custom post types case-insensitive. In `class-wp-post-type.php`, line #658: {{{#!php name"", 'top' ); // ... }}} " nonverbla Tickets Awaiting Review 50843 Default category for custom posts when post_content is empty Posts, Post Types 5.5 normal normal Awaiting Review defect (bug) new 2020-08-04T15:44:52Z 2020-08-11T19:08:40Z "If you enter only the post_content and save, or enter the post_title and post_content and save, the default category is selected and it works as intended. But when I type in only the post_title and save it, no categories appear to be selected. Upon investigating the reason, if no post_content is entered, the post_status value will be ""auto_draft"" and as a result the default category will not be applied. Is the above as expected? WordPress: 5.5-RC1-48708" tmatsuur Tickets Awaiting Review 41727 Draft page loses its hierarchy on save when other pages are drafts in hierarchy Posts, Post Types 4.8.1 normal normal Awaiting Review defect (bug) new 2017-08-25T13:12:54Z 2020-12-15T22:48:25Z "How to reproduce: 1. Create a set of pages with a status publish 2. Set hierarchy to pages 3. Change the status to of the aforementioned set to draft 4. Open draft for editing. 5. Save as draft. 6. Now you have lost the hierarchy. I think you should retain the hierarchy, because it is quite common use case to build something as drafts before publishing them or taking pages to drafts if they are in need for editing and the user wants them out before edits are done. Tickets possibly related #15541 and #12890. " stode Tickets Awaiting Review 45801 Duplicate post publish action Posts, Post Types 5.0.2 normal normal Awaiting Review defect (bug) new 2018-12-31T21:53:44Z 2019-01-07T08:37:45Z "I'll try to keep this short. Action ""publish_to_publish"" is being called twice when updating a published post under some circumstances. Web server registers two calls (one to index.php, one to /wp-admin/post.php). First call appears to update the content and non-meta data. Second call updates data from meta blocks. Specifics: Any theme or plugin that adds meta data to a post forces a second call to the update process with the meta block data. Problem: Any plugin that performs actions based on ""publish_to_publish"" is being called twice. In my specific instance the Better Notifications for WordPress plugin sends notifications mails doubled. Wordpress version: 5.0.2 Theme: Customify, no plugins Or Theme: TwentyNineteen, and Plugin: Profile Builder Basically anything that adds meta-data to a post object causes a second, duplicate, action. If meta-data updates should trigger a second action, how can a plugin detect that there has been an additional call?" bmettee4 Tickets Awaiting Review 55905 Edit date / quick edit not working Posts, Post Types normal normal Awaiting Review defect (bug) new 2022-06-02T16:43:24Z 2022-06-02T16:43:24Z "On one of my WordPress sites, after updating, if I click the ""edit"" link on the publish date or the 'quick edit' on the post list, it doesn't do anything. I've tried deactivating all the plugins and it's still doing it. It is fine on another WordPress site I have. " angiefsutton Tickets Awaiting Review 41573 Editor and Quick Edit display the slug of a page selected as static front page Posts, Post Types 4.8.1 normal normal Awaiting Review defect (bug) new 2017-08-06T16:52:02Z 2017-08-06T17:22:26Z "Dear Happy Engineers of WP! I'm writing about a possible WP BUG after consulting the issue with 'AThemes Support' that tells me there is this possibility... The issue is about a SLUG that can not be cancelled in a ""Homepage"" (it has been a normal page before choosing it as Static Frontpage...) But please, in order to don't repeat the conversation of the issue, I beg you to read it in the following link where is more clear... https://wordpress.org/support/topic/slug-homepage-static-page-seo-front-page-wp/ Thank you a lot! " cekar Tickets Awaiting Review 58512 Enhancing Security and User Experience: Addressing Password Length Limitations and Improving Validation Process Posts, Post Types 6.2.2 normal normal Awaiting Review defect (bug) new dev-feedback 2023-06-12T11:08:25Z 2023-07-14T11:31:15Z "When I attempted to use a password consisting of 256 characters and tried to publish my post, I encountered an error message stating, ""Updating failed. Could not update post in the database."" It appears that this issue may affect all users. Therefore, I kindly request that you consider addressing this problem by either fixing it or implementing validation on the input field to prevent such errors in the future. I used below password for password protect post : 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 **Total Characters: 255** Could you please verify the attached video URL, https://www.awesomescreenshot.com/video/18248088?key=dd7a62697a5b66aaf5d332dec3a0a9b9" utsav72640 Tickets Awaiting Review 59348 Excerpt block length is not full customizable any more Posts, Post Types normal normal Awaiting Review defect (bug) new 2023-09-14T11:40:32Z 2023-09-14T15:19:35Z "Since the latest changes in /src/wp-includes/blocks/post-excerpt.php now the excerpt length is not fully customizable any more. The problem is that previously `$excerpt = get_the_excerpt();` was used, which was filterable with `get_the_excerpt`, but now this excerpt is just getting forcefully trimmed by `wp_trim_words` based on the `excerptLength` option. Which is: a) A number forced to be between 10-100 b) now can not be changed or overwritted with custom code in any way. If I want to display the excerpt of a post on the post's page, now there is no way to correctly display an excerpt that is longer than 100 words. I think this is a loss in features and a bad practice to limit the excerpt's usage in this way. At least allow `$excerpt_length = $attributes['excerptLength'];` to be modified with the already existing `excerpt_length` filter. Mentioned change: https://core.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&new=56065%40trunk%2Fsrc%2Fwp-includes%2Fblocks%2Fpost-excerpt.php&old=55246%40trunk%2Fsrc%2Fwp-includes%2Fblocks%2Fpost-excerpt.php" frzsombor Tickets Awaiting Review 50002 Hack in get_sample_permalink() can cause filters like post_link, and pre_post_link to have inaccurate post_status in admin Posts, Post Types 5.4 normal normal Awaiting Review defect (bug) new needs-unit-tests 2020-04-24T20:07:13Z 2020-04-26T12:35:32Z "For context: https://github.com/aubreypwd/WordPress/issues/5 When editing a post (that is a draft) in the admin, add a filter to `post_link` you'll notice that the pass for `get_sample_permalink()` shows that `$post->post_status` is set incorrectly (un-truthfully) to `publish`. This is because of a 12 year old block of code in `get_sample_permalink()`: {{{ // Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published. if ( in_array( $post->post_status, array( 'draft', 'pending', 'future' ) ) ) { $post->post_status = 'publish'; $post->post_name = sanitize_title( $post->post_name ? $post->post_name : $post->post_title, $post->ID ); } }}} In order for `post_link` and even `pre_post_link` filters to pass accurate info about a post, the patch I have attached is my first attempt at ensuring `get_sample_permalink()` still gets the same result, while not affecting `post_status`. Obviously I tested this, but I still feel some more testing will need to be done. " aubreypwd Tickets Awaiting Review 57634 "Hide ""view"" link from Post List Table if empty string passed to post_link" Posts, Post Types 1.5 normal normal Awaiting Review defect (bug) new has-patch 2023-02-04T18:48:02Z 2023-02-04T19:05:57Z "As in [https://core.trac.wordpress.org/ticket/54824 54824] also in Post List Tables an empty string passed to `post_link` should hide ""view"" link. Actually link is just empty: {{{ View }}} In my opinion ""view"" link should be removed if permalink is empty." uzumymw Tickets Awaiting Review 47072 Hierarchical post types missing attributes meta box if post type doesn't support 'page-attributes' or have templates Posts, Post Types 5.1.1 normal minor Awaiting Review defect (bug) new 2019-04-29T17:11:09Z 2019-04-29T17:11:09Z Setting the hierarchical argument to true in the register post type function doesn't enable the post parent automatically. In order for this meta box to show up you must also enable post type support for page-attributes or the post type must have templates. I would think the post parent dropdown should be visible by default if the post type is hierarchical. This applies to both the Classic and Gutenberg editor. natereist Tickets Awaiting Review 59664 I have tested beta 6.4 version and some issue on mobile device Posts, Post Types normal normal Awaiting Review defect (bug) new 2023-10-17T20:08:04Z 2023-10-27T20:57:00Z "I have tested WordPress Beta 6.4 RC1 version and some issue. https://wordpress.slack.com/archives/C02RW657Q/p1697563998445079 Post listing page arrows is not doing anything. For more information see mentioned screenshots and recording. Also credit page on text color issue. " sumitsingh Tickets Awaiting Review 43752 ID, post_parent, menu_order on global $post object is a string in edit context; expecting int Posts, Post Types 4.9.5 normal normal Awaiting Review defect (bug) new needs-unit-tests 2018-04-12T23:34:08Z 2018-04-19T00:27:16Z "When I'm on an edit post screen, the ID, post_parent, menu_order attributes on the global $post object are strings. I expect them to be integers. To quickly check, put this in a plugin: {{{#!php ID); }); }); }}} Here's what's happening: 1. in wp-admin/post.php the edit case happens, and within that the post gets reloaded here: https://github.com/WordPress/WordPress/blob/4.9.5/wp-admin/post.php#L167 2. that function will run the post object through its own filter with filter edit here: https://github.com/WordPress/WordPress/blob/4.9.5/wp-includes/post.php#L552 3. because at the time $this->filter = ""raw"", and the $filter is edit, that will run the object through sanitize_post here https://github.com/WordPress/WordPress/blob/4.9.5/wp-includes/class-wp-post.php#L354 4. sanitize_post will, in turn, run all the fields through sanitize_post_field here: https://github.com/WordPress/WordPress/blob/4.9.5/wp-includes/post.php#L1940 5. and even though we have 3 fields set as int (https://github.com/WordPress/WordPress/blob/4.9.5/wp-includes/post.php#L1973), by the time we get to this part (https://github.com/WordPress/WordPress/blob/4.9.5/wp-includes/post.php#L2027-L2034), those three will be ran through esc_attr 6. esc_attr will feed it through _wp_specialchars here https://github.com/WordPress/WordPress/blob/4.9.5/wp-includes/formatting.php#L3978 7. which begins with $string = (string) $string; here https://github.com/WordPress/WordPress/blob/4.9.5/wp-includes/formatting.php#L912 The part that throws me off is that `sanitize_post_field` declares these three properties to be integers at the beginning of the function, so I sort of expected them to come out as integers on the other end." javorszky Tickets Awaiting Review 49294 If multiple posts has same date, get_previous_post() and get_next_post() returns only first/last of them Posts, Post Types normal normal Awaiting Review defect (bug) new 2020-01-26T12:45:02Z 2020-10-06T06:04:04Z "get_previous_post() and get_next_post() both uses get_adjacent_post() -function, which uses date for query. If query return multiple posts for same date, function only returns first or last post depending on $previous -parameter. As a result, if you have multiple posts for a same date, get_previous_post() and get_next_post() functions does not work as meant to. Found one mention about this issue about a year earlier: https://wordpress.stackexchange.com/questions/330276/get-next-post-and-get-previous-post-return-wrong-posts " oskarijarvelin Tickets Awaiting Review 50435 In some cases wp_get_post_parent_id() = get_post_ancestors Posts, Post Types 5.4.2 normal normal Awaiting Review defect (bug) new 2020-06-19T21:00:44Z 2020-06-19T21:06:23Z "Using wp_get_post_parent_id() while parsing gutenberg blocks in a save_post action, I found out, that when a parent page exists, and parent_id is the actual published post wp_get_post_parent_id() gives back the post_id of the parent page. A turn around seems to be ($postParent == $postId) ? $post_current_ID : $postId; " chvon7thal Tickets Awaiting Review 53044 Issue on mobile device when try to post QUICK EDIT. Posts, Post Types 5.7.1 normal normal Awaiting Review defect (bug) new 2021-04-15T18:24:10Z 2021-05-13T16:00:24Z "Hi, I have setup updated WP latest version 5.7.1. and some UI issue on mobile device when i am trying to quick edit Post on mobile. More information you can see mentioned screenshot. Thank you" sumitsingh Tickets Awaiting Review 51268 Issue with excerpts Posts, Post Types 5.5.1 normal normal Awaiting Review defect (bug) new 2020-09-08T19:01:04Z 2020-09-08T19:01:04Z "This is a follow-up to #51042. Hope this is the correct place to report this. Regarding 50142, I have several customer sites (at least 50) in which we type a space in the Excerpt field in order for an Excerpt not to display. It displays the space, which is invisible. But with your change above, WordPress 5.5.1 is ignoring the typed space and displaying the excerpts, which we do not want. I'm going to have about 50 customers ask me how to fix this over the next few weeks when they start to notice the issue. If I type the code for a non-breaking space, the issue goes away but they'd have to manually adjust this on all posts. Can this be adjusted so that WordPress still recognizes a typed space as a single character excerpt? Thank you. I also posted on the WordPress forum at [https://wordpress.org/support/topic/odd-issue-with-excerpts/#post-13378581]" HollyKNY Tickets Awaiting Review 54301 It is not possible to set 0 as post title Posts, Post Types 2.5 normal normal Awaiting Review defect (bug) reopened has-patch 2021-10-20T17:09:39Z 2022-01-27T21:35:11Z I want to have a post and its title is 0 but when I set 0 as the post title, after saving, it shows (no title). h71 Tickets Awaiting Review 40786 Leading spaces are added to custom textarea metabox Posts, Post Types 4.7.5 normal normal Awaiting Review defect (bug) reopened 2017-05-17T14:22:55Z 2017-05-17T17:48:51Z "I am using `esc_atr(ltrim(rtrim(br2nl($meta_value))))` to place the value of post meta in textarea metabox I have created in my custom post type. {{{#!php }}} But whenever I go to edit the post, inside all textarea metaboxes values are pre-loaded with leading spaces (exactly 10 spaces) and additional line breaks! Also tried `esc_atr(trim(br2nl($meta_value)))` with no avail." subrataemfluence Tickets Awaiting Review 44631 Limit the displayed search phrase for the posts list table Posts, Post Types normal normal Awaiting Review defect (bug) new has-patch 2018-07-24T09:31:00Z 2018-07-24T09:42:25Z "When searching for long text in the ''comments'' list table, the displayed search phrase is limited by 50 characters by using {{{wp_html_excerpt()}}}. On the other hand when searching for long text in the ''posts'' list table, the displayed search phrase is unlimited. It would be nice to have this consistent between those two tables. Later (another ticket) we could also consider ''plugins'', ''users'', ''media'', ''sites'', ... list tables that also display unlimited search phrase." birgire Tickets Awaiting Review 39624 Misleading warning when editing the page_for_posts page Posts, Post Types normal normal Awaiting Review defect (bug) new 2017-01-18T14:58:00Z 2018-01-15T17:44:25Z "Whilst I was using Twenty Seventeen, I discovered some unusual page locking. It seemed the blog page was locked and I was unable to edit it, despite it being apparently not locked. I've not experienced this before and whilst it feels like a rare experience, I wanted to bring it to attention incase there was something deeper wrong. [https://cldup.com/qn5iA2HXBR.mp4 Here is the video.] Along with this, I experienced a further issue that I almost feel needs another ticket but going to throw it in together. I found I could upload and change featured images, despite a page lock. This felt weird and something I'd expect to not be able to happen. Note: I can't see a pages component so putting under posts but unsure if correct placement." karmatosed Tickets Awaiting Review 56479 Missing capability shows blank page in WP-Admin Posts, Post Types 6.0.2 normal normal Awaiting Review defect (bug) new 2022-08-31T16:34:07Z 2023-03-12T21:53:38Z "Hello, I have created a **custom post type** with the following code. {{{#!php _x('Fortbildungen', 'Post Type General Name', 'ibf'), 'singular_name' => _x('Fortbildung', 'Post Type Singular Name', 'ibf'), 'menu_name' => __('IBF', 'ibf'), 'name_admin_bar' => __('IBF-Fortbildung', 'ibf'), 'archives' => __('IBF-Archiv', 'ibf'), 'all_items' => __('Alle Fortbildungen', 'ibf'), 'add_new_item' => __('Neue Fortbildung', 'ibf'), 'add_new' => __('Neue Fortbildung', 'ibf'), 'new_item' => __('Neue Fortbildung', 'ibf'), 'edit_item' => __('Fortbildung bearbeiten', 'ibf'), 'update_item' => __('Fortbildung speichern', 'ibf'), 'view_item' => __('Fortbildung anzeigen', 'ibf'), 'view_items' => __('Fortbildungen anzeigen', 'ibf'), 'search_items' => __('Fortbildung suchen', 'ibf'), ); $args = array ( 'label' => __('IBF', 'ibf'), 'description' => __('Fortbildungen verwalten', 'ibf'), 'labels' => $labels, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'revisions', 'custom-fields'), 'show_in_rest' => true, 'hierarchical' => false, 'public' => true, 'show_in_menu' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-welcome-learn-more', 'has_archive' => true, 'rewrite' => array('slug' => 'ibf'), 'capability_type' => 'post', 'capabilities' => array ( 'edit_post' => 'edit_ibf', 'edit_posts' => 'edit_ibfs', 'edit_others_posts' => 'edit_others_ibf', 'publish_posts' => 'publish_ibf', 'read_post' => 'read_ibf', 'read_private_posts' => 'read_private_ibf', 'delete_post' => 'delete_ibf', 'create_posts' => 'create_ibfs', ), ); register_post_type('ibf', $args); } add_action('init', 'customPostTypeIBF', 0); }}} Then I adjusted the **wp_user_roles** field in the database so that the permissions are also set appropriately based on the role. Now when I don't have the **create_ibf** permission I get the following message in the admin panel: [[Image(https://i.ibb.co/2dPcrWh/error-ok.png)]] Thats right and it works! **Now the problem:** When I don't have the **edit_ibf** ''(without S at the end)'' permission I just get a white page (blank page) in the admin panel. Now error message or so. Only a white page. The source code shows the page but in the browser I cant see anything. If I use the developer tools I get the following error message: [[Image(https://i.ibb.co/gjjyhkZ/error-white.png)]] If I follow the link in the error message I can see that: [[Image(https://i.ibb.co/3dFQ8Sh/wp-rest-error.png)]] So I think here is a error message missing. **And now another funny thing:** When I havent the permission **edit_ibf** and disable the **block editor** with the parameter: {{{#!php false, }}} the page is loading: [[Image(https://i.ibb.co/dGJPdj3/ibf-ohne-blockeditor.png)]] I think something is wrong here. Maybe someone can take a look and fix this. At least the error message that you don't have enough rights would make sense, since you're looking for the error for a long time. Thanks in advance! **My Live-Server:** Ubuntu 20.04.3 with PHP 8.0.22 and MariaDB 10.5 **My Test-Server (used here for reporting):** Windows 11 with XAMPP and PHP 8.0.19 and a fresh install from 18:00 Uhr" vincenz17 Tickets Awaiting Review 52101 Need to add trash option for Draft Reusable Blocks Posts, Post Types 5.6 normal normal Awaiting Review defect (bug) new 2020-12-17T10:29:34Z 2020-12-31T01:07:58Z "For Reusable Blocks, there is no option for Reusable Blocks draft to trash. Please check and let me know. Screenshot - https://www.screenpresso.com/=GpEBb" rkradadiya Tickets Awaiting Review 60777 New terms created when a term with commas is added in post editor Posts, Post Types 6.4.3 normal normal Awaiting Review defect (bug) new 2024-03-14T17:35:07Z 2024-03-14T17:35:07Z "When a taxonomy term has commas e.g ""Red, yellow & green"" and you add the term to a post in the post editor, the term gets added but new terms get created for the words before and after each comma. E.g you add the term ""Red, yellow & green"" to your post. That term will get added. However, you will also notice that two new terms have been created called ""Red"" and ""yellow & green"". Not sure if this is the case with both Gutenberg enabled." awesiome Tickets Awaiting Review 44270 Non-public custom post types have rewrite rules enabled by default Posts, Post Types normal trivial Awaiting Review defect (bug) new has-patch 2018-05-29T22:02:32Z 2018-10-03T17:54:46Z "Is there a reason for the pairing of `public => false` with `rewrite => true` for default custom post type arguments? If there isn't can we change the default `rewrite` to inherit `public` at runtime? I often see a large rewrite rules array from plugin/theme private post types not declaring `rewrite => false` - if there's no need for them seems bit of a waste - a default WP install is 17 rules per post type, 17 possible unnecessary regex checks per-request. Usually it's two or three CPTs I see per site and they stack up quick." TheDeadMedic Tickets Awaiting Review 58205 Not able to create or edit new posts and pages in WordPress 6.2. Posts, Post Types 6.2 normal major Awaiting Review defect (bug) new 2023-04-27T09:53:02Z 2023-04-27T09:53:02Z "Dear WordPress Core Team, I was not able to create a new post or a new page recently. It just showed me the white screen of death :D. Nor was I able to edit any existing pages. It also showed a blank white screen and tried to reload the site a few times. So I tried a lot to fix it, basically what I did was all the steps from this guide. https://www.greengeeks.com/tutorials/how-to-fix-the-blank-white-screen-error-in-wordpress/ None of it worked. The only thing that helped me in the end was to reinstall WordPress to 6.1.1 instead of 6.2. OS: Windows 11 Browser: Mozilla Firefox latest Version Host: NameHero.com I am a beginner developer, so have mercy with my report. Hope this helps you out! Kind regards, Michael" newpr0 Tickets Awaiting Review 59014 PHP Fatal error in post-template.php Posts, Post Types 6.3 normal minor Awaiting Review defect (bug) new 2023-08-09T03:40:21Z 2023-10-31T00:34:33Z "Hi there, I hope this email finds you well. Unfortunately, we've recently encountered a critical error that requires immediate attention. This issue pertains to the single page templates, specifically an example like this: https://volunteeringqld.org.au/governance/before-you-join/. The error was not present a week ago, and we're currently grappling to determine its cause. This problem was initially observed on both WP6.22 and WP6.3. The post https://volunteeringqld.org.au/governance/before-you-join/ connected to a single template php `mytemplate/single-governance-before-you-join.php`, what calls `` what throws error ""There has been a critical error in this website"" and output steam finishes. Log error gives this line: {{{ ""PHP message: PHP Fatal error: Uncaught TypeError: Unsupported operand types: WP_Post - int in /.../wp-includes/post-template.php:330 Stack trace: #0 /.../wp-includes/post-template.php(247): get_the_content() #1 /.../wp-content/themes/volunteeringAU/single-governance-before-you-join.php(411): the_content() #2 /.../wp-includes/template-loader.php(106): include('...') #3 /.../wp-blog-header.php(19): require_once('...') #4 /.../index.php(17): require('...') #5 {main} thrown in /.../wp-includes/post-template.php on line 330', referer: https://volunteeringqld.org.au/governance/"" }}} To address this, we have applied the following code snippet in `post-template.php` line 330: {{{ if( ! is_int($page_no)) { $page_no = 1; // Igor //echo ''; } }}} When echo ancommented it gives {{{ Array ( [page] => WP_Post Object ( [ID] => 5 [post_author] => 7 [post_date] => 2021-10-21 04:24:08 [post_date_gmt] => 2021-10-21 04:24:08 [post_content] => [post_title] => Home [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => home [to_ping] => [pinged] => [post_modified] => 2023-05-26 13:50:03 [post_modified_gmt] => 2023-05-26 03:50:03 [post_content_filtered] => [post_parent] => 0 [guid] => https://volunteeringqld.org.au/?page_id=5 [menu_order] => 0 [post_type] => page [post_mime_type] => [comment_count] => 0 [filter] => raw ) [more] => 1 [preview] => [pages] => Array ( [0] =>

Achieving a good transition to the next volunteer who will take over from you has benefits for you, the organisation, and the incoming governance member. Let’s explore things you can do to ensure a good handover.

In this stage of your Governance journey we explore:

) [multipage] => 0 ) }}} As you can see, instead of having 1 in `$elements['page']`, it contains a `WP_Post` object of the very first post from the database, even not the one that is displayed. We are hopeful that this information helps you in resolving the issue and that a solution will be included in an upcoming patch. Please don't hesitate to reach out if you require more details or assistance. Best regards, Igor " volqld Tickets Awaiting Review 51867 Page Parent dropdown is a huge mess Posts, Post Types 5.0 normal major Awaiting Review defect (bug) new 2020-11-24T16:14:53Z 2020-11-29T22:20:30Z "I have seen a few posts (including in this forum) related to this topic, but none seems to exactly address what is going on. Even when I disable all plugins and change to a default theme, the Page Parent dropdown is a huge mess — this is true of two different websites I manage, each of which has hundreds of Pages (plus posts and other custom post types). The problem is that (a) the Page Parent dropdown lists many pages multiple times (literally some pages will appear three or four times in the dropdown, and it seems to repeat a loop) and (b) not all pages are there. So even though it's showing a few multiple times, some don't appear even once. The work-around seems to be to create a new page, then return to ""All Pages"" and make the parent relationship in Quick Edit. It works, but it is a tremendous inconvenience." jamesdonegan Tickets Awaiting Review 60482 Password Protected stops working Posts, Post Types 6.4.3 normal normal Awaiting Review defect (bug) new 2024-02-09T03:56:15Z 2024-02-09T03:56:15Z I have a site with 4 pages with different passwords to protect them. Every now and then the password just stops working and I need to edit the page, copy and paste the same password in and save it. Then it continues to work again for a while. I number of people visiting the site have reported the same issue. kitka Tickets Awaiting Review 44759 Percent-encoded unicode characters in CPT rewrite slug prevent finding the CPTs on the front-end Posts, Post Types normal normal Awaiting Review defect (bug) new 2018-08-08T18:03:23Z 2018-08-09T03:17:11Z "If you register a custom post type whose rewrite slug has percent-encoded unicode characters in it, the posts can't be found on the front-end. Eg {{{#!php 'unicode-cpts', 'public' => true, 'rewrite' => array( 'slug' => '%E6%BC%A2%E8%AA%9E%3B' // doesn't work // 'rewrite_slug' => '漢語' // works ) ) ); } add_action('init','register_unicode_cpt'); }}} Seems to initially work fine, the ugly percent-encoded unicode characters don't appear in the post editor (Eg https://drive.google.com/a/eventespresso.com/file/d/1d1j6skbgxrA7IJocGvYi5UMQ_Xw3sCrV/view?usp=drivesdk), but when I go to view the CPT, I'm being redirected to the homepage, (or, when my homepage displays latest posts, I'm seeing those without being redirected). It seems some code needs to recognize percent-encoded rewrite slugs are the same as the unicode character ones. The workaround is to use the unicode characters directly, which is technically against the RFC (see https://stackoverflow.com/questions/2742852/unicode-characters-in-urls/2742985#2742985)" mnelson4 Tickets Awaiting Review 58062 Positioning of custom post type submenu Posts, Post Types 3.1 normal normal Awaiting Review defect (bug) new 2023-04-02T22:48:57Z 2023-04-12T19:21:47Z "''Current Functionality (since 3.1.0):'' One can add a CPT as a submenu of another CPT by setting the `show_in_menu` argument of the `register_post_type()` function as `edit.php?post_type=CUSTOM_CPT_SLUG`. The submenu is then added into the administration menu by way of the `_add_post_type_submenus()` function. When this occurs, the submenu CPT's are displayed in the order the CPTs were registered. ''Problem:'' The current coding prohibits the ordering of CPT submenu items per the programmer's desires in the event CPT registration is unable to be controlled or in the event other submenu pages are added via the `add_submenu_page()` method. This occurs because the call to [https://developer.wordpress.org/reference/functions/add_submenu_page/#source add_submenu_page()] by [https://developer.wordpress.org/reference/functions/_add_post_type_submenus/#source _add_post_type_submenus()] only passes 5 arguments. (The sixth omitted argument is what handles menu positioning.) ''Solution:'' The `menu_position` argument passed to the `register_post_type()` function already exists, and defines a CPT's positioning within a menu. The solution is to incorporate this argument into the core by modifying line 2079 of [https://core.trac.wordpress.org/browser/tags/6.2/src/wp-includes/post.php#L2079 wp-includes/post.php] as follows: {{{ add_submenu_page( $ptype_obj->show_in_menu, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, ""edit.php?post_type=$ptype"", isset($ptype_obj->menu_position) ? $ptype_obj->menu_position : NULL ); }}} " mort1305 Tickets Awaiting Review 53418 Post Status Transition missing Hook Posts, Post Types 5.7.2 normal blocker Awaiting Review defect (bug) new dev-feedback 2021-06-15T23:42:17Z 2021-06-15T23:42:17Z "REF: https://codex.wordpress.org/Post_Status_Transitions So I have been testing this and found there is an issue creating the post type **new to pending**: {{{#!php Two [@ UTC 1900 (my timezone is set to New York UTC-5 1300)] > One [@ UTC 1800 (my timezone is set to UTC 1800)] Since 1300 is before 1800. Ordered by my `date` ---- Proposed post sequence > One [@ UTC 1800 (my timezone is set to UTC 1800)] > Two [@ UTC 1900 (my timezone is set to New York UTC-5 1300)] Since 1800 is before 1900. Ordered by absolute `date_gmt`." nickylimjj Tickets Awaiting Review 46296 Posts set to 'private' and password protected should return a 403 HTTP header status Posts, Post Types normal minor Awaiting Review defect (bug) new has-patch 2019-02-21T09:47:51Z 2023-07-10T16:17:33Z "These currently output a 200 status, which may result in search engines and external agents indexing them. If the user doesn't have access permissions, a 403 header status should be returned. [[Image(https://ci3.googleusercontent.com/proxy/1s4a4RyK3Oxal9c6hENPJ8kBEsn7Dc3AnwjdTUsFPg-Yg2Eb5PSOTCZWzm6v6CM3Jb_F7Oerojh9MPVkkivaxGdsuITKENP-D7FbF8a9JDFDFH-D77zEKyKXnHM3nqHrtOgMFCrg68sS4j1HtnO5m3j3PQaA=s0-d-e1-ft#https://user-images.githubusercontent.com/487629/53154266-af22e680-35ba-11e9-9f4e-eb520634ffff.png)]]" jonoaldersonwp Tickets Awaiting Review 40325 Potential bug with the “get_post_type” function Posts, Post Types 4.7.3 normal normal Awaiting Review defect (bug) new 2017-03-31T12:04:13Z 2020-12-14T12:56:20Z "I have encountered a weird behavior in the WP code, and I want to report it, in case it is a bug. I have posted it in the Support forum first and I was advised to make a ticket here. '''Replication:''' I have a custom post type created. A function is added to the '''before_delete_post''' hook. In this function, I am verifying the current post type. I used to verify it with the '''get_post_type();''' function but I have found a problem with that in some cases. Now, I have replaced it with '''global $post_type;''' {{{ class My_Example { public function build_admin() { add_action('before_delete_post', array($this, 'delete_post')); } public function delete_post($post_id) { $case1 = get_post_type(); global $post_type; $case2 = $post_type; } } }}} On the posts listing page, in the Trash table, there are 3 says of deleting posts: 1. The '''Delete Permanently''' button for each post. 2. The '''Empty Trash''' button. 3. And through '''Bulk Actions > Delete Permanently > Apply'''. The '''get_post_type''' function returns the proper post type name only in the 1st case. For the other 2 cases, it returns '''false'''. However, '''global $post_type''' returns the proper value in all cases. I don’t know if it is a bug but it seems that way on the surface. If the global post type variable is set well, then the function should be able to return it too but I am not sure if something else it at play here. A bit more info: Looking over the source code for the [https://developer.wordpress.org/reference/functions/get_post_type/ get_post_type] function in Code Reference, I see that it is using the [https://developer.wordpress.org/reference/functions/get_post/ get_post] function to retrieve an object, instance of '''WP_Post''', from which it gets the post type. So, the value is retrieved from different locations in the two examples. " ancientro Tickets Awaiting Review 60210 Preserving Link When Replacing the Image of an Image Block within Unsynced Patterns Posts, Post Types normal minor Awaiting Review defect (bug) new 2024-01-08T14:53:50Z 2024-01-08T14:53:50Z "This may not in fact be a bug, but it seems to be an unusual design if it is of deliberate design... When an unsynced pattern is created containing an image block with a link associated to where clicking said image should take the user, whenever that pattern is again used in future instances, replacing the image erases the link that was originally connected to that image. I feel there should be a way to replace the image within the unsynced pattern, without losing the hyperlink quality associated with the placeholder image in the image block. " prayforsurf0 Tickets Awaiting Review 48047 Querying (non-CPT) posts from more than one (native) category only returning posts from first category Posts, Post Types 5.2.3 normal normal Awaiting Review defect (bug) new 2019-09-16T08:23:54Z 2019-09-16T08:51:26Z "I tried selecting posts from two categories using this code: {{{ $wpQuery = new WP_Query([ 'post_type' => 'post', 'posts_per_page' => 30, 'post_status' => 'publish', 'category__in' => [5, 6], ]); $posts = $wpQuery->get_posts(); }}} This code only returns posts from the first category. I tracked this back to the query variables `category_name` and `cat` being set to the first queried category in the `get_posts()` method. Code from core, `class-wp-query.php`, line 2173: {{{ if ('category' === $queried_taxonomy) { $the_cat = get_term_by($queried_items['field'], $queried_items['terms'][0], 'category'); if ($the_cat) { $this->set('cat', $the_cat->term_id); $this->set('category_name', $the_cat->slug); } unset($the_cat); } }}} It was the same with any equivalent of the `category__in` option, such as using a comma separated list as an argument (`'category_name' => 'news,video'`) or writing my own `tax_query`. When I access the `posts` property on the query object (`$wpQuery->posts`), the correct number of posts is returned. The problem only surfaces when `get_posts()` is called. The bug persists on the Twenty Ninetheen theme without any plugins enabled. Why is `category_name`/`cat` even set to the first category term? If there is a reason, it would make sense to filter out any ""duplicate"" category query vars present before the SQL query is built, because ''both'' `category__in` and `category_name`/`cat` don't make sense. I'm looking forward to insights on this. " lialyn Tickets Awaiting Review 55895 Register custom post statuses Posts, Post Types normal normal Awaiting Review defect (bug) new dev-feedback 2022-06-02T10:21:10Z 2022-06-02T13:42:04Z "When a developer register a custom post status with {{{ register_post_status() }}} The post status is not added to the visual parts of a post this means you can not set the post to this new status after register the new post status. There have been several workarounds to this adding functions to get them visible but with recent WP versions this seems to have stopped working. Another feature to add is regarding the {{{ get_post_statuses() }}} and {{{ get_page_statuses()}}} only returns a static array instead of checking the available post statues. There should also be a filter on this function to Add The correct label for your custom post status. Things to improve: - Expand get_post_statuses() and get_page_statuses() to actually return the registered statuses. Add a filter to be able to label your custom post status correctly. - When custom post status is added it should also be available: • In the post list overview the post status if not published should be in the name like (draft etc) • When quick editing / bulk editing the options of all post status types should be available. • When editing a post the post status should be available in the right settings column this should also work with the classic- and Gutenberg- mode. There is an old ticket with large thread about similar issues here: #12706." angryjim Tickets Awaiting Review 55665 Remove unused margin when post-body-content is empty Posts, Post Types normal normal Awaiting Review defect (bug) new 2022-05-03T14:06:18Z 2022-05-06T15:25:33Z "I created a custom post type that does not support any fields (support argument in $args) It's just a metabox inside But on the page to add that post (add-new post in wp-admin), there is an unused margin in , which creates a space at the top of the page that is related to the tag with the post-body-content ID. I suggest deleting this margin if this tag is empty. thank you [[Image(https://i.imgur.com/fFhFWiT.png)]]" myousefi08 Tickets Awaiting Review 39942 Restored Post may steal slug to published Post Posts, Post Types 4.7.2 normal normal Awaiting Review defect (bug) new 2017-02-22T15:37:10Z 2017-02-22T15:49:15Z "Steps to reproduce: 1. Create a Post 1 with title ""Post"", 2. Assign the slug 'post' to Post 1, 3. Publish Post 1, 4. Unpublish Post 1 by setting it as 'Draft', then Update, 5. After Update, Trash Post 1, 6. Repeat 1-5 for Post 2, 7. Create a Post 3 with title ""Post"", 8. Assign the slug 'post' to Post 3, 9. Publish Post 3, 10. Now restore Post 2, 11. Open/Reload the edit screen for Post 3, 12. It'll show 'post-2' as slug, 13. Saving/Updating Post 3 will change the slug from 'post' to 'post-2'. Probably the following functions participate in the issue: * `wp_add_trashed_suffix_to_post_name_for_post`, which is checking for {{{ if ( '__trashed' === substr( $post->post_name, -9 ) ) { }}} while Post 2 has `post__trashed-2` as post name * `wp_unique_post_slug`, which is not checking the uniqueness of the slug if the post is `draft`." ziodave Tickets Awaiting Review 48106 Revisit post GUID sanitization on `&` Posts, Post Types 5.2.3 normal normal Awaiting Review defect (bug) new 2019-09-23T08:26:37Z 2019-09-28T13:40:16Z "=== The source code of core which needs to be revisit When a new post/attachment is inserted into the database, the post GUID is sanitized and the `&` character in GUID is converted to `&`. More specifically, in `wp-includes/default-filters.php`, function `wp_filter_kses` is added as a default `pre_post_guid` filter. {{{#!php // Save URL foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', 'pre_link_rss', 'pre_post_guid' ) as $filter ) { add_filter( $filter, 'wp_strip_all_tags' ); add_filter( $filter, 'esc_url_raw' ); add_filter( $filter, 'wp_filter_kses' ); } }}} Before a post GUID is saved, function `wp_filter_kses` in `wp-includes/kses.php` is called, and eventually function `wp_kses_normalize_entities` does the real conversion, so that `&` is converted to `&`. === The problem it causes The plugin External Media without Import (https://wordpress.org/plugins/external-media-without-import/) inserts external image URLs as post GUIDs into database so that users can add external images into their media libraries without actually uploading the image files to their WordPress servers. If the image URL contains `&`, such as https://pbs.twimg.com/media/D_NKa3yWkAYwZwn?name=900x900&format=png it is converted to https://pbs.twimg.com/media/D_NKa3yWkAYwZwn?name=900x900&format=png The result is that the image is not correctly displayed in some places, such as the media library page of the admin dashboard. There're also other plugins, such as Imposer (https://github.com/dirtsimple/imposer/) and Postmark (https://github.com/dirtsimple/postmark/), encountering the same issue. Imposer fixes the issue by forcing to save post GUIDs again with the unsanitized version. I think it is equivalent to removing `wp_filter_kses` from the default `pre_post_guid` filters. === The reason of post GUID sanitization Post GUID sanitization was added with a commit in 2011: https://github.com/WordPress/WordPress/commit/81a5f821fbfb63be6c5517d033b8e7a0a4172f07. The commit log message does not state why post GUIDs need to be sanitized on save and display. Also, the commit is so long time ago that seems that even the members of the core channel of WordPress Slack group can't tell the reason. At first it was thought that it is because when exporting RSS feeds, `&` needs to be converted due to XML specification. But I did some experiments and inspected the core source code, and found that in fact WordPress core does convert `&` to `&` while exporting RSS2 feed, even if I changed the `&` back to `&` in the database via MySQL client. The convertion is done by function `wptexturize` in `wp-includes/formatting.php`. The function is added as a default `the_content` filter. So I really don't understand why post GUIDs should be sanitized, especially for the `&` issue. This might be a core issue rather than a plugin issue. It might be fine to not add `wp_filter_kses` as a default `pre_post_guid`, i.e. not do the post GUID sanitization. This issue has also been discussed here: https://github.com/zzxiang/external-media-without-import/issues/17" zzxiang Tickets Awaiting Review 39443 Search Page Template the_category() bug Posts, Post Types 4.7 normal normal Awaiting Review defect (bug) new dev-feedback 2017-01-03T07:38:03Z 2020-01-04T03:30:46Z "Suppose If I've selected three categories following a structure HR -> Reports -> Daily Reports. Single.php shows the structure in the right way but when I use the same the_category () function inside Search template then it shows the different result. Rather than showing it in the default structure, it shows it like Daily Reports -> HR -> Reports. In search template the structure changes to order by name. The_category working perfectly in other pages." cybentizen Tickets Awaiting Review 50467 Search results not displaying all entries in Admin > Posts in certain conditions Posts, Post Types 5.4.2 normal minor Awaiting Review defect (bug) new 2020-06-24T20:54:20Z 2021-08-23T20:41:55Z "**''Limitations of my bug report''** I observed that bug in a live wordpress site, not even mine, so, my apologies, I cannot experiment with it as I would have liked otherwise. No deactivating plugins, no switching to another theme. Thus: I report the issue, explain it the best I can, but I'm leaving it at that. Either (a) it's affecting all wordpress installs, I'm glad I could help by reporting it, or (b) for some reason, it's only the blog on which I've seen it that has it, and then I'm perfectly fine with it, it's just that, me, I cannot tell at all on my side. **''Context of the bug report''** A wordpress blog, latest stable, on which the admins are preparing a number of posts that will be posted while they're away on holidays, with a schedule of 2 posts a day. Those blog posts are written in advance, their title starts with ""READY TO POST ++"" or ""READY TO POST --"" (that part will be removed in the final scheduling phase, when dates are assigned). Those blog posts are saved as Drafts for now. **''Nature of the bug:''** In blog administration > Posts > All Posts, I was reported there was an issue, and indeed, - if I type ""READY TO POST"" in the upper-right search box, run the search, - it returns the text ""12 items"", and that's the right number of posts that are currently called ""READY TO POST"", currently in Draft state... - however in the listing of posts below, only 7 posts are listed, and there is no ""next page"" navigation to browse to a second page of posts listing Here's a screenshot: https://imgur.com/a/qG4Awo8 I think I may have found either the origin, or a factor in the problem: In Screen options (horizontal menu, in the admin, in the same Posts page), there is an entry called ""Number of items per page:"", with the value ""20"". Screenshot: https://imgur.com/a/e3oDjBq And that's wrong, it says ""20"", but there are only 7 posts listed in Admin > Posts > All Posts, be it the default listing, or a search. I don't know if there's a relation, but the blog is configured to display 7 posts on the home page. I tested something, in Admin > Posts > All Posts, I replaced that ""20"" by other numbers. - If those numbers are above the number of search results, the current bug remains, telling there are 12 results, but only showing 7. - If I replace ""Number of items per page"" by 11 or a smaller number, this time it still lists 7 posts only, but I get the missing pagination buttons, screenshot: https://imgur.com/a/fLBv7PL Summary of what I tried: with a search, what I write on ""Number of items per page"" actually does NOT affect the number of displayed results, it's always 7, but depending on whether I choose a number lower, or above or equal to the expected number of results, I have, or haven't, the pagination buttons that allow to view the rest of the results posts. * I could partially reproduce the issue with another query. Simply searching ""ready to"" returns 168 results among the posts. - If I configure Number of items per page to 170, I get no navigation buttons: https://imgur.com/a/DKC70ZZ - If I configure Number of items per page to 167, I get navigation buttons: https://imgur.com/a/HF3cLjN ... oh, damnit, I just realized. It's only a second page of results. No more. Even going into the URL of the page, trying replacing &paged=2 with something like &paged=3, did nothing, still listing the contents of &paged=2. The only workaround is to choose to display 7 posts per page, screenshot: https://imgur.com/a/r2qwRqu * I forgot to list the plugins on the blog, namely: Add Browser Search, Akismet anti-spam, Antispam bee, Classic editor, Custom Smilies, Dave's wordpress live search, disable emojis (gdpr friendly), Display php version, Enhanced text widget, Inline spoilers, ManageWP- Worker, Nextscripts: social networks auto-poster, Php Code widget, Post-plugin library, Random Posts, Scheduled Post Trigger, Seemore, Shortcoder, Term Management Tools, ThreeWP Activity Monitor, User lLocker, WordPress editorial calender, Wp Editor (that one, with a community php fix to make it php7 compatible), Wp super cache, Wp-dbmanager, WP-pagenavi, Wp-polls, Wp-postratings, Wp-sweep, Wpdiscuz, WPS Hide Login, Yoast SEO, ZigWidgetClass * I checked the site's apache error log (I'm the host, it's on my dedi, and I help when there are issues), and I can tell there are zero events appearing in the error log while searching in the list of posts, or changing the number of display results. * I also helped last year, same period of time, and there wasn't that bug at that time. * Well, I don't see what else I could do here, hopefully it's only that blog that has that problem. Apologies, also, that it's not a standard bug report, I'm not used to doing it at all. Good evening!" Sabinooo Tickets Awaiting Review 55445 Should WP_Post_Type preserve Array of capability_type? Posts, Post Types normal minor Awaiting Review defect (bug) new 2022-03-23T03:57:40Z 2022-03-23T03:57:40Z If I register a post type with `capability_type` as an array `capbility_type => array( 'singular', 'plural' )`. The WP_Post_Type object only holds onto the singular capability_type. Should the object preserve the array since it has singular and plural? Howdy_McGee Tickets Awaiting Review 57810 Should wp_insert_post() function call 'wp_insert_post' action with 'update' equals true after creating post for the first time. Posts, Post Types 6.1.1 normal normal Awaiting Review defect (bug) new 2023-02-26T00:55:07Z 2023-03-12T03:06:30Z "The wp_insert_post() function calls 'wp_insert_post' action hook with 'update' equals true when creating post for the first time. Post was created using the Gutenberg editor. /* $update should only be true when updating post */ `do_action( 'wp_insert_post', $post_ID, $post, $update );` " zenithcity Tickets Awaiting Review 57737 Start composing post with same title as existing post, click Preview, post_title is set to point to existing post Posts, Post Types 6.1.1 normal normal Awaiting Review defect (bug) new has-patch 2023-02-16T19:58:43Z 2023-02-21T16:17:36Z "1. Start composing a new post. 2. Set the title of the post to be the same as the title of another recently published post. 3. Click Preview and then Preview in new tab. 4. Go look at the post_title column for the post in the wp_posts table in the database, and observe that it's pointing at the existing post whose title you used, not the new post. If you then publish the post, its link on your home page will be to the old post, not the new one." jikamens Tickets Awaiting Review 41226 "Static ""posts page"" preview not working" Posts, Post Types normal normal Awaiting Review defect (bug) reopened needs-unit-tests 2017-07-03T09:41:05Z 2019-02-17T13:21:59Z "My site has both a static front page and a static posts page. The former is intended to be the site's home page, the latter the blog section home page. The static posts page is a regular page, created through the admin interface. Some parts of it are editable by admin - this is a design choice driven by project needs. Whenever I update the static posts page through the editor, the preview doesn't work: '''clicking on the ""preview"" shows the preview of the ""front page"" instead.''' Apart from that, everything works on the front-end side, and I can edit and save the posts page as needed. Unfortunately, as the project is being currently developed, I can't publicly publish urls or screenshots at the time." emross Tickets Awaiting Review 58487 Text editor problem Posts, Post Types 6.2.2 normal normal Awaiting Review defect (bug) new 2023-06-08T11:07:40Z 2023-06-08T14:02:19Z "Hi, the < character causes corruption. lines are concatenating and shortcodes don't work 1: https://ibb.co/yndnCP1 2: https://ibb.co/Rhd2r87 If there is no < character, everything will look normal. 3: https://ibb.co/1Xvvw7V" burhi Tickets Awaiting Review 51374 The initial revision of an imported post goes missing Posts, Post Types normal normal Awaiting Review defect (bug) new 2020-09-22T09:58:24Z 2020-09-22T09:58:24Z "There are two problems relating to revisions when making a change to an imported post. 1. The first change does not cause the Revisions meta box to appear. A second change is required. 2. The first change gets ""lost"" and appears as if it was part of the first version of the post. Steps to reproduce: * Import a published post * Make a change to it * Observe that the ""Revisions"" meta box does not show up even after reloading the editing screen * Make a second change to the post * Click the ""2 Revisions"" link and observe that the second revision is recorded correctly, but that the first revision shows the entire contents of the post being added. The first change made ""disappears"" as it's incorrectly included in the entire contents of the first revision. I think the root cause here is that imported posts do not create an initial revision. A possible solution might be to create an initial revision at the point where a user makes a change to a post and there isn't an existing revision. I assume this can also be reproduced by deleting all the revisions from your database and then making changes to a post." johnbillion Tickets Awaiting Review 56241 The post category count according post data not showing on admin side. Posts, Post Types normal normal Awaiting Review defect (bug) new has-patch 2022-07-18T12:04:35Z 2022-07-18T20:49:12Z "we are created category as parent and child relationship. This category shows on the category listing with count number. The clicking on the count show all post which are assigned category and redirect to post listing page. But the no of count shows for parent category with child category. I mean to say not show only parent category count. Screenshots: [https://www.awesomescreenshot.com/image/30272055?key=d91d4077475e475448b781faf504be14 Categories screen] and [https://www.awesomescreenshot.com/image/30272057?key=b44d8d751e7f1ced24ae065b364a8c5a Posts listing]" rima1889 Tickets Awaiting Review 40528 Title with ascii paragraph separator is not being filtered on post save Posts, Post Types 4.7.4 normal normal Awaiting Review defect (bug) new has-patch 2017-04-22T11:09:01Z 2017-04-23T14:46:41Z While saving post, filter: title_save_pre only trim spaces before saving to database. In case of paragraph separator it get encoded with %e2%80%a9 . Same thing happen with permalink too. shpetimshala Tickets Awaiting Review 40588 Trashing and restoring a draft post replaces the slug Posts, Post Types 4.5 normal normal Awaiting Review defect (bug) new needs-unit-tests 2017-04-27T20:39:43Z 2018-07-31T14:57:32Z "Using the latest version of WordPress, if you create a draft post with a slug, lets say 'test-post', then trash it and restore it, the slug becomes {{{__trashed-xxx}}}, where xxx is a number Related to https://core.trac.wordpress.org/ticket/11863" TJNowell Tickets Awaiting Review 56590 TypeError error in get_the_content when $elements['page'] and $elements['pages'] are null Posts, Post Types 6.0.2 normal normal Awaiting Review defect (bug) new has-patch 2022-09-16T21:24:27Z 2022-09-23T01:03:57Z "`if ( $elements['page'] > count( $elements['pages'] ) )` in file `wp-includes/post-template.php` (currently on line 319) throws the following error when those array items are null: `Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /wp-includes/post-template.php:319` A case where they would be null is a search request with no results where a plugin like Timber is used to assign $post a non-WordPress-core value. Adding the condition `if ( ! is_null( $elements['page'] ) && ! is_null( $elements['pages'] ) )` solves the problem." cantbelieveitsnotbutter Tickets Awaiting Review 55638 Undefined property: WP_Post_Type::$post_type Posts, Post Types 5.9.3 normal normal Awaiting Review defect (bug) new 2022-04-28T08:38:11Z 2022-05-13T08:48:12Z " PHP 8.1.5 PHP Warning: Undefined property: WP_Post_Type::$post_type in wp-includes/post-template.php on line 649" pienoz Tickets Awaiting Review 47988 Unexpected behaviour when draft post has the same page_name as published post Posts, Post Types normal normal Awaiting Review defect (bug) new 2019-09-06T02:49:20Z 2019-09-06T06:35:15Z "> What steps should be taken to consistently reproduce the problem? {{{ wp rewrite structure '/%postname%/' wp post create --post_title=""Example post title"" --post_status=publish --post_name=my-chosen-post-name wp post create --post_title=""A draft post"" --post_status=draft --post_name=my-chosen-post-name }}} Visit http://www.example.com/my-chosen-post-name > In case it's relevant to the ticket, what is the expected output or result? We're expecting the published post to be displayed. > What did you see instead? If you're authenticated and have permission to view drafts, the draft post will populate the `Global $post` object and be displayed. Anonymous users will get a 404 page or the browser will throw a `Too many redirects` error. > Does the problem occur even when you deactivate all plugins and use the default theme? Yes. > Please provide any additional information that you think we'd find useful. (OS and browser for UI defects, server environment for crashes, etc.) The core behaviour of the WP Admin post edit screen doesn't allow us to get into this state because `post_name` values are not stored for a post until it transitions to the `publish` post status. When this transition does happen `wp_unique_post_slug()` ensures the `post_name` being saved unique. We first encountered this issue via the Yoast SEO plugin metabox which allows a ''Slug'' to be saved for draft posts. As you can see with the WP-CLI commands above, however, there are other ways of getting to this state. The draft post is loaded for authenticated requests because the default query vars `order_by => post_date` and `order => DESC` means the draft post created after the published post populates the `WP_Query->post` property. Anonymous requests are not able to view the draft post, so before returning a 404, `redirect_canonical()` calls `redirect_guess_404_permalink()` which builds a query for a published post where `page_name` is `LIKE` the post name and finds the published post and redirects to it... and the loop continues." ajfleming Tickets Awaiting Review 59354 Unnecessary queries performed when updating a post without providing categories or tags Posts, Post Types normal normal Awaiting Review defect (bug) new needs-unit-tests 2023-09-14T22:43:53Z 2023-09-14T22:43:53Z "Given an existing post with at least some categories or tags present, updating the post via `wp_update_post()` (which calls `wp_insert_post()`) with data that does not include categories or tags, many unnecessary taxonomy-related database queries are performed. This slows down the saving significantly. * If `$postarr` doesn't contain a `post_category` element, there's no point in calling `wp_set_post_categories()`. * If `$postarr` doesn't contain a `tags_input` element, there's no point in calling `wp_set_post_tags()` == Todo == * Need tests to verify the above is correct * Need a list of queries that are performed before and after the change == To reproduce == 1. Publish a post with at least one category 2. Update the post via: {{{#!php $id, 'post_content' => 'Hello, World!', ] ); }}} 3. Observe that a significant number of unnecessary taxonomy queries are performed" johnbillion Tickets Awaiting Review 48580 Update status in save_post hooks always true in WordPress 5.0 Posts, Post Types 5.2.4 normal normal Awaiting Review defect (bug) new 2019-11-12T21:47:58Z 2019-11-12T21:47:58Z "I think this issue shown after integration of Gutenberg editor, The {save_post} and {save_POST_TYPE} hooks always triggers {$update} as TRUE. I made some tests, The {$update} is TRUE on saving the post for the first time and on updating also, it's always true. {{{#!php 'No' ); if( $update ) { /* Saving New Post trigger this -- always {Yes} */ $db_values['is_new'] = 'Yes'; } else { $db_values['is_new'] = 'No'; } /* Connect to IBM Server */ /* Update DB */ update_post_meta( $post_ID, 'postmetas_save_test', wp_unslash( $db_values ) ); } }}} " oxibug Tickets Awaiting Review 58134 Use correct plural of status Posts, Post Types normal normal Awaiting Review defect (bug) new 2023-04-15T06:58:24Z 2023-08-18T23:37:30Z "Core uses a variable named **$stati** (10 times to be found, in 3 files), but that's not the correct plural form of '**status**', neither in english, nor in latin or elsewhere. So I plead to change it to **$statuses**. While there seems to be no decent rule for variable names, so technically the variable could be named $stsii or whatever, still we are called to not {{{ ""abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting."" }}} see https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/ Also, as we all know, ""**Code is Poetry**"", isn't it? Now you could argue poetry has some freedoms, but I strongly believe it should use correct grammar, at least in this case. So I may have convinced you finally of that one, but there's one more issue: There's also a function {{{ get_post_stati() }}} see https://developer.wordpress.org/reference/functions/get_post_stati/ c'mon, let's rename it to **get_post_statuses**, while we're on it. You may think this is petty, but it gave me some confusion and after all it's just wrong. Let's get rid of an usage of a plural form which doesn't exist. " Presskopp Tickets Awaiting Review 52738 Use of get_object_vars() in sanitize_post() and WP_Post constructor does not handle null byte Posts, Post Types 5.6.2 normal normal Awaiting Review defect (bug) new has-patch 2021-03-09T14:56:39Z 2023-10-04T08:36:17Z "In places where get_object_vars is used to loop over an objects properties and then trying to access them null bytes are not handled. There is an old bug-report (from me) for map_deep #47164 but now we are experience this in other places too; in sanitize_post and in the constructor of class-wp-post. This is totally destroying our business and I don't know what to do. Since I reported the issue for map_deep I have had to manually patch formatting.php every time there is a WordPress update. But now, trying to handle all the places get_object_vars is used in hopeless. Best approach to handle this would be to always filter the return values from get_object_vars. Something like: {{{#!php ord( $var ) !== 0, get_object_vars( $object )); }}} " bitcomplex Tickets Awaiting Review 37832 Using ?p=xxx on a posts page with an invalid post ID does not return a 404 status Posts, Post Types normal normal Awaiting Review defect (bug) new 2016-08-25T23:06:41Z 2019-04-19T15:20:07Z "Steps to replicate: - Create a page and set it as the posts page. - Visit this page with ?p=123456 (an invalid ID) added. WordPress will return whatever 'no results found' message you have in the theme, but with a 200 status. The handle_404 function seems to have been set up to always give a 200 status if is_home() returns true. This should not apply if you're overriding the query in some way via the URL. Somehow many of these URLs have been detected by Google on a site of ours and are being reported as soft 404s. How they were found is one thing, but WordPress should not be returning a 200 status regardless." smerriman Tickets Awaiting Review 40521 Using a custom query var on a static front page results in wrong $post Posts, Post Types 4.7.4 normal normal Awaiting Review defect (bug) new 2017-04-21T20:52:36Z 2017-04-22T09:15:03Z "'''Steps to reproduce:''' * Create a page and make it the static front page * Add a new query var via filter in theme's functions.php: `add_filter( 'query_vars', function( $vars ) { array_push( $vars, 'buggy' ); return $vars; } );` * Open the front page setting the newly added query var (e.g. ""https://example.com/?buggy=yep"") '''Result:''' displays the latest blog post '''Expected result:''' displays front page" mechter Tickets Awaiting Review 58714 View post link issue in post/article listing screen Posts, Post Types normal normal Awaiting Review defect (bug) new 2023-07-05T10:04:19Z 2023-07-05T10:04:19Z "Hello, View post or permalink not generated when ""public"" argument is ""false"" in custom post type but ""View"" link show in post/article listing screen if ""public"" argument is ""false"" so It should be not shown in listing screen" hiren1094 Tickets Awaiting Review 47640 "WP_Posts_List_Table::get_views() doesn't allow the ""Mine"" counts to be filtered" Posts, Post Types normal normal Awaiting Review defect (bug) new has-patch 2019-07-02T16:37:23Z 2021-05-08T18:51:27Z "[https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_views/ WP_Posts_List_Table::get_views()] calls [https://developer.wordpress.org/reference/functions/wp_count_posts/ wp_count_posts()] to get the counts for the various post statuses. It then computes the count for posts owned by the current user for use in the ""Mine"" view. That computation uses `$this->user_posts_count` which is computed in [https://developer.wordpress.org/reference/classes/wp_posts_list_table/__construct/ WP_Posts_List_Table::__construct()] with custom SQL. The problem is that if you hook into the [https://developer.wordpress.org/reference/hooks/wp_count_posts/ wp_count_posts] filter and alter the counts for each post status you can end up with a situation where the ""Mine"" count is very different than the sum of the post status counts. For example, I've got a CPT where some (but not all) of the posts of that type are just ""placeholders"" for posts of another CPT. I hide those ""placeholder"" posts from the list table by hooking into [https://developer.wordpress.org/reference/hooks/request/ request] and altering the request that the list table uses. I then hook into `wp_count_posts` to adjust the counts by post status accordingly (e.g., don't count the ""hidden"" posts). This results in a situation that could be **very** confusing for users (see screenshot). Thus, I suggest that a filter be added to filter the value of `$this->user_posts_count`. " pbiron Tickets Awaiting Review 54258 WP_Query::is_tax() returns true on custom post type archives (5.8.1) Posts, Post Types 5.8.1 normal normal Awaiting Review defect (bug) new 2021-10-13T19:26:11Z 2021-10-19T13:52:35Z "I was testing the upgrade to 5.8.1 (from 5.7.3) on a copy of my (Lightsail/Bitnami-hosted) live instance and found that after upgrading to 5.8.1, a `post_type=` parameter is added to the URL when I navigate away from a page that displays posts from one of my custom post types. This happens whether or not I update plugins and themes. E.g. I visit `/photographs`, then click to go to `/quotes`; `post_type=photos` gets added to the URL (i.e. `/quotes/?post_type=photos`) and it continues displaying photographs instead of quotes. This happens both with my custom post types defined through the CPT plugin and with the ones I've defined in my own code. The parameter is not added when navigating away from standard post results. Even if the parameter didn't interfere with the website's behavior, it would be a bug, as it's adding unnecessary and unwanted clutter to my URLs, but it does interfere and is a breaking change." arestelle Tickets Awaiting Review 41857 Walker_PageDropdown doesn't set correct selected value when using value_field Posts, Post Types 4.8.1 normal normal Awaiting Review defect (bug) new 2017-09-11T17:16:16Z 2020-07-22T16:55:25Z "If the ''value_field'' is different from ID, the selected value was not set. Function Walker_PageDropdown::start_el {{{ if ( $page->ID == $args['selected'] ) $output .= ' selected=""selected""'; }}} See also #32330 " it4life Tickets Awaiting Review 56364 When I update to 6.0.1 it hides categories, Featured image, Author selection when I want to create a post Posts, Post Types 6.0 normal normal Awaiting Review defect (bug) new 2022-08-11T13:35:08Z 2022-09-03T14:40:39Z "Since I updated to v6.0, when I create/edit posts, the Author, Category and Feature Image tabs on the right-hand side have disappeared. I’ve tried disabling plugins and reactivating plugins to determine if it’s a plugin compatibility issue, but I don’t understand why it would be. But nothing worked. My user account is a full admin. After searching, I can see that some people have had the same or similar issue, but their solutions (deactivating plugins etc.) didn’t work for me." digital2019 Tickets Awaiting Review 49136 White screen in password protected posts, referrer policy Posts, Post Types 5.3.2 normal normal Awaiting Review defect (bug) new 2020-01-05T17:19:32Z 2020-03-06T15:20:10Z "**Background** Under some circumstances WP is displaying a white screen refering to URL ..../wp-login.php?action=postpass after entering either correct or incorrect password into password protected posts. It turns out this behaviour occurs reproducably in case WP site is set to no-referrer policy e.g. by Nginx configuration. This behaviour was observed since about July last year. **Steps to reproduce** 1. Force no-referrer policy in Nginx .conf file add_header Referrer-Policy no-referrer; service nginx restart 2. Protect any post by password 3. Verify no-referrer policy in e.g. Chrome F12->network 4. Enter password into your password protected post 5. /wp-login.php?action=postpass white screen pops up, no error message, no debugg hints. These steps reproduce in any WP configuration (under ubuntu server 18.04 LTS, LEMP stack) with or without themes/plugins. Exception: Safari and Edge (as of August last year) do not show white screenn. Reason: These browsers do not support referrer policy. **Work around** Set referrer policy to any other policy than no-referrer. In my case strict-origin-when-cross-origin did the job. **Suggestion** This issue might not be too common but it might become more relevant due to GDPR in Europe. It seems that wp-login.php requires a reference to the calling URL to be able to redirect to that URL after verifying the password. In case of no-referrer policy this reference is not disclosed, hence wp-login.php cannot return to its caller. If that is the case in order to ensure stable operation of password protected posts WP must not allow no-referrer policy but should force any other secure policy." derfuchs98 Tickets Awaiting Review 32773 You cannot move Private nor Passworded posts to Draft. You must make them public first. Posts, Post Types normal normal Awaiting Review defect (bug) new 2015-06-24T03:30:09Z 2017-07-03T16:32:40Z "This is an odd quirk of the editor and might be a security issue for some. However, there is no option from the main editor to move a post directly to draft status from Private nor from Passworded status. I suspect you can trash the post first and then mark it as draft and maybe you could do it from the quick edit. In any case marking as draft should be able to be done from within the actual editor without the disclosure of private information. NOTE: This kinda is a security issue, but not in the way the check box is asking about. It is procedural. So I'm marking ""I am not reporting a security issue.""" BrianLayman Tickets Awaiting Review 56480 _add_post_type_submenus doesn't use WP_Post_Type::$menu_position Posts, Post Types normal normal Awaiting Review defect (bug) new 2022-08-31T17:17:11Z 2023-04-12T19:26:37Z "Although it's possible to add a post type as a submenu when registering by setting the property show_in_menu, it's not possible to set the position. This is happening because in the function [https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/post.php#L2071 _add_post_type_submenus] (wp-includes/post.php) the function add_submenu_page is called without passing the parameter $position. {{{#!php true ) ) as $ptype ) { $ptype_obj = get_post_type_object( $ptype ); // Sub-menus only. if ( ! $ptype_obj->show_in_menu || true === $ptype_obj->show_in_menu ) { continue; } add_submenu_page( $ptype_obj->show_in_menu, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, ""edit.php?post_type=$ptype"" ); } } }}} Steps to reproduce the issue: 1. Add the code snippet in the functions.php of the theme (notice the 'menu_position') {{{#!php array( 'name' => 'Foo', ), 'show_in_menu' => 'edit.php?post_type=page', 'menu_position' => 20, 'public' => true, ) ); register_post_type( 'bar', array( 'labels' => array( 'name' => 'Bar', ), 'show_in_menu' => 'edit.php?post_type=page', 'menu_position' => 10, 'public' => true, ) ); }}} 2. Visit the Dashboard and check that under the menu Pages, ""Foo"" appears **before** ""Bar"" Expected behaviour: ""Foo"" appears **after** ""Bar""" Rahmohn Tickets Awaiting Review 48410 `wp_insert_post()` can result in duplicate post data Posts, Post Types normal normal Awaiting Review defect (bug) new 2019-10-23T15:04:14Z 2020-01-02T02:10:25Z "If 2 identical calls to `wp_insert_post()` are made close enough together, 2 posts are added to the database instead of 1. These posts differ by post ID only. The slug for example is the same. This seems to happen because `wp_insert_post()` does a fair amount of processing before the database write takes place. The check to determine if a post already exists can be _stale_ at the point of insertion." henry.wright Tickets Awaiting Review 52950 add_meta_box issue in wordpress 5.7 Posts, Post Types 5.7 normal major Awaiting Review defect (bug) new 2021-03-31T13:09:44Z 2021-03-31T17:23:29Z "I recently moved to the new WordPress version 5.7 and now I am facing an issue in the add_meta_box function in function.php. The issue I am facing is the custom post type ID which I added in the add_meta_box function is conflicts with my custom post slug. Whenever I add a new post or open an existing post it shows a pre-generated slug from that custom post type without saving. Please see my code below. {{{#!php set('post__not_in', array(5800)); } } } add_action('pre_get_posts', 'mod_func', 999); }}} Screenshot: [https://webgeek.hu/wp-bug-post-counter.jpg] Hope you can understand me, I'm not the best in English. If you have questions, feel free to ask me. Thanks for helping in advance (and thanks for working hard for years), Sincerely, Somogyi Balázs " err Tickets Awaiting Review 60121 "catastrophic content overwrite from ""Add New Pattern""" Posts, Post Types 6.4.2 normal blocker Awaiting Review defect (bug) new 2023-12-20T11:20:48Z 2023-12-20T11:20:48Z """Add New Pattern"" /wp-admin/post-new.php?post_type=wp_block&lang=en from /wp-admin/edit.php?post_type=wp_block and Publishing it overwrites / replaces the last there added pattern, giving it the same post id like the one overwritten / replaced. When then creating a pattern from a post editor Gutenberg block, that pattern is added next to the pattern(s) at /wp-admin/edit.php?post_type=wp_block giving it an id jumping all those ids equalling attempts at adding a pattern from there. " vialars Tickets Awaiting Review 43084 dashboard confuses published posts count with all posts Posts, Post Types 2.7 normal normal Awaiting Review defect (bug) new 2018-01-13T23:22:05Z 2019-05-15T08:11:35Z "the following is a good first bug for new contributors, IMO! because it's very easy to fix https://core.trac.wordpress.org/tickets/good-first-bugs in dashboard, in ""at a glance"" section there's a misleading link: 1. its hyper reference uri leads to list of '''all existing''' posts /wp-admin/edit.php?post_type=post there are currently 26 posts in my blog 2. its label is ""8 posts"" where 8 -- is the number of '''currently published''' posts /wp-admin/edit.php?post_status=publish&post_type=post there are currently 8 published posts in my blog 3. its icon is the pushpin. and the pushpin usually means '''sticky''' posts /wp-admin/edit.php?post_type=post&show_sticky=1 there are currently 1 sticky post in my blog thus, as you can see, this link confuses ""all posts (26)"" with ""published posts (8)"" AND with ""sticky posts (1)"" I know, WordPress uses pushpin icon to indicate any post, so, maybe, I'm wrong about sticky posts. But I'm definitely not mistaken in that you cannot label the link as ""8 posts"" and make it refer to the list of 26 posts -- it should be fixed. Either label should be ""26 posts"" or it should go to list of published posts. IMO, the latter choice (lead to published posts)." awardpress Tickets Awaiting Review 57507 function wp_unique_post_slug inconsistent for numerical page slugs, e.g. 404 Posts, Post Types 6.1.1 normal minor Awaiting Review defect (bug) new dev-feedback 2023-01-19T11:03:36Z 2023-01-19T11:03:36Z " {{{ if ( $post_name_check || in_array( $slug, $feeds, true ) || 'embed' === $slug || preg_match( ""@^($wp_rewrite->pagination_base)?\d+$@"", $slug ) || $is_bad_hierarchical_slug ) }}} Will always return true for preg_match as long as 'page' is optional and it is a numerical slug, e.g. 404 {{{ preg_match( ""@^($wp_rewrite->pagination_base)?\d+$@"", $slug ) preg_match( ""@^(page)?\d+$, 404"") => 1 }}} Assuming pagination is the point for this check, a possible solution could be to check if post pagination navigation exists first. {{{#!php $pagination_based = get_the_post_navigation() ? preg_match( ""@^($wp_rewrite->pagination_base)?\d+$@"", $slug ) : false; if ( $post_name_check || in_array( $slug, $feeds, true ) || 'embed' === $slug || pagination_based || $is_bad_hierarchical_slug ) }}} Suggestion: Either allow numerical slugs if it does not interfere with paginations, or disallow it with a warning. " arve5 Tickets Awaiting Review 44497 get_page_link() doesn't check if a valid post object is returned before trying to access its properties Posts, Post Types normal normal Awaiting Review defect (bug) new has-patch 2018-07-03T14:05:49Z 2023-06-08T13:20:45Z "If get_page_link() receives an invalid post ID as the first parameter it will generate a PHP notice: {{{#!bash $ wp shell >>> get_page_link( -1 ) PHP Notice: Trying to get property of non-object in /vagrant/www/wccore/htdocs/wp-includes/link-template.php on line 317 }}} Should a check be added to prevent this notice from happening? I'm happy to submit a patch. I'm just not sure what is the best way to handle this. Should the function return null if `get_post()` can't find a valid post? Should it call `_doing_it_wrong()`? Something else? " rodrigosprimo Tickets Awaiting Review 41355 get_post_status filter is ignored in some cases Posts, Post Types 4.8 normal normal Awaiting Review defect (bug) new 2017-07-18T11:55:09Z 2017-07-18T11:55:09Z "Code: {{{#!php 'my_plugin_render_block_latest_posts', ) ); function my_plugin_render_block_latest_posts( $atts ) { $output = ''; $args = array( 'posts_per_page' => 3, ); $query = new WP_Query( $args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); $output .= '
  • '; $output .= get_the_excerpt(); $output .= '
  • '; endwhile; wp_reset_postdata(); else : $output .= 'No posts found.'; endif; return $output; } }}} For some reason, get_the_excerpt is causing this error in /wp-json/wp/v2/posts: Fatal error: Maximum function nesting level of '256' reached, aborting! in /app/public/wp-includes/plugin.php on line 899 When I remove get_the_excerpt() or replace it with get_the_content() the error disappears. I use 'Local by Flywheel' and this is happening on PHP5.6 and 7" DannyCooper Tickets Awaiting Review 50255 get_the_modified_author() not working Posts, Post Types 5.4.1 normal normal Awaiting Review defect (bug) new 2020-05-26T14:16:36Z 2021-08-03T05:56:58Z "It seems that get_the_modified_author() is not working. Looking at the source code of the function I noticed that the _edit_last meta field is not filled for the specific post, even though the post was edited. After a closer look it seems that _edit_last is not in the meta data for regular posts and for pages (though I noticed it was there for the standard privacy page). It is there for custom posts. So it seems that get_the_modified_author() is not working for pages and regular posts. I looked at wp_check_post_lock() and saw that this function takes another approach. It looks at the _edit_lock field. This field is still there after the editing is over. So, this piece of code works for pages, posts and custom posts: {{{#!php ID, '_edit_last', true ); return $user; } }}} In this case the user who modified the page/post is part of another field, which makes it harder to filter for that. My suggestion would be to make _edit_last work again, or have a specific field in the post object, just like post_modified and post_modified_gmt that are used for the modification date/time. This would make it easier to filter also. The functions get_the_modified_date() and get_the_modified_time() are working correctly. I have tested this on WP 5.4.1 This was discussed in the forum here: https://wordpress.org/support/topic/get_the_modified_author-not-working/" stilldreaming Tickets Awaiting Review 59241 get_the_posts_navigation wrong functions called for prev and next links Posts, Post Types 6.3.1 normal normal Awaiting Review defect (bug) new has-patch 2023-08-29T18:38:27Z 2023-08-30T19:11:12Z "wp-includes\link-template.php:2858 get_the_posts_navigation function For next link called get_previous_posts_link functions and for previous link called get_next_posts_link function $next_link = get_previous_posts_link( $args['next_text'] ); $prev_link = get_next_posts_link( $args['prev_text'] );" valentinwebdev2019 Tickets Awaiting Review 49343 post attributes not saving post order Posts, Post Types 5.3.2 normal normal Awaiting Review defect (bug) new has-patch 2020-02-02T16:31:17Z 2020-02-02T21:08:15Z "the post attributes are not saving post order once the number of posts added has reached the amount to display in reading settings. I set my posts to display post attributes order. {{{ add_action( 'admin_init', 'posts_order_wpse_91866' ); function posts_order_wpse_91866() { add_post_type_support( 'post', 'page-attributes' ); } }}} They were all saving fine and showing in order until I got to my 11th post. My reading settings are set to 10 per page. All of a sudden my posts orders had all been reset to zero. Now trying to add the order again to the posts is not even saving the order amount when republished. It seems to be a bug in the Rest API somewhere because it was working until it got to my reading settings display limit." shadiadi Tickets Awaiting Review 48006 post_date not as expected Posts, Post Types 5.2.3 normal normal Awaiting Review defect (bug) new has-patch 2019-09-09T15:22:29Z 2019-09-17T09:18:04Z "I have noticed this when scheduling a post. 1) From wp-admin choose Pages. 2) Add new. 3) Change from publish immediately to selecting time and date. 4) Select a date, for example, 2019-09-09 17:00 5) Save the post. 6) Look in the wp_posts table in the database for the post and the post_date column will be something like 2019-09-09 17:00:21 It is not really as expected since you, as a user, are not able to set which second the page should be published you assume it would be at 00. In this case you expect that is is 17:00:00. The problem is that if you have a scheduled crontab that runs every 5 minutes (*/5) it will get missed schedule the first time since the cron will run at 17:00:00 and the publish time of the post is 17:00:21. From my experience most users choose the schedule at top of the hour so we get this missmatch a lot. For us it would be easier if assumed that it is 00 seconds always." marrank Tickets Awaiting Review 47552 post_name when inserting is not guaranteed to be unique Posts, Post Types normal normal Awaiting Review defect (bug) new 2019-06-18T00:41:05Z 2019-06-18T03:59:14Z "Hi all, In wp_insert_post, there is a gap between the allocation of the post_name (as wp_unique_post_slug), and the insertion ($wpdb->insert) of the post. This is problematic because another WordPress instance can insert a post with the same post_name in this gap, which would result in two posts being inserted with the same post name See here for an example: https://github.com/domsleee/wp_insert_post_duplicate I suppose a solution may be to obtain a table lock, then find a unique slug and insert the post, and then release the table lock... but this doesn't seem very performant. What do you guys think?" domslee Tickets Awaiting Review 58476 preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated Posts, Post Types 6.3 normal normal Awaiting Review defect (bug) new 2023-06-08T00:16:08Z 2023-12-12T20:54:33Z "== Bug Report === Description Using the filter hook 'the_content' and passing an empty string or null produces the preg_split deprecation notice in the convert_smilies() function. === Environment - WordPress: 6.3-alpha-55892 - PHP: 8.2.2 - Server: Apache/2.4.54 (Win64) PHP/8.2.2 mod_fcgid/2.3.10-dev - Database: mysqli (Server: 8.0.27 / Client: mysqlnd 8.2.2) - Browser: Chrome 114.0.0.0 (Windows 10/11) - Theme: Seele 1.1.1 - MU-Plugins: * WP Migrate DB Pro Compatibility 1.1 - Plugins: * bbPress 2.6.9 * Classic Widgets 0.3 * Contact Form 7 5.7.7 * Database Backup for WordPress 2.5.2 * Envato Market 2.0.8 * Force Plugin Updates Check 1.0.2 * Optimize Database after Deleting Revisions 5.0.110 * Query Monitor 3.12.3 * Redux Framework 4.4.1.4 * Regenerate Thumbnails 3.1.5 * Requite Core 1.1.13 * Slider Revolution 6.6.14 * Slider Revolution Paint-Brush Add-On 3.0.4 * Slider Revolution Particles Effect 3.3.2 * Slider Revolution Slicey Add-On 3.0.4 * Theme Check 20230417 * Ultimate Addons for WPBakery Page Builder 3.19.14 * WooCommerce 7.7.2 * WordPress Beta Tester 3.4.1 * WordPress Importer 0.8.1 * WPBakery Page Builder 6.13.0 * WP Crontrol 1.15.2 * WP Migrate DB Pro 1.8.1 * WP Migrate DB Pro CLI 1.3.2 * WP Migrate DB Pro Media Files 1.4.9 * WP Migrate DB Pro Multisite Tools 1.2 === Steps to Reproduce 1. Use this filter, ensuring $content is empty or null: $content = apply_filters( 'the_content', $content ); preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated wp-includes/formatting.php:3482 preg_split() wp-includes/formatting.php:3482 convert_smilies() wp-includes/class-wp-hook.php:310 apply_filters('the_content') x. 🐞 Bug occurs. === Expected Results 1. ✅ The filtered content. === Actual Results 1. ❌ The indicated deprecation error due to preg_split not liking a null value." KProvance Tickets Awaiting Review 55332 problem with quick comment discarded changes Posts, Post Types 5.9.1 normal minor Awaiting Review defect (bug) new 2022-03-07T22:56:11Z 2023-08-09T15:08:12Z "The function discardCommentChanges in js/edit-comments.js does not seem to be working as intended. When using the quick comment editor, the function is called when an edit is started, and it does nothing at that point as expected. But if you click away from the form, nothing stops you and you lose your comment changes. On the other hand, if a plugin enqueues edit-comment.js, buddyboss-platform does (I don't know how/why), and you are editing a post (my attached example is an event venue), the function is triggered on update. With no comments involved, the original content is an empty string and the editied comment is undefined and that triggers the popup warning that changes might be lost." LinuxArchitect Tickets Awaiting Review 56059 "register_post_type()'s ""description"" argument can't be translated (gettext)" Posts, Post Types 6.0 normal normal Awaiting Review defect (bug) new 2022-06-24T00:25:17Z 2022-06-25T22:36:35Z "Calling ''register_post_type'' it is possible to use ''gettext'' to translate the labels of the post type. However, while the labels do work, the argument ''""description""'' doesn't translate. {{{#!php __('Books', 'text_domain'), 'singular_name' => __('Book', 'text_domain'), 'add_new' => 'New Book' ); $args['description'] = esc_html__(""This is a beautiful description for this post type, but sadly it doesn't get translated"", 'text_domain'); $args['has_archive'] = 'books'; ... ?> }}} I'm rather sure that it's not some mistake of mine, because I checked the ''.po'' and ''.mo'' files multiple times and if I copy and paste that gettext line of code and I echo it anywhere on my website, it gets correctly translated. So it's something about the ''""description""'' parameter." andreacalligaris Tickets Awaiting Review 41980 show_in_menu doesn't work with int value Posts, Post Types 4.9 normal normal Awaiting Review defect (bug) new has-patch 2017-09-25T15:40:29Z 2017-09-25T15:41:13Z The `show_in_menu` parameter in `register_post_type()` function doesn't work with int value (or some other value which be treated as true if convert to boolean). I tried to use `1` instead of `true`, some other parameters work except `show_in_menu`. The problem is WordPress use `Not Identical` operator instead of `Not Equal` to check the value of `show_in_menu` when render admin menu items. truongwp Tickets Awaiting Review 51246 single_post_title() doesn't respect private and protected posts Posts, Post Types normal normal Awaiting Review defect (bug) new 2020-09-04T12:35:59Z 2020-09-05T00:03:26Z "`single_post_title()` doesn't respect private and protected content. It will either display or return the content regardless. In contrast, `get_the_title()` does respect private and protected content. Note `single_post_title()` is used when building the document title in `wp_get_document_title()`." henry.wright Tickets Awaiting Review 60427 "small ""ü"" in page as anchor causes a mistake when try to save (wrong JSON-response)" Posts, Post Types 6.4.3 normal minor Awaiting Review defect (bug) assigned 2024-02-02T19:00:04Z 2024-02-02T19:00:04Z "I tried to make some changes on a page with pre-block content. It contains some anchors and everytime I tried to save the page after some small changes I got the alert ""Aktualisierung fehlgeschlagen. Die Antwort ist keine gültige JSON-Antwort."". The well know answer that there is something wrong with JSON. I found the reason is that in the anchors where small ""ü"" (a german umlaut). It happened with the anchor target as well as with the anchor link. And at the same time there are some anchors with other umlauts, namely with a big ""Ü"", which do not cause the issue." gregordoehnert Tickets Awaiting Review 47742 sorting by date incorrect Posts, Post Types normal normal Awaiting Review defect (bug) new 2019-07-19T17:36:02Z 2019-07-20T20:34:46Z Sorting pages by date should be doing date modified. It seems to be going off another date, possibly date published. lamaan Tickets Awaiting Review 43036 the_posts_pagination() - redirect URL for first page in category Posts, Post Types 4.9.1 normal normal Awaiting Review defect (bug) new 2018-01-06T20:51:56Z 2018-01-06T20:51:56Z "When you are on the second, third, etc. the page function `the_posts_pagination ()` outputs a link to the first page for the current category with a slash `/` at the end of the URL: {{{ /category/category-1/ }}} But when clicking on a link, a redirect to the page takes place without a slash `/` on the end: {{{ /category/category-1 }}} A link to the following pages from this category is displayed already without a slash on the end of the URL: {{{ /category/category-1/page/2 }}} Permalink at the same time on the site are configured to look like this: {{{ /%postname%.html }}}" webliberty Tickets Awaiting Review 29999 update post overwrites slug if current_user is contributor Posts, Post Types 4.0 normal minor Awaiting Review defect (bug) new dev-feedback 2014-10-16T08:09:04Z 2024-03-07T21:30:46Z "The [http://codex.wordpress.org/Function_Reference/wp_update_post/ wp_update_post] function calls [http://codex.wordpress.org/Function_Reference/wp_insert_post/ wp_insert_post] which is located in [https://core.trac.wordpress.org/browser/tags/4.0/src/wp-includes/post.php#L3068/ wp-includes/post.php] in posts.php at lines 3168 - 3171 there is this code: {{{ // Don't allow contributors to set the post slug for pending review posts. if ( 'pending' == $post_status && !current_user_can( 'publish_posts' ) ) { $post_name = ''; } }}} this will remove post_name if the current user is a contributor without any message or notification. This creates an issue because scripts/plugins that uses wp_upadate_post usually don't handle this case (the documentation doesn't cover this also - I would update the documentation but I'm wondering if there's no other solution). I don't see the issues that a contributor changing the slug would create (a contributor vs an editor) anybody does?" jnhghy Tickets Awaiting Review 47652 wp_dashboard_right_now() emits debug notices on unregistered core post types Posts, Post Types normal normal Awaiting Review defect (bug) new 2019-07-04T20:31:23Z 2019-07-05T02:26:47Z "When you unregister a core 'post' or 'page' post type (I know... I know...) if they have posts in the database, the dashboard ""Right Now"" widget will output a debug notice for each unregistered type: {{{ Undefined property: stdClass::$publish; wp-admin/includes/dashboard.php:270 }}} This is because the code inside of `wp_dashboard_right_now()` always expects a `WP_Post_Status` object as the return type of each `wp_count_posts()` key, however a `stdClass` return type is also possible when no registered type or status is currently registered at the time the widget is rendered. ---- Unregistering ""built in"" post types is normally considered to ""void the warranty"" and the `unregister_post_type()` function explicitly throws an error when you try, but the patch I'm about to attach is a small and bit of code hardening that prevents filling debug logs for those of us that frequently work with out-of-warranty installation types." johnjamesjacoby Tickets Awaiting Review 43672 wp_delete_post() function ignores `$force_delete` parameter for custom post types Posts, Post Types normal normal Awaiting Review defect (bug) new dev-feedback 2018-04-02T05:23:01Z 2023-07-05T15:55:14Z "The `wp_delete_post()` function has a second optional parameter called `$force_delete` (default false) that decides whether to send the post to trash or delete it permanently. But when the function is invoked with a post id that belongs to a custom post type, this parameter is ignored and the post is always deleted permanently and never sent to trash. Here is the relevant code inside that function that does this. {{{ if ( ! $force_delete && ( 'post' === $post->post_type || 'page' === $post->post_type ) && 'trash' !== get_post_status( $postid ) && EMPTY_TRASH_DAYS ) { return wp_trash_post( $postid ); } }}} I think the post types check in the above condition should not be made, but I am not sure why it is there and what are the implications of it. Steps to replicate this issue. - Create a post in a custom post type and note the post id. - Make the call to the function. Assuming 42 is the post id, the call will be `wp_delete_post( 42, false)` - Since the `$force_delete` parameter is set to `false`, the expectation is that the post should be sent to trash - But the post will be permanently deleted If it is agreed that it is a bug, then I can submit a patch to remove the post type check. " sudar Tickets Awaiting Review 47307 wp_insert_post: status 'future' is saved although 'publish' selected Posts, Post Types 5.2 normal normal Awaiting Review defect (bug) new has-patch 2019-05-17T16:55:15Z 2019-05-17T16:55:15Z "If I change the title of the page using the customizer, the changes are not saved because the changeset post is saved with status 'future' although 'publish' selected. I debugged the issue and found the following fragment of code of wp_insert_post is causing the issue: {{{#!php mysql2date( 'U', $now, false ) ) { $post_status = 'future'; } }}} This piece of code has no sense, because when the status is set as ""publish"", we don't want to change artificially to ""future"" because the publish date is now. It seems an issue with some versions of PHP/MYSQL, since is working on my local host (Windows) but not on the production server (PHP7.0, Ubuntu). I debugged the components of the comparison: {{{ $now => 2019-05-17 16:32:59 $post_date_gmt => 2019-05-17 18:32:59 mysql2date( 'U', $post_date_gmt, false ) => 1558110779 mysql2date( 'U', $now, false ) => 1558103579 }}} The date/time configuration of the server is: {{{ root@srvde1 ~ # date Fri May 17 18:33:24 CEST 2019 }}} There are other affected users over the years, searching on the Internet ""customizer does not save changes"". " daniol Tickets Awaiting Review 56700 wp_update_post function not support meta update Posts, Post Types normal normal Awaiting Review defect (bug) new 2022-09-30T15:04:23Z 2022-09-30T15:31:59Z "Hi. Seems like wp_update_post() function not support meta fields update. I found post meta update only in wp_insert_post() function https://github.com/WordPress/wordpress-develop/blob/6.0.2/src/wp-includes/post.php#L4498-L4502 Is there are some reasons to not include meta fields update in wp_update_post() function? Or this can be fixed in the future?" borisolhor Tickets Awaiting Review 55920 Ability to query by post author in post_exists() Posts, Post Types 6.0 normal normal Awaiting Review enhancement new has-patch 2022-06-04T22:57:51Z 2022-06-07T18:42:04Z "Needed the ability to determine if post exists by title && author when running wp_insert_post() in form submission. I was using this to create a list of user saved favourite posts. So this might be useful for others too function post_exists( $title, $content = '', $date = '', $type = '', $status = '', $author = '' ) {...} Pull Request #2783" mcqTia Tickets Awaiting Review 44435 Add Action / Filter in Post Details page for Screen Meta Links Posts, Post Types normal normal Awaiting Review enhancement new 2018-06-22T09:58:58Z 2019-01-16T06:50:09Z We can add action/filter in wordpress backend for Screen Meta Links so that using plugin we can add our own links with screen meta links. mohdjafarcedcoss Tickets Awaiting Review 54376 Add `is_post_publicly_viewable` filter Posts, Post Types normal normal Awaiting Review enhancement new 2021-11-04T22:33:22Z 2022-02-03T20:31:39Z "Related to #49628, #54375. Add a filter to the is_post_publicly_viewable() function to allow theme and plugin developers to override the default value. In some circumstances a developer may require the checks use different conditions to the default. " peterwilsoncc Tickets Awaiting Review 54020 Add a filter to allow updating post without changing the modified dates Posts, Post Types 5.9 normal normal Awaiting Review enhancement new dev-feedback 2021-08-26T22:40:11Z 2021-09-29T21:12:15Z "wp_update_post calls wp_insert_post which has code that always changes the modified date this causes problems when trying to fix posts via batch/wp-cli type operations {{{#!php post_date_gmt; $data['post_modified_gmt'] = $post->post_date_gmt; return $data; }; add_filter( 'wp_insert_post_data', $function, 10, 2 ); $updated = wp_update_post( $args ); remove_filter( 'wp_insert_post_data', $function ); }}} This function needs to make get_post() call for each insert and this slows the process in a big way I have added a filter that allows us to turn off the modification and set the date if needed {{{#!php date1, 'post_date_gmt' => date2 ) */ $update_date = apply_filters( 'wp_update_post_preserve_dates', false, $postarr ); if( false === $update_date ) { $post_modified = current_time( 'mysql' ); $post_modified_gmt = current_time( 'mysql', 1 ); } elseif ( ! is_array( $update_date ) && strtotime( $update_date ) ){ $post_modified = $update_date; $post_modified_gmt = get_gmt_from_date( $update_date ); } elseif ( is_array( $update_date ) && isset( $update_date['post_modified'] ) && isset( $update_date['post_modified_gmt'] ) ){ $post_modified = $update_date['post_modified']; $post_modified_gmt = $update_date['post_modified_gmt']; } else { $post_modified = $postarr['post_modified']; $post_modified_gmt = $postarr['post_modified_gmt']; } } else { $post_modified = $post_date; $post_modified_gmt = $post_date_gmt; } }}} " pbearne Tickets Awaiting Review 51403 Add filter for _post_states as it outputs raw HTML Posts, Post Types 5.5.1 normal normal Awaiting Review enhancement new 2020-09-28T07:39:47Z 2020-09-28T07:39:47Z Currently this function can't be overridden with a filter, so it outputs raw HTML separators and such directly into the post title in the edit screen. However it should be suggested to make it possible to display the post states in your own custom function, e.g. remove the separators and the divider with the title, which are currently hard-coded at the moment in the function as raw HTML? brandbrilliance Tickets Awaiting Review 57622 Add filter to get_page_by_path Posts, Post Types normal normal Awaiting Review enhancement new has-patch 2023-02-03T07:47:30Z 2023-02-03T19:15:44Z "Everything looks like that use `WP_Query` in `get_page_by_path` will be reverted [https://core.trac.wordpress.org/ticket/56689 56689]. Therefore, I have an idea to add a filter that allows ability to control results. Example: `apply_filters('get_page_by_path', $found_page, $page_path, $output_type, $post_type)`" uzumymw Tickets Awaiting Review 39841 Additional Post Button Options Posts, Post Types 4.7.2 normal normal Awaiting Review enhancement new 2017-02-10T18:38:24Z 2017-02-14T08:39:25Z "Turn ""Update""/""Publish"" into a button with a dropdown. So if a user selects say Update & Return it will redirect the user back to the posts admin screen. If a users selects the Update & Add New option then it would update that existing post, then redirect to a new posts screen or return to the post list screen instead." lukecavanagh Tickets Awaiting Review 46283 Allow filtering post-type archive rewrites Posts, Post Types 3.1 normal normal Awaiting Review enhancement new has-patch 2019-02-20T02:59:18Z 2019-02-20T02:59:18Z If one wishes to introduce additional query arguments into a post-type archive's rewrite structure, the current options are rather cumbersome: filter the rewrites as they're generated, filter the whole rewrites array, or reproduce a considerable amount of logic from `WP_Post_Type::add_rewrite_rules()`. By introducing a few filters on the archive-specific rewrites, it becomes far easier to customize a post type's archive rewrites. ethitter Tickets Awaiting Review 53425 Allow meta_input to be updated through user input Posts, Post Types 5.8 normal normal Awaiting Review enhancement new has-patch 2021-06-16T09:38:54Z 2021-06-16T09:38:54Z "Hi everyone! This is my first ticket on WordPress trac! Since 2 years and this changeset [44295], it's not possible anymore to insert/update metadata through user input using **meta_input** entry. Indeed ''_wp_get_allowed_postdata()'' remove the ''meta_input'' entry from ''$_POST''. Therefore the ''wp_update_post()'' function, then the ''wp_insert_post()'' one receive data without ''meta_input''. I check the code a lot, and there is no hooks to re-inject properly the ''meta_input'' entry. (all the hooks come too late, after post inserting/updating). I will finally get to my goal, but in an ugly and heavy way. I propose to introduce a new hook to filter the not allowed post data fields, changing ''[https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/post.php#L214 _wp_get_allowed_postdata()]'' function like that (line 224): {{{#!php /** * Filters the not allowed fields before to remove them from post data. * * By default, meta_input, file and guid are not allowed in post data. * * @param array $not_allowed Default not allowed post data fields. * @param array $post_data Array of post data. * * @return array Not allowed post data fields. */ $not_allowed = (array) apply_filters( 'not_allowed_postdata', array( 'meta_input', 'file', 'guid' ), $post_data ); return array_diff_key( $post_data, array_flip( $not_allowed ) ); }}} Thanks. Have a nice day :-)" freepius Tickets Awaiting Review 38599 Allow verbose rewrite rules with custom post types Posts, Post Types normal normal Awaiting Review enhancement new 2016-11-01T00:08:41Z 2021-07-27T05:50:55Z "Every time I create a custom post type (say, Book) I invariably want a structure like this: /books/ - static page where I can write all sorts of overview content with all of the formatting provided by the theme's page template (not a basic post type archive) /books/book-1/ /books/book-2/ - custom post type permalinks This is possible by using a rewrite slug of books. However, if someone then creates a subpage of books, they'll get a 404 error, full stop. This has been around a long time, and many workarounds have been provided in trying to get verbose rules triggered, such as: https://gist.github.com/mattberridge/2960966 Rewrite rules underwent some major changes a while ago for improved performance (to get %postname% permastructures working well, then there were pretty attachment URLs, etc), which results in these workarounds no longer working. (Custom post type rules get inserted at a place which isn't easy to reorder and conflicts with other rules). Instead, I have to keep using unique prefixes which make things look messy and confusing to visitors: /books/ /book/book-1/ (even though there is no /book/ page on my site) Having a nicer structure seems like a very common use case (especially given the number of search results you'll find about workarounds). I'd like to suggest allowing custom post types to trigger verbose rules in a way that will work." smerriman Tickets Awaiting Review 55306 Before posts/pages listing if there multiple filter drop-downs, view of pagination buttons are not better looking. Posts, Post Types 5.9.1 normal normal Awaiting Review enhancement new has-patch 2022-03-03T12:21:37Z 2022-04-27T11:50:32Z "While working on multiple drop-downs for particular post type, I came to find this bug when there is pagination is involved, UI is slightly damaged. Check the attachments for more details. " haritpanchal Tickets Awaiting Review 43702 Empty State UX for Posts & Pages screen when there is no content Posts, Post Types 4.9.5 normal normal Awaiting Review enhancement new 2018-04-05T16:35:04Z 2020-10-27T19:51:04Z "The default screen people see when they first visit the Posts, Pages, etc., dashboard sections is quite uninspiring. Taking a cue from WooCommerce's default product screen (screenshot included), we can enhance the default Posts & Pages screens to make it a bit more welcoming to new users." mrtortai Tickets Awaiting Review 43740 Filter WP_Post methods (vs. removing final/'get_post' filter) Posts, Post Types normal normal Awaiting Review enhancement new dev-feedback 2018-04-11T21:33:26Z 2020-02-27T11:09:37Z "There has been a lot of demand to remove `final` from `WP_Post` and to add a `get_post` filter, for good reason. There as also be a lot of pushback on those actions, also for very good reason. Both sets of reasons can be found in ticket #24672 and #12955, respectively. In a nutshell for, there are many valid use-cases where being able to extend `WP_Post` would make for more robust and maintainable code. In the against case, removing `'final'` could easily resolve in an explosion of incompatible child classes making plugin interoperability challenging, and backward compatibility almost impossible if code decided to evolve WP_Post in any way. And the `'get_post'` filter would be almost as bad as removing `final`, and I am one who advocated for both for years. However, we actually already have an extensibility mechanism that has shown the test of time and that is the use of filter hooks. Given a judicious use of filter hooks we could actually allow developers to extend `WP_Post` in a compossible manner thus minimizing plugin integration problems and also safeguarding core's ability to add enhancements in the future. The proposal is basically to add filter hooks in the methods of `WP_Post`, and to add a `__set()` and `__call()` magic method as a companion to the existing `__get()` magic method. Here are the filters I am proposing: ||= Filter Hook=||=Method=|| || `'wp_post_supports_instance'` || `__construct()`|| || `'pre_wp_post__isset'` ||`__isset()`|| || `'wp_post__isset'` ||`__isset()` || || `'wp_post__call'` || `__call()` || || `'wp_post__set'` || `__set()` || || `'pre_wp_post__get'` || `__get()` || || `'wp_post_filter'` ||`filter()` || || `'wp_post_to_array'` || `to_array()` || And then this action hook: * `'wp_post__construct'` in `__construct()` I have attached a patch for `class-wp-post.php` that would implement these hooks." MikeSchinkel Tickets Awaiting Review 50654 Fix the filter docs in sanitize_post_field() Posts, Post Types normal normal Awaiting Review enhancement new 2020-07-13T22:38:49Z 2020-07-13T22:41:23Z "The `sanitize_post_field()` function calls nine separate filters on its data depending on various conditions. The documentation for these need improving, and documentation for the missing filters need adding. Need to be careful about accuracy here because of the very general names of these filters and their dynamic portions." johnbillion Tickets Awaiting Review 42089 Function to detect if current page is a preview of a draft Posts, Post Types 4.8.2 normal normal Awaiting Review enhancement new 2017-10-04T17:56:22Z 2018-02-24T11:52:08Z "It would be very helpful if there was a function to detect if the page being viewed is a preview of a draft. Call this is_draft_preview(). Currently, you can achieve this check with code like this: {{{#!php post_status; return ( is_preview() && $is_draft ); } }}} " paulschreiber Tickets Awaiting Review 42088 Function to detect if current page is a scheduled post (is_scheduled() or is_future()) Posts, Post Types 4.8.2 normal normal Awaiting Review enhancement new 2017-10-04T17:52:44Z 2018-02-24T11:51:01Z "It would be very helpful if there was a function to detect if the page being viewed is a scheduled post. Call this is_scheduled() or is_future(). Currently, you can achieve this check with code link this: {{{#!php post_status; return ( is_preview() && $is_future ); } }}} " paulschreiber Tickets Awaiting Review 46242 Heartbeat Posts, Post Types 5.0.3 normal normal Awaiting Review enhancement new 2019-02-12T21:51:08Z 2019-02-12T21:51:08Z "While Heartbeat has its merits, on some pages it isn't fully needed and it's also too hard to disable it properly. Would it be possible to add extra arguments to register_post_type with options to enable/disable heartbeat (and depending scripts (e.g. autosave, wp-remove-post-lock))? If it's not possible at least load heartbeat related files at the end of a page load (footer). With query monitor I noticed these ajax calls are loaded first before anything else. Kind regards, Kiarashi" mireillesan Tickets Awaiting Review 55583 "Hook before and after ""Add New"" button in edit screen" Posts, Post Types 6.0 normal normal Awaiting Review enhancement assigned has-patch 2022-04-17T18:30:50Z 2022-04-17T18:30:50Z "I need to add a new button after the ""Add New"" button but there is no hook placed. **Example Usages:** Add a button to manage bulk migration from other sources [[Image(https://prnt.sc/cR-GdDNnVe6Z)]]" rafiq91 Tickets Awaiting Review 49958 Improve paginator in general-template.php Posts, Post Types normal normal Awaiting Review enhancement new 2020-04-20T10:21:34Z 2020-04-20T11:14:52Z "I would like to add custom classes to the default paginator in the `general-template.php` file. For that I would suggest the following change: {{{#!php %s', /** This filter is documented in wp-includes/general-template.php */ esc_attr( apply_filters( 'paginate_classes' ) ), esc_url( apply_filters( 'paginate_links', $link ) ), $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] ); }}} That needs to be applied to every `page-numbers` element and would be very helpful." lolitsjohnnyboy Tickets Awaiting Review 48375 Introduce a separate capability for trashing a post Posts, Post Types normal normal Awaiting Review enhancement new 2019-10-20T20:40:44Z 2020-01-06T20:06:53Z "Related: #41674 It's sometimes desirable to allow users to trash posts but not permanently delete them once trashed, nor empty the trash. There should be a meta capability, `trash_post|trash_posts`, which by default maps to `delete_post|delete_posts` which is used when a post is trashed instead of deleted. This would allow a plugin to grant a user the ability to trash posts but not permanently delete them." johnbillion Tickets Awaiting Review 51787 Introduce dedicated function that retrieves post object by metadata Posts, Post Types 5.5.3 normal normal Awaiting Review enhancement new dev-feedback 2020-11-16T13:39:13Z 2020-11-16T13:39:13Z "Just wanted to suggest a function I routinely use when building custom themes that utilize metadata. {{{#!php $post_type, 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'meta_compare' => '=', ); $posts = get_posts( $args ); if ( ! empty( $posts[0] ) ) { return $posts[0]; } return false; } }}} " DaveyJake Tickets Awaiting Review 51365 Introduce dedicated function to check if post meta exists Posts, Post Types normal normal Awaiting Review enhancement new dev-feedback 2020-09-20T21:12:09Z 2020-09-20T23:15:28Z "Just wanted to suggest a simple function that checks for pre-existing metadata for the native `post` post type. Looking forward to getting more involved and collaborating with everyone! {{{#!php 'slug'), $url); } }}}" sebastian.pisula Tickets Awaiting Review 41674 More granular capabilities for restoring and permanently deleting trashed posts Posts, Post Types normal normal Awaiting Review enhancement new needs-unit-tests 2017-08-19T16:00:27Z 2017-08-19T16:00:27Z "Currently the user capability required for restoring a trashed post or permanently deleting a trashed post is `delete_post`, which maps to `delete_posts`. There should be a separate capability for each of these actions. Suggestion: * `restore_trashed_post` which maps to `restore_trashed_posts` which maps to `delete_posts`. * `delete_trashed_post` which maps to `delete_trashed_posts` which maps to `delete_posts`. Emptying the trash should use the `delete_trashed_posts` capability. This allows for more granular control over which users can or cannot restore or permanently delete posts." johnbillion Tickets Awaiting Review 49644 Move logic from register_post_type() into WP_Post_Type->register() Posts, Post Types 5.4 normal normal Awaiting Review enhancement new dev-feedback 2020-03-13T16:12:45Z 2020-03-13T17:16:54Z "I have not looked at `register_post_type()` in several years, but was pleasantly surprised to find major improvements where most of the logic was refactored and moved to `WP_Post_Type`. Still though, it appears there are a few missing capabilities that a bit more refactoring would resolve. I propose we move most of the logic found in `register_post_type()` into `WP_Post_Type->register()` and a bit of the validation logic into `WP_Post_Type->__construct()` ''(see attached patch.)'' Similarly, it would make sense to also move the logic in `unregister_post_type()` to a `WP_Post_Type->unregister()`. One of the benefits of this change is that currently `register_post_type()` has validation logic but `WP_Post_Type->__construct()` does not so someone can call `new WP_Post_Type('this-is-a-far-too-long-post-type-name')` and not get an error and allow a too-long post type name to be registered whereas `register_post_type('this-is-a-far-too-long-post-type-name')` currently throw an error and not let the name through. With this change, but approaches would validate. The benefit of adding `WP_Post_Type->register()` and `WP_Post_Type->unregister()` is simply that those wanting to use the object to create their post types do not need to duplicate the logic in `register_post_type()`. The benefit of this is being able to write code like this and leverage PHP's validation of object property names: {{{#!php label = __( 'Widgets', 'my_app' ); $post_type->public = true; $post_type->menu_icon = 'dashicons-admin-generic'; $post_type->register(); }}} Notice I added a backward-compatible additional parameter to the `unregistered_post_type` hook to indicate if the post type existed in `$wp_post_types` before the attempt to unregister it. AFAICT there will be no backward compatibility or documentation issues with this change, so this should be a slam-dunk, right? " MikeSchinkel Tickets Awaiting Review 34009 Need ability to query what post_type_supports values plugins and themes might use Posts, Post Types 4.4 normal normal Awaiting Review enhancement new 2015-09-25T10:11:30Z 2017-07-01T10:43:48Z "A number of plugins and themes define their own values to pass to add_post_type_support(). e.g. Jetpack's `publicize`, and the Genesis theme framework's values prefixed with `genesis-`. I have a post type UI where I allow the user to decide which feature a post type supports. The current API does not allow me to find the full set of possible values. `$_wp_post_type_features` only lets me find out what's currently registered. I propose a new API `get_all_post_type_supports_features()` that invokes a filter `post_type_supports` to allow plugins and themes to return a complete list of post type supports values, along with user friendly labels. Currently my routine returns the set I can get from `$_wp_post_type_features` and my filter function augments it with additional options. {{{ array ( 'publicize' => ""Publicize with Jetpack"" 'home' => ""Display in blog home page"" 'genesis-layouts' => ""Genesis layouts"" ... ) }}} WordPress core would respond to the `post_type_supports` filter with: title, editor, author, etcetera " bobbingwide Tickets Awaiting Review 37051 New filter `wp_page_path_sql` Posts, Post Types normal normal Awaiting Review enhancement new has-patch 2016-06-08T06:24:28Z 2017-10-24T19:13:32Z "Make plugin for translations I found next missing filter. WordPress use get_page_by_path in WP->parse_request(); In post meta I save info about language version. Example: ""Contact"" in German and Polish is ""Kontakt"" so slug will be 'kontakt'. Function get_page_by_path fiund by slug in all languages. But in filter `wp_page_path_sql` I can add LEFT JOIN and set current language. I know that exists `parse_query` action and I can change query via this action but before in `wp_page_path_sql` will be generate unnecessary sql. This sql filter will be usefull very much. " sebastian.pisula Tickets Awaiting Review 49164 Page List Order Posts, Post Types normal major Awaiting Review enhancement new 2020-01-10T15:30:24Z 2020-01-13T19:27:23Z "By default, pages in the WP Page List should default to the last added/edited page. Currently, the order of pages seems unfathomable. I have 247 pages and after I have created a new one, I then have to search for it, often by saying show me only pages I created or edited this month. This is a constant waste of time. As well as a proper and useful default order, you should be able to set the order you want to see permanently via settings or by being able to save the current set up of the Page List" jfortune Tickets Awaiting Review 49194 Page Template dropdown ordering should be by title, not value Posts, Post Types normal minor Awaiting Review enhancement new 2020-01-14T12:11:11Z 2020-01-14T14:04:52Z "The ordering of items within the Page Template dropdown field is sorted by the value alphabetically, which often creates what appears to be an unordered display when viewing on the front end. I this should be changed so the ordering of the dropdown options is based on the alphabetical order of the list items themselves." leec87 Tickets Awaiting Review 57829 "Post ""Read"" Capability for Rest API" Posts, Post Types normal normal Awaiting Review enhancement new 2023-03-01T00:56:55Z 2023-07-20T17:58:58Z "Posttypes with the public attribute set to false are still queryable through the rest api. Since it seems there is no other capability to check for a general read permission of posts and the 'show_in_rest' attribute is needed for the block editor and to make the post queryable by authenticated users, i think it makes sense to either introduce said ""read_post"" capability or to make rest api requests only query editable posts when the posttype has public set to false. Not having the option to have a non-public posttypes and the rest api enabled at the same time without any further workaround seems unintuitive to me. " juvodesign Tickets Awaiting Review 60791 Pre-populate slug using URL parameters on new post edit screen. Posts, Post Types normal normal Awaiting Review enhancement new has-patch 2024-03-17T06:29:23Z 2024-03-17T15:28:10Z "get_default_post_to_edit() allows to pre-populate `post_title`, `content`, and `excerpt` from `$_REQUEST`. This URL will pre-populate the title and the content: /wp-admin/post-new.php?post_type=post&post_title=My+Title&content=aaaa I have an use case where I need to do the same for the `post_name`: https://wordpress.org/support/topic/set-title-and-slug-of-new-post-using-url-parameters/ I have a shortcode that allows me to load content from a custom post type, and it searches by slug (it needs to be this way for UX reasons). If the post with the provided slug doesn't exist, I register an admin notice alerting that the shortcode is trying to load an unexisting post, and offer a link to create the missing post with the specified slug. I need the slug to be pre-populated with the URL parameter, just as it is possible to do for title, content, and excerpt." gerardreches Tickets Awaiting Review 40825 Re-addressing validation/sanitization of IDs to allow filtering before WP_Post (and others) database query Posts, Post Types 4.7.5 normal normal Awaiting Review enhancement new dev-feedback 2017-05-20T00:00:04Z 2017-09-26T21:47:27Z "The following ticket spawned from a desire to import content from outside of the WordPress database but have it treated as a native content type. A concept that has a clear audience that desires this functionality (see ticket: #12955) and has been addressed in a number of different ways. I believe the least impactful way to address this ''without'' removing the 'final' keyword from the WP_Post class that also improves standards for validation and sanitization of the ID value typically passed to get_posts() is to use the ID as a sort-of 'decorator' unto itself. When merging the content from multiple sources to be displayed in a theme the biggest conflict to arise is duplication of IDs. Since the remote source is ignorant to the ID numbers already in use in the wp_posts table, a requirement for a ""decorated"" ID determined. WordPress currently does not have a standard method for validating the format of the variable that will ultimately be passed to get_post() to create a new WP_Post object. The following methods are implemented in core files to attempt to sanitize '''''or''''' validate the value passed as an ID ^(*see links for pro/cons of usage in WP)^: * [https://gist.github.com/LinzardMac/b27e738aee52cb3e45c1909fb555cec5 (int) Typecast / intval()] * [https://gist.github.com/LinzardMac/0d1915dfe78fc68f0b3c64d50cf2cb41 is_numeric()] * [https://gist.github.com/LinzardMac/31ed99f8faa34ffad6e666f213e99870 absint()] == '''My Suggestion''' == I recommend creating a new function that will standardize the validation and sanitization of ID numbers that are being passed to a database query. All instances of is_numeric, (int), intval(), and absint() that are used as a way to validate or sanitize (or both validate and sanitize) an ID number that is passed to a query from an external function should be replaces with a new function that will serve both purposes. The new function will return a falsey response OR throw an exception when validation fails or if validation passes, will sanitize the value to a format compatible with the typical MYSQL type for the ID column (bigint). Inside of this new function we can include a filter that will allow developers to override certain restrictions, specifically for allowing external content to be treated as a WP_Post object or some other native content that commonly would exist in WordPress’ database. Since WP_Post will always look for a cached version of the object before querying the database, we make sure to store all necessary values in the cache before the template is loaded after we run our remote_get. We utilize the concatenated ID which is formatted like 12345-REMOTE as the ID in the cache so as to avoid conflicts w/ existing post IDs that are also stored in the memory cache. The only hurdle to this was the fact that core files were forcibly casting IDs as integers long before a query of any sort were to be made. The argument for sanitizing early was to catch malformations early, but all it seemed to do was force the type early and never truly ""caught"" a bad value passed as an ID. A true “early catch” would either sanitize early w/ a falsey response or Exception and/or find the cached version as early as the sanitization so as to avoid the rest of the process of getting the WP_Post instance anyways. Available in the following gist is my suggestion for a better validation function I called ```is_valid_id()```, an example of how filters can be used on this sanitization function to allow external content to be treated as if it was a WP_Post object, and it's usage within a core file that previously used one of the subpar validation functions ( in this case meta.php using is_numeric() ) *comments in the file are just opinions and alternative thoughts I had while crafting this https://gist.github.com/LinzardMac/38bbe22feb0b0a3fbabfcf64d797cd80 !** It could be worthy of note that I have been using some version of this code in a live production site for the last 4 months without any changes needed to plugins or template files to account for this ""non native"" content. " LindsayBSC Tickets Awaiting Review 50161 Slow query in WP_Posts_List_Table, no way to avoid with filters/hooks Posts, Post Types 5.4.1 normal normal Awaiting Review enhancement new 2020-05-14T02:43:29Z 2021-03-11T15:13:25Z "The post listing page on my wordpress installation is taking more than 15seconds to load (wp_posts w/ more than 120k records, running on an AWS EC2 t2.large instance), and the main cause of this is the following query in the constructor of class wp-admin/includes/class-wp-posts-list-table.php: {{{ SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ( '"" . implode( ""','"", $exclude_states ) . ""' ) AND post_author = %d }}} It is used just to count the posts the logged-in user posted and show it over the listing table (in ""Mine"" link). There is no way to filter this out or enhance the query (other than changing this file). Suggestion: try to create an database index for this query (I tried, but failed), or enhance it in some way to make it faster. Other option is to remove this ""Mine (xx)"" link above the listing, using hooks. " LucasMS Tickets Awaiting Review 43294 Sticky class should be added regardless of where posts are queried Posts, Post Types normal normal Awaiting Review enhancement new 2018-02-12T12:18:27Z 2019-01-16T06:50:09Z "post_class() function is only adding `.sticky` class when `is_home()` is true, basically > ...if the query is for the blog homepage. [http://developer.wordpress.org/reference/functions/is_home/ is_home() reference] Check out [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post-template.php#L512 the code] in [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post-template.php#L461 get_post_class()] function {{{ #!php 512 // sticky for Sticky Posts 513 if ( is_sticky( $post->ID ) ) { 514 if ( is_home() && ! is_paged() ) { 515 $classes[] = 'sticky'; 516 } elseif ( is_admin() ) { 517 $classes[] = 'status-sticky'; 518 } 519 } }}} This behavior complicates recognizing sticky post when using custom queries, as they're mostly used outside of homepage, which fails `is_home()` check, requiring extra work to add `.sticky` class where it should be. I suggest removing the `is_home()` check from the condition in `get_post_class()` function." Selrond Tickets Awaiting Review 41739 "Support a ""source"" attribute in post types, taxonomies, and post statuses" Posts, Post Types 3.0 normal normal Awaiting Review enhancement new 2017-08-28T02:07:31Z 2017-08-28T02:27:55Z "When registering custom post types, taxonomies, or post statuses, it would be nice to have a way to tell the system what plugin was responsible for those registrations. Use Case: In bbPress, there are 3 post types, 1 taxonomy, and 4 post statuses. There are several places where an ""any bbPress post type"" or ""any bbPress post status"" comparison is necessary, but it's somewhat annoying and repetitive to need to write: {{{ array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() ) }}} I'd prefer to write: {{{ get_post_types( array( 'source' => 'bbpress' ) ) }}} Tangentially, this could replace the otherwise vague `internal` property, with: {{{ 'source' => 'wordpress' }}} I'm not confident that `source` is the best descriptor, or if `domain` or `namespace` or something else might be more appropriate (without being too vague to be useful.)" johnjamesjacoby Tickets Awaiting Review 39603 The more posts with similar names you have, the slower you save the next one Posts, Post Types normal normal Awaiting Review enhancement new has-patch 2017-01-16T14:51:13Z 2021-06-16T13:09:56Z "Hello, developers! Thank you for your work on Wordpress! While using Flamingo for saving Contact Form 7 submissions, I encountered a huge slowdown after more than 11 000 submissions had been saved. I thought it was a Flamingo problem, but it appears that all autogenerated post-types in Wordpress can cause this problem. Contact Form 7 saves submissions as posts with 'flamingo_inbound' type, and uses 'your-subject' slug when a form doesn't have a subject (which is my case). So, in all saved form submissions I have 'your-subject, your-subject-2, ..., your-subject-N' slugs generated by wp_unique_post_slug(). The problem is that for every new 'your-subject-N' slug wp_unique_post_slug() issues N-1 SELECT queries. In other words, wp_unique_post_slug() bruteforces a new possible slug, generating a lot of SQL queries fetching all previously saved similar posts. You can see it if you run the attached 'generate-many-posts.php' script from your Wordpress root (more and more queries will be used for saving every new post). Also, let me suggest a solution. With the attached patch we don't bruteforcing the slug suffix. We just get the last appropriate slug, increment it's suffix, and than use this suffix in a new unique slug." bisyarin Tickets Awaiting Review 43287 "The text ""immediately"" should be capitalize in publish meta box." Posts, Post Types 4.9.4 normal normal Awaiting Review enhancement new has-patch 2018-02-11T08:55:48Z 2019-11-18T17:36:21Z "If we see in the ""Publish"" metabox, Status and Visibility texts are capitalize. So ""immediately"" text should also be capitalize." jainnidhi Tickets Awaiting Review 40711 WP_Post:get_instance: Update cache if $_post->filter is empty Posts, Post Types 4.7.4 normal normal Awaiting Review enhancement new has-patch 2017-05-10T09:52:07Z 2017-05-10T12:48:51Z "WP_Post::get_instance always returns raw filtered posts. At least in my tests it gets many hits where a post is already cached, but not filtered. For each hit it calls sanitize_post again. To improve performance, if a cached post isn't filtered, update the cache after calling sanitize_post. class-wp-post.php, line 228: Instead of {{{#!php } elseif ( empty( $_post->filter ) ) { $_post = sanitize_post( $_post, 'raw' ); } }}} add wp_cache_replace {{{#!php } elseif ( empty( $_post->filter ) ) { $_post = sanitize_post( $_post, 'raw' ); wp_cache_replace( $_post->ID, $_post, 'posts' ); } }}} This significantly reduces unnecessary calls to sanitize_post. " greencp Tickets Awaiting Review 56576 When post is switched from published to draft, create revision Posts, Post Types normal normal Awaiting Review enhancement new 2022-09-15T08:35:32Z 2022-09-15T10:34:29Z "Hello, I was thinking if it's possible to create a revision also when a post is switched from published to draft. At the moment, I was unable to see when someone switched the post status. Looking forward to your answers. Kind regards," denisflorin197 Tickets Awaiting Review 44377 "add filter to post_submit_meta_box() to conditionally refrain from outputting the ""Visibility"" fields" Posts, Post Types normal normal Awaiting Review enhancement new 2018-06-15T19:07:57Z 2018-06-15T19:07:57Z "I have a CPT that, by it's very nature, always has visibility `public` (not private nor password protected). Since I don't want users selecting anything other than `public`, currently, I enqueue some CSS that hides the ""Visibility"" related fields in the ""Publish"" metabox on `/wp-admin/post.php` and `/wp-admin/post-new.php`, but that just seems kludgy. **Note:** in case a ""sneaky"" user finds my CSS, unhides the fields and sets the post to be private or password protected, I also hook into [[https://developer.wordpress.org/reference/hooks/wp_insert_post_data/|wp_insert_post_data]] to ""correct"" `post_status` and `post_password`. It would be helpful if there were a filter in [[https://developer.wordpress.org/reference/functions/post_submit_meta_box/|post_submit_meta_box()]] to control whether the ""Visibility"" related fields are output. Such a filter would be similar in spirit to the [[https://developer.wordpress.org/reference/hooks/view_mode_post_types/|view_mode_post_types]] filter in [[https://developer.wordpress.org/reference/classes/wp_screen/render_view_mode/|WP_Screen::render_view_mode()]] that controls whether the ""View Mode"" related fields are output in ""Screen Options"". Prior to `view_mode_post_types` being introduced in 4.4, I used to hide those fields via CSS when appropriate. " pbiron Tickets Awaiting Review 45035 "allow register_post_type() arg to control whether a CPT's counts are added to the ""At a Glance"" Dashboard widget" Posts, Post Types normal normal Awaiting Review enhancement new has-patch 2018-10-03T15:38:28Z 2019-08-16T19:02:06Z "It would be nice if there an arg to `register_post_type()` that controlled whether the CPT's counts were added to the ""At a Glance"" Dashboard widget, e.g. {{{#!php true, ... ) ); }}} Ideally, I think it should default to the value of `show_in_menu`, but as current behavior is the equivalent of `false` I'd be OK with that as the default as well. Another ""nice to have"" would be to allow the param to take a string value that would be interpreted as a `post_status` to show the count for, e.g., show counts for custom post_status = `mycustompoststatus` instead of `publish`. I have code that does all of the above, but it would have to be refactored a little bit to submit as a patch (especially to account for the `_builtin` post_types that already appear in AAG). If folks think this would be a good enhancement I'd be glad to work on that refactoring and submit a patch." pbiron Tickets Awaiting Review 40650 get_pages() should accept 'any' among it's post_status arg Posts, Post Types 4.7.4 normal normal Awaiting Review enhancement new has-patch 2017-05-03T14:42:23Z 2023-07-06T12:29:19Z "`WP_Query::get_posts()` accepts `'any'` among it's `$post_status` `$query_vars` and I think `get_pages()` should do the same. I've combed through the 4.7.4 core code and can't find any place where this enhancement would break existing code." pbiron Tickets Awaiting Review 28798 htaccess and protected option Posts, Post Types 4.0 normal normal Awaiting Review enhancement reopened 2014-07-09T08:50:25Z 2021-10-15T13:25:45Z "I already tried to solve this problem in the forum and was told that it is a matter of the core. So here is not a bug but my suggestion for an improvement of the following matter: For security reasons I use htaccess to protect my wp-login.php. Now I'd like to protect a single page by using the WordPress password protected option. Unfortunately the /wp-login.php?action=postpass is needed by this option. In the consequence all the visitors that want to see my password protected page need as well my htaccess password for wp-login or I can't use htaccess to protect my wp-login. Would it be possible to use the password protection for single pages and posts without using wp-login.php. Maybe by creating an extra transfer page for protected content naming differently as wp-login? I'm no developer and just talking from the perspective of a WordPress user. In case this idea is foolish I excuse myself in advance. " YU.Design Tickets Awaiting Review 48769 meta_input, tax_input, tags_input and post_category arguments are not available in functions or methods hooked to wp_insert_post Posts, Post Types normal normal Awaiting Review enhancement new dev-feedback 2019-11-22T15:24:55Z 2020-01-02T02:12:39Z "Functions and methods hooked to `wp_insert_post` are currently passed `$post_ID`, `$post` and `$update`. When a call to `wp_insert_post()` is made we can pass an array argument. The array can have `meta_input`, `tax_input`, `tags_input` and `post_category` elements. Current call to `do_action()`: {{{ do_action( 'wp_insert_post', $post_ID, $post, $update ); }}} Proposal: {{{ do_action( 'wp_insert_post', $post_ID, $post, $update, $postarr ); }}} Thoughts: `$postarr` could be either the raw array passed to `wp_insert_post()` or the result of the raw array being merged with the set of defaults used. There are more hooks in the `wp_insert_post()` function such as `save_post`. These could be updated in the same way for consistency. " henry.wright Tickets Awaiting Review 31154 register_post_type function does not check reserved post_types Posts, Post Types 4.2 normal normal Awaiting Review enhancement new 2015-01-28T11:13:28Z 2022-02-21T15:39:56Z "the function register_post_type() in wp-includes/post.php does not check for reserved post types. But later on this will cause malfunctions or unexpected behaviour and bugs. I wrote a very simple patch that checks if any of the reserved post_types are being registered and if so it notifies the developer by _doing_it_wrong and WP_Error as a fallback. Projects and plugins that are using reserved post_types in the wild will not break. But the developers will be notified via the logs or on their development environments where WP_DEBUG is true. ps. I will submit a similar ticket for taxonomies after this one. " sebastiaandegeus Tickets Awaiting Review 52518 sanitize_post_field filter for 'raw' context Posts, Post Types 5.6.1 normal normal Awaiting Review enhancement new 2021-02-13T16:07:55Z 2021-02-13T22:57:32Z "In some cases it can be useful to change values in `raw` context. For example I need to change `post_status` value for `replyto-comment` ajax call, like so: {{{#!php 'any', 'post__in' => [10,20,30,40,50] ]); }}} This code works well, however I have a lot of different post types (15+) on my site and as a result the database query looks like this: {{{ SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND ((wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?)) OR (wp_posts.post_type = ? AND (wp_posts.post_status = ? OR wp_posts.post_status = ?))) WHERE wp_posts.ID IN (?) GROUP BY wp_posts.ID ORDER BY FIELD(wp_posts.ID,?,?) }}} As you can see, it checks post_type + post_status for every public post type on my site. But the wp_get_posts() attributes explicitly declare a list of ids and that the post type can simply be ignored in this case (because the post_type is set to ""any""). The relevant query should be like this (because it covers all requirements): {{{ SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.post_status = ?) WHERE wp_posts.ID IN (?) GROUP BY wp_posts.ID ORDER BY FIELD(wp_posts.ID,?,?) }}} I checked class-wp-query.php and didn't find a solution without making changes to the WordPress code. There may already be a workaround implemented - it would be nice to know it. But this can be easily implemented by adding something like post_type=""all"" (similar to ""any""). The implementation of the idea has been added to the patch file (attached). Thanks in advance!" madeinua Tickets Awaiting Review 49708 Add a new function get_page_by_guid Posts, Post Types normal normal Awaiting Review feature request new 2020-03-27T09:20:31Z 2024-01-26T07:45:56Z "We have two different functions to get a post base from another field rather than ID `get_page_by_path` and `get_page_by_title`. When working with RESTful API working with unique identifier could be more handy than auto incremental or a path that could change. I propose to build a function named `get_page_by_guid` and help developers to search a Post more accurate with guid." killua99 Tickets Awaiting Review 60189 Add post duplication quick action Posts, Post Types trunk normal normal Awaiting Review feature request new 2024-01-03T21:59:24Z 2024-01-03T21:59:24Z "It seems like a useful feature (and one recent complaint from a client) to quickly duplicate a post so users can, for example, protect an existing version and work on a new draft. It's possible to do it right now if they copy all the blocks and paste them on a new page, but it'd be quicker and easier to click somewhere instead. I propose to add a new post quick action, as well as an action inside the post editor." zaguiini Tickets Awaiting Review 55287 Allow for DISTINCT in WP_Query method Posts, Post Types 6.0 normal normal Awaiting Review feature request new 2022-03-01T15:55:09Z 2022-03-01T15:55:09Z "Dear wordpress developers, Currently I'm working with a plugin to create designs. This plugin has an element called a repeater element that basically makes use of the core WP_Query method in order to fetch custom post types or normal post types. However, since I'm using this page builder or theme builder, I am in no way capable of using DISTINCT within the filter https://developer.wordpress.org/reference/hooks/posts_distinct/ Because this requires me to send the WP_Query instance, which is basically only used within the repeater element and can not be set to a variable in this particular case. This means I'll have to rebuild everything through code, instead of being able to use my page or theme builder. Now I get the idea of saying this is a bug with the page or theme builder plugin. But in fact, what I want to know is why are we using a filter to create a DISTINCT query inside of WP_Query? Isn't it possible to implement this inside of the WP_Query arguments instead? I basically want to say: fetch posts with unique titles. This seems much more logical as the SQL query is build from WP_Query... I've already looked through the entire codex, and couldn't find any possible parameter that could be used for this... My question to you is: Can this please be added to wordpress core? I find it highly frustrating that WP_Query doesn't have this sort of capabilities out of the box." simbaclaws Tickets Awaiting Review 58838 Author filter on a posts list page Posts, Post Types normal normal Awaiting Review feature request new 2023-07-18T10:57:32Z 2023-07-18T10:57:32Z "**Current Behaviour** Under the user list, it shows only the published count but when visiting the list page from the user list then it shows all the published and drafts in the list and the count shows different. **Expected Behaviour** If the draft, pending, or any other types are available then it should have a proper count based on the selected author. **Suggestion** The Author filter allows administrators to filter and view posts created by specific authors quickly. This feature is handy when managing large amounts of content or coordinating with multiple authors, making it easier to locate and work with particular posts. Redirecting from the user list page the default author should have to be preselected in the author filter." mikinc860 Tickets Awaiting Review 59374 "Bulk Edit does not let me remove ""Uncategorized"" for categorized posts" Posts, Post Types 6.3.1 normal normal Awaiting Review feature request new 2023-09-17T11:23:39Z 2023-09-17T11:23:39Z "Bulk Edit Posts does not let you remove category ""Uncategorized"" even when the posts do all have an additional Category." cmdgw Tickets Awaiting Review 32824 Consistent search fields between posts and terms Posts, Post Types normal normal Awaiting Review feature request new 2015-06-29T13:42:54Z 2017-07-23T02:17:53Z Searching for posts [https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/query.php#L2091 currently checks] the `post_title` and `post_content` fields, while [https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/taxonomy.php#L1899 searching terms] checks the `name` and `slug` fields. Could `post_name` be added to the where clause for posts, and `description` be added to terms? That way, searching would consistently check an entity's title, slug, and content. ashworthcreative Tickets Awaiting Review 43348 Filter by 'Authors' option in wp-admin/edit.php?post_type=page Posts, Post Types normal normal Awaiting Review feature request new 2018-02-18T21:21:44Z 2018-02-20T15:03:56Z "Hey! Currently, I am able to filter by posts created by myself, It would be handy to have the option to filter by other authors contributing to the site, to keep track of who has posted what. Possibly an author drop down could be added which lists all Authors and a filter button to show their posts, similar to how the page is currently styled." lkhwt96 Tickets Awaiting Review 41953 Improved Meta Box Save Hook Posts, Post Types 4.8.2 normal normal Awaiting Review feature request new 2017-09-22T07:55:37Z 2017-09-22T10:39:51Z "Hi, This is suggestion how to reduce some conditionals for saving meta boxes with function for example. Below is code of meta box save function with all conditions for security and inside that function we always write some core condition for security that can be separated in one or more core functions to do that for us, so we can just call that function. {{{ if ( ! function_exists( 'save_admin_meta_boxes' ) ) { /** * Saves admin meta box to postmeta table * * @param $post_id int - id of post that meta box is being saved * @param $post WP_Post - current post object */ function save_admin_meta_boxes( $post_id, $post ) { // If we're doing an auto save, bail if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // If default wp nonce isn't there, bail if ( ! isset( $_POST['_wpnonce'] ) ) { return; } // If current user can't edit this post, bail if ( ! current_user_can( 'edit_post', $post_id ) ) { return; } // If current post type are not in list, bail $post_types = apply_filters( 'wp_allowed_post_types_for_meta_boxes', array( 'post', 'page' ) ); if ( ! in_array( $post->post_type, $post_types ) ) { return; } // If our nonce isn't there, or we can't verify it, bail $meta_boxes = apply_filters( 'add_meta_boxes_filter', array() ); $nonce_array = array(); if ( is_array( $meta_boxes ) && ! empty( $meta_boxes ) ) { foreach ( $meta_boxes as $meta_box ) { $nonce_array[] = 'extensive_vc_meta_box_' . esc_attr( $meta_box ) . '_save'; } } if ( is_array( $nonce_array ) && count( $nonce_array ) ) { foreach ( $nonce_array as $nonce ) { if ( ! isset( $_POST[ $nonce ] ) || ! wp_verify_nonce( $_POST[ $nonce ], $nonce ) ) { return; } } } // Make sure your data is set before trying to save it global $meta_boxes_options; foreach ( $meta_boxes_options as $key => $value ) { $field_key = $_POST[ $key ]; if ( isset( $field_key ) && trim( $field_key !== '' ) ) { update_post_meta( $post_id, $key, esc_html( $field_key ) ); } else { delete_post_meta( $post_id, $key ); } } } add_action( 'save_post', 'save_admin_meta_boxes', 10, 2 ); } }}} Example function with that conditionals {{{ if ( ! function_exists( 'wp_meta_boxes_security_check' ) ) { /** * Check is meta box secure and valid for saving * * @param $post_id int - id of post that meta box is being saved * @param $post WP_Post - current post object * * @return boolean */ function wp_meta_boxes_security_check( $post_id, $post ) { $return_value = true; // If we're doing an auto save, bail if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { $return_value = false; } // If default wp nonce isn't there, bail if ( ! isset( $_POST['_wpnonce'] ) ) { $return_value = false; } // If current user can't edit this post, bail if ( ! current_user_can( 'edit_post', $post_id ) ) { $return_value = false; } // If current post type are not in list, bail $post_types = apply_filters( 'wp_allowed_post_types_for_meta_boxes', array( 'post', 'page' ) ); if ( ! in_array( $post->post_type, $post_types ) ) { $return_value = false; } return $return_value; } } }}} and then finally code for saving meta boxes will be {{{ if ( ! function_exists( 'save_admin_meta_boxes' ) ) { /** * Saves admin meta box to postmeta table * * @param $post_id int - id of post that meta box is being saved * @param $post WP_Post - current post object */ function save_admin_meta_boxes( $post_id, $post ) { // If meta box doesn't paste check, bail if ( ! wp_meta_boxes_security_check( $post_id, $post ) ) { return; } // If our nonce isn't there, or we can't verify it, bail $meta_boxes = apply_filters( 'add_meta_boxes_filter', array() ); $nonce_array = array(); if ( is_array( $meta_boxes ) && ! empty( $meta_boxes ) ) { foreach ( $meta_boxes as $meta_box ) { $nonce_array[] = 'extensive_vc_meta_box_' . esc_attr( $meta_box ) . '_save'; } } if ( is_array( $nonce_array ) && count( $nonce_array ) ) { foreach ( $nonce_array as $nonce ) { if ( ! isset( $_POST[ $nonce ] ) || ! wp_verify_nonce( $_POST[ $nonce ], $nonce ) ) { return; } } } // Make sure your data is set before trying to save it global $meta_boxes_options; foreach ( $meta_boxes_options as $key => $value ) { $field_key = $_POST[ $key ]; if ( isset( $field_key ) && trim( $field_key !== '' ) ) { update_post_meta( $post_id, $key, esc_html( $field_key ) ); } else { delete_post_meta( $post_id, $key ); } } } add_action( 'save_post', 'save_admin_meta_boxes', 10, 2 ); } }}} Also I added some filter for allowed post types inside that function {{{ $post_types = apply_filters( 'wp_allowed_post_types_for_meta_boxes', array( 'post', 'page' ) ); }}} which allows authors to easily add their own custom post type with meta boxes for saving. Best regards, Nenad" Nenad Obradovic Tickets Awaiting Review 43347 Introduction of 'has_single' register_post_type parameter Posts, Post Types normal normal Awaiting Review feature request new 2018-02-18T18:28:45Z 2022-07-19T09:48:55Z "I have done some research but have not been able to find anything exactly on this issue. I frequently encounter use cases where I need to create a CPT with the following characteristics: 1) disable the slug display/editor from the admin post edit page (this is for usability. It is not used and having it available/displayed can confuse website editors) 2) maintain the archive page is viewable on the front end 3) disable the single page for the CPT on the front end I have found some partial solutions like this https://wordpress.stackexchange.com/questions/128636/how-to-disable-the-single-view-for-a-custom-post-type but setting `'publicly_queryable' => false` would disable the archive view. The `register_post_type` function includes the `has_archive` parameter. Is it possible to introduce a `has_single` parameter which will achieve the desired functionality stated above? I feel this can be beneficial in many cases, to the extent it is worthwhile introducing as a core feature. " stevepuddick Tickets Awaiting Review 37376 Make it possible for custom post type to have an archive but no single Posts, Post Types 4.6 normal normal Awaiting Review feature request new needs-unit-tests 2016-07-15T17:55:34Z 2021-08-24T05:07:13Z "Very commonly we'll have testimonials, faqs, and such custom post types, which warrant an archive, but don't make sense to have a single. It's possible to have a post type with no archive and a single, but not the other way around. Funnily enough, I find that we far more often could use what isn't available versus what is. There are workarounds. One option is to make it a non-publicly-queryable post type and use a page template or something to display the results. Another option I've seen around is to hook into template_redirect on the single and redirect the user. Chances are there's no links on the front-end, so this really only occurs when users click on the link from edit-post admin-side. Another thing to consider here is SEO plugins and the like which look to the definition of the CPT to build the sitemap. The redirect method ends up putting useless links in the sitemap. The page template method works fine, but obviously means the CPT has to be queried separately. Would there be a downside to adding a sibling `has_single` option? If it's true by default then it's backwards compatible, and the single rewrites simply reflect the option." jason_the_adams Tickets Awaiting Review 28463 Need core concept of the first publication of a post/comment. Posts, Post Types normal normal Awaiting Review feature request new dev-feedback 2014-06-05T17:21:56Z 2022-07-15T14:35:48Z "Because status transitions are permitted to occur in a cyclic fashion, it is possible to publish a post/comment more than once. The first publication event has unique significance, e.g. to push-based subscription delivery systems, but this concept is not represented anywhere in WordPress. Restricting status transitions to a directed acyclic graph is a non-starter. What I have done in plugins (and Nacin also suggests) is to mark the initial publication in meta: if transitioning to publish/approved, try adding the meta; if the add succeeds, this is the initial publication. I suspect that a significant number of plugins duplicate this. It would be even more useful to keep the history of changes to post_status in revisions rather than put ""inherit"" in that field. This would have repercussions in the already complex system for revisions, which has no facility for dealing with changes to non-content fields. It may also conflict with the existing uses of the ""inherit"" status, such as calling get_post_status() on a revision with the intention of getting the parent's status. Status revisions may have other uses as well (see #23314, #12706) but comment revisions don't exist yet. Ultimately what I want is a hook that fires only on the initial publication of a post or comment. The add_post_meta/add_comment_meta system can accomplish this much more easily." andy Tickets Awaiting Review 38067 New filter `wp_post_lock_status` Posts, Post Types 2.5 normal normal Awaiting Review feature request new has-patch 2016-09-15T13:23:37Z 2019-04-05T18:08:53Z "I have wp with one account for 5 people, employees. We make websites so 5 accounts for each website -> waste of time and difficult to maintain. We have big problem - if somebody edit page and I start edit the same page we have conficts and overwrite own changes. I can't see notice about that somebody edit this page because we use one account. My best idea! When user is logged in i create new cookie: `wordpress_logged_in_unique_COOKIEHASH` with unique hash -> user agent + wp_generate_password(). I save user hash if `_edit_lock_hash` was saved. So I can't check that post is locked or. So I write filter for return value of wp_check_post_lock() and... this work! I suggest add this filter (idea) to core or show me other way to resolve my problem." sebastian.pisula Tickets Awaiting Review 40255 Parameter to Enable/Disable Trash on register_post_type(); Posts, Post Types 4.7.3 normal normal Awaiting Review feature request new 2017-03-24T21:39:36Z 2017-03-24T21:39:36Z "It would be nice to have the ability to toggle on/off the ""trash"" feature on specific Post Types. I figured, for extreme simplicity; A parameter could be specified during Post Type registration. Or perhaps factored into the ""supports"" parameter (similarly to revisions) Thoughts?" michael.ecklund Tickets Awaiting Review 58447 Posts with ‘Stick to the top of the blog’ should also stick to the top of the categories it belongs to Posts, Post Types 6.2.2 normal normal Awaiting Review feature request new 2023-06-02T18:38:43Z 2023-11-20T17:35:19Z "According to the WordPress documentation ‘Stick to the top of the blog’ seems to be designed to only stick to the top of the front page. I don't think that makes sense. It should also stick to the top of the categories it belongs to! At least the main category. " hero2 Tickets Awaiting Review 55087 Published environment and published versions for posts/pages to be able to work on the same post/page without affecting the production version until the changes are ready to become the next version of the production post/page. Posts, Post Types normal normal Awaiting Review feature request new 2022-02-05T08:28:57Z 2023-10-30T23:38:16Z "Imagine you have several environments - dev, stage and production and you are working on several pages at once. Some of them are ready to be shown to the client and you are deploying code and database to the stage from dev, but some of them are not ready and the client will be unhappy to see unfinished work on the stage, so, you are hiding them for a while and you are starting to reverse changes you did filing that you messed up somewhere. And then the client is telling you that some of the pages need to be published straight away but others need additional work and to publish a part of the work you've done you are messing further with revisions hoping not to get confused by all this published, unpublished and reversed changes. This leads you to more work and more stress. As a result, you will publish something that isn't ready and lose something that was ready and start to think that you need to change processes to avoid this mess in future. The solution is to publish a certain version for a certain environment assuming that if the version is published for the production it is also published for stage and dev if there is no later version published for a particular env. " oglekler Tickets Awaiting Review 41564 Search for hyphenated post templates for post types with underscores Posts, Post Types normal normal Awaiting Review feature request new dev-feedback 2017-08-04T17:16:29Z 2017-08-13T15:54:10Z "Custom post type names adhere to the rules within sanitize_key() (lowercase alphanumeric characters, dashes, and underscores). This means registering a post type `some_post_type` is perfectly fine. The archive and single templates would be be `archive-some_post_type.php` and `single-some_post_type.php`. These file names do not adhere to the core standard for file names. Files should be named descriptively using lowercase letters. Hyphens should separate words. Searching for `archive-some-post-type.php` in addition to `archive_some_post_type.php` would allow this standard to be followed better." desrosj Tickets Awaiting Review 43083 "adding ""Unlisted"" type for post visibility" Posts, Post Types normal normal Awaiting Review feature request new 2018-01-13T16:29:17Z 2018-03-02T01:27:19Z "I think there is a good reason that WP natively supported ""unlisted"" posts, in addition to PUBLIC, DRAFT and PRIVATE. Why not WP add that feature? btw, Private is not same as ""unlisted"". " tazotodua Candidates for Closure 50989 """Blog pages show at most"" setting not working when 2 posts are made sticky" Posts, Post Types normal normal Awaiting Review defect (bug) new close 2020-08-13T17:34:04Z 2023-01-16T16:50:49Z "Version: WordPress 5.5 Site: https://wesleytech.com In WordPress Settings -> Reading, for the setting ""Blog pages show at most"". When a single blog post is set to sticky using the ""stick to the top of the blog"" setting on the blog post edit page, the ""Blog pages show at most"" setting is respected. However, when TWO blog posts are set as sticky, then the ""Blog pages show at most"" setting is NOT respected, and an extra post gets shown on the home page. For example, if your ""Blog pages show at most"" setting is set to 6, and you then make 2 blog posts sticky, then your home page will show 7 posts. " wesleytech Candidates for Closure 54903 (no title) bug Posts, Post Types 5.8.3 normal normal Awaiting Review defect (bug) new reporter-feedback 2022-01-25T18:21:10Z 2022-02-01T13:49:51Z "If a user makes a post without a title, the post shows up as (no title). However, if the user tries to delete, change status, etc.. of that (no title) post, core does not render those commands. The page refreshes with no changes. " samjco Candidates for Closure 52178 Allowed memory size exhausted / url creates new post entry? Posts, Post Types 5.6 normal normal Awaiting Review defect (bug) new reporter-feedback 2020-12-26T18:19:40Z 2021-01-05T05:57:58Z "We get repeated bots (across multiple WP sites) hitting a specific URL pattern, they append a query string onto the end of a wordpress URL like this: {{{ https://www.example.com/permalink-to-article?q=user%2Fpassword&name%5B%23markup%5D=id&name%5B%23type%5D=markup&name%5B%23post_render%5D%5B%5D=passthru }}} This causes a memory exhausted error here: /wp/wp-includes/post.php at line 773: {{{ } elseif ( is_object( $post ) ) { if ( empty( $post->filter ) ) { $_post = sanitize_post( $post, 'raw' ); $_post = new WP_Post( $_post ); ##<--- HERE } elseif ( 'raw' === $post->filter ) { $_post = new WP_Post( $post ); } else { }}} " sgatz Candidates for Closure 55385 Error in Search Posts, Post Types normal normal Awaiting Review defect (bug) new reporter-feedback 2022-03-13T13:12:40Z 2022-03-26T02:59:53Z "Hi Support, When we are searching any keyword which start from .profile it send the backend normal post and page search to the frontend not found. Instead it should stay on same page and show not found. For example please search this www.profile.com and it will send you to frontend. Can you please advise why it is happening ? Regards, Himanshu" himanshushokhanda Candidates for Closure 45978 Excerpt always become empty after save draft / publish Posts, Post Types normal normal Awaiting Review defect (bug) new reporter-feedback 2019-01-14T03:57:46Z 2019-01-14T14:48:00Z "It's happen one time for a **new post**.. Excerpt always become empty after save draft or publish or schedule a post.. [[Image(https://i.postimg.cc/P5G8SKcD/aaa.jpg)]] well, we need to update the post again to save the excerpt" KakiNetwork Candidates for Closure 56004 "Found issue with ""post"" post type page attribute parent slug not working" Posts, Post Types 6.0 normal normal Awaiting Review defect (bug) new reporter-feedback 2022-06-17T19:46:44Z 2022-07-21T06:41:49Z "Hello, Found issue with ""post"" post type page attribute parent slug not working Screenshot : https://tinyurl.com/25yqto72" dipakparmar443 Candidates for Closure 44288 Inconsistent saving of post slug / url field Posts, Post Types 4.9.6 normal normal Awaiting Review defect (bug) new reporter-feedback 2018-06-01T04:08:43Z 2018-06-04T13:47:08Z "Firstly see the issue I raised on the woocommerce github: https://github.com/woocommerce/woocommerce/issues/20285 I'm trying to use characters such as +, &, * etc in post (in my particular case products) urls, but encoded first obviously (e.g. + becomes %2B). My process: See my process to recreate this issue on the github link. The good people over at the woocommerce github have said this is not a problem on their end but is actually a problem with the wordpress core, in particular how it saves post slugs / urls." rhurley Candidates for Closure 57437 "Insecure Direct Object Reference in ""author"" parameter while making a page live Leads to Vertical Privilege Escalation on a Different Account" Posts, Post Types 6.1.1 normal normal Awaiting Review defect (bug) new dev-feedback 2023-01-10T03:59:47Z 2023-01-12T02:41:14Z "{I've reported it on hackerone, they said its a bug, report it as a bug} Description: There is an Insecure Direct Object Reference in the author parameter that lets a user, set the author id to a different author, which doesnt have the rights to edit/publish the page Steps To Reproduce: Create a Page. Click on settings ICON in the page in the editor. Note that in the page section you can edit the author of page, with the list of available users. Choose a legitimate user and intercept the request. Now in the request there is an author parameter which has the id of user ""author"":id,. Change this id to a user who doesn't have the right to publish or edit the post. 6.By changing the id to a user who has no role for the wordpress, you can see that the user is now the author for the page. Thanks! Please check attached video POC for more clarity. Recommendations Make sure to check for what values of author parameter are being parsed by the backend and check if the id being passed does have the right to do so. Impact Privilege Escalation For an Unintended User/Low priv user Bypass secure Design and post unwanted content from other's account." f41z4n Candidates for Closure 59058 Large URLs not fully shown in popup box Posts, Post Types 6.3 normal normal Awaiting Review defect (bug) reopened reporter-feedback 2023-08-10T18:01:32Z 2023-08-24T20:14:31Z "I can’t access the advanced settings of a link while linking a large URL because the side scroll simply doesn’t work. This issue started with WP 6.3. Here’s a pic of a large URL: https://imgur.com/a/KfUYqzr The scroll won’t go right, so I can’t for example set the link to open in a new tab." igordnt Candidates for Closure 45680 New Page Bug Posts, Post Types 5.0.1 normal normal Awaiting Review defect (bug) new reporter-feedback 2018-12-17T20:23:10Z 2018-12-18T00:44:30Z I have installed an updated WordPress. When I create a new Page, I cannot add it to an existing menu because it is created as a new post versus a new page. LadySylvia Candidates for Closure 44997 Parent page of a page is not kept when saved as draft then published Posts, Post Types 4.9.8 normal normal Awaiting Review defect (bug) new dev-feedback 2018-09-26T15:44:14Z 2018-09-27T17:56:40Z "Write a page (page1) Write an other page (page2). Make that page parent of page1. Save it as draft. Then publish it: clic on publish, change the published date, then publish. The parent page of page2 is not page1 anymore" korsani Candidates for Closure 48512 Post editor can show wrong author, if user role was changed Posts, Post Types normal normal Awaiting Review defect (bug) new dev-feedback 2019-11-06T14:29:47Z 2019-11-06T17:23:53Z "* Go to Add New User. Create a new user who is a Contributor. * Go to Add New Post. Type any random text as the content. Set the Author (in the dropdown list) to the author you just created. Save the post. * Go to the user you created, and change their role to ""No role"". * Go back to Posts, and find the post you created. Edit it. * Observe that the Author dropdown now shows the wrong author, since the user is no longer eligible to appear in the dropdown list. * Fortunately, even if you edit and save the post, it does not actually overwrite the correct author with the wrong one. Still, the display is very misleading. A bug in my opinion." equin0x80 Candidates for Closure 59610 Post modified date cannot be updated through WP-CLI Posts, Post Types 6.3.3 normal normal Awaiting Review defect (bug) new dev-feedback 2023-10-13T08:43:40Z 2023-10-13T19:50:31Z "As we all know, we can update post data using WP-CLI `wp post update `, but if we try to update post-modified-date using the same CLI, the post gets updated with the current date-time rather than the passed date-time. This CLI uses `wp_update_post()` in its implementation, so to fix this, we need to update its implementation or update the documentation of the CLI which will explain that post-modified-date cannot be updated through CLI. Steps to reproduce this bug: 1. Open the post on REST endpoint where **post-modified-date** will be visible. (for e.g. https://example.com/wp-json/wp/v2/posts/1 ) 2. Run the WP-CLI to update the post-modified-date: `wp post update --post_modified='2023-10-13T10:18:04'` and reload the REST endpoint url." shreyasikhar26 Candidates for Closure 57331 Post slugs are appending '%ef%bf%bc' causing redirection errors Posts, Post Types 6.1.1 normal major Awaiting Review defect (bug) new reporter-feedback 2022-12-14T23:46:37Z 2022-12-15T01:35:54Z "We are noticing that certain articles on our site are getting this '%ef%bf%bc' string attached to the end of the post_name/slug, and causing a redirect error. On the front end sometimes the actual string shows up but other times it's just a blank in the url. If we strip the post_names of this string of characters in the database, it seems to fix the issue, but nothing we are doing on our end seems to be appending them. A quick google search seems to give me the indication that it's related a copy paste error of some sort, but I personally wasn't able to replicate it on my own, though we have dozens of examples of it happening on our site in the past few months. Examples: https://www.hercampus.com/school/sjsu/a-peek-into-the-education-system%ef%bf%bc https://www.hercampus.com/school/york-u/what-does-your-favorite-hozier-song-say-about-you%ef%bf%bc https://www.hercampus.com/school/psu/be-kind-to-your-retail-workers-on-black-friday%ef%bf%bc%ef%bf%bc%ef%bf%bc%ef%bf%bc%ef%bf%bc%ef%bf%bc%ef%bf%bc%ef%bf%bc%ef%bf%bc https://www.hercampus.com/school/psu/what-new-fall-jacket-you-should-buy-based-on-your-favorite-thanksgiving-food%ef%bf%bc " danielcho Candidates for Closure 43754 "Problem with is_page() function when gets ""NULL"" parameter" Posts, Post Types 4.9.5 normal major Awaiting Review defect (bug) new reporter-feedback 2018-04-13T09:32:09Z 2020-06-04T23:36:40Z "Problem with function is_page() when it gets ""NULL"" parameter then return ""TRUE""" pawels Candidates for Closure 44805 Resurrecting post from trash reverts its slug Posts, Post Types 4.9.7 normal normal Awaiting Review defect (bug) assigned dev-feedback 2018-08-16T06:26:13Z 2018-08-30T00:53:02Z "=== Steps to reproduce Using the REST API: * Create a post * Delete the post (not forced) * Update the post's slug * Update the post's status to `publish` ==== Create `POST wp-json/wp/v2/posts` {{{#!json { ""status"": ""publish"", ""slug"": ""a"", ""title"": ""a"" } }}} ==== Delete `DELETE wp-json/wp/v2/posts/` ==== Update slug `POST wp-json/wp/v2/posts/` {{{#!json { ""slug"": ""foo"" } }}} ==== Update status `POST wp-json/wp/v2/posts/` {{{#!json { ""status"": ""publish"" } }}} === Expected Post should be published with a slug of `foo` (the updated value) === Actual Post is published with a slug of `a` (the old value) " ajmccluskey Candidates for Closure 57438 Slug is not generated when saving posts as draft Posts, Post Types normal normal Awaiting Review defect (bug) new dev-feedback 2023-01-10T04:28:22Z 2023-03-08T16:39:30Z "When saving posts as draft, the slug is empty. Only when publishing posts, the slug is generated. Slug should be auto-generated even when saving posts as draft. Steps to reproduce: - Add a new post (in the classic editor or Gutenberg) - Enter the post title - Save the post as draft - Reload the page (if in Gutenberg) and see the slug is empty" rilwis Candidates for Closure 56136 Unable to move panels from below post editor content section to sidebar Posts, Post Types 5.0 normal normal Awaiting Review defect (bug) new reporter-feedback 2022-07-04T08:32:21Z 2022-07-20T18:20:41Z "I am having the same problem reported here https://wordpress.org/support/topic/additional-panels-appear-at-foot-of-page-edit-area-rather-than-in-tool-bar/. The ""Additional"" panels in the WordPress editor are appearing at the bottom of the page. When I try to drag and drop to the sidebar, an infinitely long horizontal scrollbar appears and keeps scrolling right. Screen capture video: https://drive.google.com/file/d/1Iy0G1I2OMgnOv4-grMApbY5V2W_l1kQs/view?usp=sharing" wpdev8195 Candidates for Closure 49153 Undefined Variable Warning Posts, Post Types normal normal Awaiting Review defect (bug) new reporter-feedback 2020-01-08T18:25:24Z 2020-01-09T19:21:08Z "Notice: Undefined property: WP_Post::$filter in wp-includes/class-wp-post.php on line 342 The fix is simple change the if statement to: if ( !empty( $this->filter ) ) {" tweidman Candidates for Closure 44423 Unicode characters in get string breaks pagination Posts, Post Types 4.9.6 normal normal Awaiting Review defect (bug) reopened reporter-feedback 2018-06-21T11:59:20Z 2018-06-25T12:11:41Z "This was found when working with this plugin: [Ajax-Enabled Enhanced Layered Navigation](https://woocommerce.com/products/ajax-layered-navigation/) . If there are unicode characters used in a parameter in a get string, then it breaks pagination by not allowing access to page 2+. 1. Set your blog posts to display 1 per page 2. View blog 3. Append this to the url in address bar and hit enter: `?dddd%D7%99%D7%A6%D7%A8%D7%9F=metabo` 4. Once page reloads, try to go to page 2 5. You should receive a too many redirects error " jessepearson Candidates for Closure 48268 Updating failed. Error message: The response is not a valid JSON response. Posts, Post Types normal critical Awaiting Review defect (bug) new reporter-feedback 2019-10-10T05:26:03Z 2021-03-31T21:52:09Z "Hi, When i try to update the Page Template from default to full page then i am getting that error ""Updating failed. Error message: The response is not a valid JSON response."" in WordPress Version 5.3" phpdocs Candidates for Closure 37917 Users without the edit_private_posts capability can still create private posts Posts, Post Types 2.1 normal normal Awaiting Review defect (bug) new dev-feedback 2016-09-01T21:32:26Z 2019-04-19T13:20:11Z "Currently, users without the ""edit_private_posts"" capability, can still view the ""Private"" radio button under ""Visibility"". They can also save / publish the post (depending on their capabilities) with no issue. The same goes for pages as well with the ""edit_private_pages"" capability. I think it's reasonable enough to assume that users that don't have the ""edit_private_{post_type}"" capability, shouldn't be able to create posts with a visibility of private." ryan.kanner Candidates for Closure 54720 WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit Posts, Post Types 5.8.2 normal normal Awaiting Review defect (bug) new dev-feedback 2022-01-03T11:40:53Z 2022-01-03T11:40:53Z "I'm trying to display a WP_List_table inside a metabox. The metabox is for questions which are from assessment_question custom post type.The metabox is being displayed on an other custom post type 'cs_questionnaire'. The table columns display some data taken from questions. Also I am using bulk actions to link questions to a questionnaire. What's happening is that it all looks fine until I click the Publish/Update button on the custom post type edit screen. If the WP_List_Table has bulk actions it will redirect back to the /wp-admin/edit.php page, if I remove the bulk actions then it Works fine. And in both cases, the nonce stays the same and no extra nonce is created. I've whole code below. I have already overridden the display_tablenav function by commenting the nonce generating code. It stops working when I provide bulk actions else it works fine with the following code. {{{#!php data /** Class constructor */ public function __construct() { parent::__construct( array( 'singular' => __( 'Question', 'conditional-shortcode' ), // singular name of the listed records 'plural' => __( 'Questions', 'conditional-shortcode' ), // plural name of the listed records 'ajax' => false, // does this table support ajax? ) ); } /** * Function to filter data based on order , order_by & searched items * * @param string $orderby * @param string $order * @param string $search_term * @return array $users_array() */ public function list_table_data_fun( $orderby = '', $order = '', $search_term = '' ) { $args = array(); $questions_array = array(); $questions = ''; $flag = false; if ( ! empty( $search_term ) ) { $args = array( 'fields' => 'ids', 'orderby' => $orderby, 'order' => $order, 'search' => intval( sanitize_text_field( $_REQUEST['s'] ) ), 'post_type' => 'assessment_question', 'posts_per_page' => -1, ); } else { if ( $order == 'asc' && $orderby == 'id' ) { $args = array( 'orderby' => 'ID', 'order' => 'ASC', 'fields' => 'ids', 'post_type' => 'assessment_question', 'posts_per_page' => -1, ); } elseif ( $order == 'desc' && $orderby == 'id' ) { $args = array( 'orderby' => 'ID', 'order' => 'DESC', 'fields' => 'ids', 'post_type' => 'assessment_question', 'posts_per_page' => -1, ); } elseif ( $order == 'desc' && $orderby == 'title' ) { $args = array( 'orderby' => 'name', 'order' => 'DESC', 'fields' => 'ids', 'post_type' => 'assessment_question', 'posts_per_page' => -1, ); } elseif ( $order == 'asc' && $orderby == 'title' ) { $args = array( 'orderby' => 'name', 'order' => 'ASC', 'fields' => 'ids', 'post_type' => 'assessment_question', 'posts_per_page' => -1, ); } else { $args = array( 'orderby' => 'ID', 'order' => 'DESC', 'fields' => 'ids', 'post_type' => 'assessment_question', 'posts_per_page' => -1, ); $flag = true; } } $questions = get_transient( 'pd_questions' ); if ( $flag == false ) { $questions = get_posts( $args ); } elseif ( $flag == true && ! $questions ) { $questions = get_posts( $args ); set_transient( 'pd_questions', $questions, 1 * DAY_IN_SECONDS ); } if ( count( $questions ) > 0 ) { foreach ( $questions as $question_id ) { $question = get_post_meta( $question_id ?? 0, CONDITIONAL_SHORTCODE_ASSESSMENT_QUESTION_META, true )['question'] ?? 'NA'; $questions_array[] = array( 'id' => $question_id, 'title' => '' . get_the_title( $question_id ) . '', 'question' => $question, ); } } return $questions_array; } // prepare_items public function prepare_items() { $orderby = sanitize_text_field( isset( $_GET['orderby'] ) ? trim( $_GET['orderby'] ) : '' ); $order = sanitize_text_field( isset( $_GET['order'] ) ? trim( $_GET['order'] ) : '' ); $search_term = sanitize_text_field( isset( $_POST['s'] ) ? trim( $_POST['s'] ) : '' ); if ( $search_term == '' ) { $search_term = sanitize_text_field( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' ); } $datas = $this->list_table_data_fun( $orderby, $order, $search_term ); $per_page = 30; $current_page = $this->get_pagenum(); $total_items = count( $datas ); $this->set_pagination_args( array( 'total_items' => $total_items, 'per_page' => $per_page, ) ); $this->items = array_slice( $datas, ( ( $current_page - 1 ) * $per_page ), $per_page ); $columns = $this->get_columns(); $hidden = $this->get_hidden_columns(); $sortable = $this->get_sortable_columns(); $this->_column_headers = array( $columns, $hidden, $sortable ); $this->process_bulk_action(); } public function get_bulk_actions() { return array( 'add_questions' => __( 'Add Questions', 'conditional-shortcode' ), 'remove_questions' => __( 'Remove Questions', 'conditional-shortcode' ), ); } // get_columns public function get_columns() { $columns = array( 'cb' => '', 'id' => __( 'ID', 'conditional-shortcode' ), 'title' => __( 'Title', 'conditional-shortcode' ), 'question' => __( 'Questions', 'conditional-shortcode' ), 'action' => __( 'Action', 'conditional-shortcode' ), ); return $columns; } public function get_hidden_columns() { return array( '' ); } public function get_sortable_columns() { return array( 'title' => array( 'title', true ), 'id' => array( 'id', true ), ); } /** * Generate the table navigation above or below the table. * * @since 3.1.0 * @access protected * * @param string $which */ protected function display_tablenav( $which ) { // REMOVED NONCE -- INTERFERING WITH SAVING POSTS ON METABOXES // Add better detection if this class is used on meta box or not. /* if ( 'top' == $which ) { wp_nonce_field( 'bulk-' . $this->_args['plural'] ); } */ ?>
    "">
    bulk_actions( $which ); ?>
    extra_tablenav( $which ); $this->pagination( $which ); ?>
    Add Question'; default: return 'no value'; } } public function column_title( $item ) { $post_id = get_the_ID(); $action = array( 'edit' => sprintf( 'Add Question', $post_id, 'edit', 'add_question', $item['id'], $post_id ), ); return sprintf( '%1$s %2$s', $item['title'], $this->row_actions( $action ) ); } function column_cb( $item ) { return sprintf( '', $item['id'] ); } function no_items() { esc_html_e( 'No Questions Found.', 'conditional-shortcode' ); } public function process_bulk_action() { // security check! if ( isset( $_POST['_wpnonce'] ) && ! empty( $_POST['_wpnonce'] ) ) { $nonce = filter_input( INPUT_POST, '_wpnonce', FILTER_SANITIZE_STRING ); $action = 'bulk-' . $this->_args['plural']; if ( ! wp_verify_nonce( $nonce, $action ) ) { wp_die( 'Nope! Security check failed!' ); } } $action = $this->current_action(); switch ( $action ) { case 'delete_questions': wp_die( 'Delete something' ); break; case 'add_questions': wp_die( 'Save something' ); break; default: // do nothing or something else return; break; } wp_redirect( esc_url( add_query_arg() ) ); exit; return; } } /** * Shows the List table for all questions. * * @return void */ function conditional_shortcode_questions_list_table_layout() { $table = new Class_Conditional_Shortcode_Questions_Listing(); printf( '

    %s

    ', __( '', 'conditional-shortcode' ) ); echo '
    '; $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRIPPED ); $paged = filter_input( INPUT_GET, 'paged', FILTER_SANITIZE_NUMBER_INT ); printf( '', $page ); printf( '', $paged ); $table->prepare_items(); // this will prepare the items AND process the bulk actions $table->search_box( __( 'Search question by id' ), 'conditional-shortcode' ); // Needs To be called after $myRequestTable->prepare_items() $table->display(); echo '
    '; echo '
    '; } conditional_shortcode_questions_list_table_layout(); }}} I was able to resolve this issue by changing the value of name attribute of bulk actions select field. Like from name to names. What I think the issue could be is when here the name=""action"" for this select and it has some value xyz on the other side WordPress save post looks for action to be equal to edit. Can we provide a way of changing this name attributes value either by providing a filter or by changing it. But I think changing name attribute would require a lot of other code changes so its better to provide a filter for custom use. Or add a comment on top so someone else using WP LIST Table in a metabox must override this function with custom value to name attribute. For clarity I changed This echo '\n""; Thanks! " muhammadfaizanhaidar Candidates for Closure 45764 blog page and homepage the same list pages and not posts Posts, Post Types 5.0.2 normal minor Awaiting Review defect (bug) reopened dev-feedback 2018-12-25T11:47:36Z 2019-12-12T19:24:07Z "Hi I don't know when this was changed but if you set the same page as blog page aswell as your homepage the website starts listing pages on that blog and home page and not posts. Why was this changed and when? Thanks for any advice. " BackuPs Candidates for Closure 55442 count(): Parameter must be an array or an object that implements Countable in /var/www/html/wp-includes/post-template.php on line 319 Posts, Post Types normal normal Awaiting Review defect (bug) new reporter-feedback 2022-03-22T21:59:34Z 2022-03-22T23:41:57Z "Call get_the_content() with no arguments and $post is null. If post is null then this is ran: {{{#!php $elements = compact( 'page', 'more', 'preview', 'pages', 'multipage' ); }}} Associate array has keys with null values. Then on lin3 319 is {{{#!php if ( $elements['page'] > count( $elements['pages'] ) ) { }}} Which causes this notice: {{{ Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/wp-includes/post-template.php on line 319 Notice: Trying to access array offset on value of type null in /var/www/html/wp-includes/post-template.php on line 325 }}} " davidscpl Candidates for Closure 47427 deleted pages for a plugin prevent page creation during re-installation of plugin Posts, Post Types 5.2.1 normal normal Awaiting Review defect (bug) new reporter-feedback 2019-05-29T13:56:00Z 2019-06-01T12:07:13Z "Plugin xyz creates pages 'login' and 'registration' when it is installed. Those pages are subsequently deleted (moved to trash) and the plugin is uninstalled. If the plugin is then re-installed it will not be able to create 'login' and 'registration' because these pages are sitting in trash. That should not happen because an active 'login' page should not be equal to a 'login' page in trash, they should be separate and distinct page instances which cannot affect each other unless the user takes explicit action (similar to the philosophy behind package installation in Linux): 1. The current behavior should be modified to allow concurrent active and trash instances of the same page. 2. A plugin should have a force option for creating pages. 3. There should be a force restore from trash option. The user would need to be warned, but it should be their choice. " nbi1 Candidates for Closure 54964 get_permalink() does not use the correct slug rewrite base Posts, Post Types 5.9 normal blocker Awaiting Review defect (bug) new reporter-feedback 2022-01-27T22:10:49Z 2023-10-04T11:54:50Z "Hello, get_permalink does not work well for custom posts with slug rewrite. E.g. I have implemented articles post type: {{{#!php array('slug' => _x('articles','slug','mydomain')),...)); }}} 'articles' is translateD to slovak language as 'clanky'. But **get_permalink({id_of_article})** returns '''localhost:10010/articles/my-title'''. It is wrong and i have recieve error 404, because right link is '''localhost:10010/clanky/my-title'''. It works OK for older WP version. Thanks a lot for any result. Kind regards, Ondrej Jakuba " jakubaondrej Candidates for Closure 49478 get_post_type_object has the wrong type of validator for its parameter Posts, Post Types 5.3.2 normal normal Awaiting Review defect (bug) new dev-feedback 2020-02-19T18:43:03Z 2020-02-19T20:08:32Z "https://core.trac.wordpress.org/browser/tags/5.3/src/wp-includes/post.php?rev=46727#L1228 get_post_type_object expects a post type as a string as its parameter, however it checks if the parameter is scalar or not and returns null if it is not a number." kamilkecki Candidates for Closure 49093 get_posts Some fields of the $args argument are not documented Posts, Post Types 5.4 normal minor Awaiting Review defect (bug) assigned close 2019-12-29T20:28:02Z 2020-01-14T14:45:13Z "Some fields of the $args argument are not documented in get_posts. I believe it is important to describe all the optional arguments for this function. https://developer.wordpress.org/reference/functions/get_posts/" Marcio Zebedeu Candidates for Closure 55037 get_posts why returning draft post list? Posts, Post Types 5.9 normal normal Awaiting Review defect (bug) new reporter-feedback 2022-02-02T05:04:02Z 2022-02-02T08:15:30Z "Hi, I have created one website & post in **Draft** but still gatting on website when visit as a visitor. you can click on post for go to details page then gettot 404 erorr page. Website URL is here - https://earthspas.com/news-blog/ My code below. {{{#!php ID; $cid = $_POST['catid']; $dates = $_POST['dates']; $pages = $_POST['page']; $datesArray = explode('-', $dates); $datemonth = date_parse($datesArray[0]); if($pages){ $pages = $pages; }else{ $pages = 1; } if($cid != 'all'){ $tax_query = array( array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => $cid ) ); }else{ $tax_query = ''; } if($dates != 'all'){ $date_query = array( 'relation' => 'AND', array( 'year' => $datesArray[1], 'month' => $datemonth['month'], 'compare' => '=', ), ); }else{ $date_query = ''; } $args = array( 'post_type' => 'post', 'orderby' => 'ID', 'post__not_in' => array($latestpost), 'order' => 'DESC', 'posts_per_page' => 6, 'paged' => $pages, 'tax_query' =>$tax_query, 'date_query' =>$date_query ); $the_query = new WP_Query( $args ); $totalPage = $the_query->max_num_pages; if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $images = wp_get_attachment_image_src( get_post_thumbnail_id( $the_query->ID ), 'single-post-thumbnail' ); $html .='

    '.get_the_title().'...

    '.get_the_date().'

    READ MORE
    '; endwhile; endif; wp_reset_postdata(); wp_reset_query(); if($totalPage >1){ $html .='
      '; if($pages > 1 ){ $j = $pages-1; $html.='
    • Prev
    • '; } for($i=1; $i<=$totalPage; $i++){ if($i == $pages){ $activeClass = 'active'; }else{ $activeClass = ''; } $html.='
    • '.$i.'
    • '; } if($pages < $totalPage ){ $j = $pages+1; $html.='
    • Next
    • '; } $html.='
    '; } echo $html; die(); } }}} " sumitsingh Candidates for Closure 50438 item_ labels do not work once registered in a post type Posts, Post Types normal normal Awaiting Review defect (bug) new close 2020-06-20T09:38:42Z 2023-10-04T11:02:23Z "Labels starting with prefix item_ from here: https://developer.wordpress.org/reference/functions/get_post_type_labels/ Are not used in the dashboard when registering them in a custom post type. {{{#!php _x( 'Cars', 'Post Type General Name', 'abcde' ), 'singular_name' => _x( 'Car', 'Post Type Singular Name', 'abcde' ), 'menu_name' => __( 'Cars', 'abcde' ), 'name_admin_bar' => __( 'Car', 'abcde' ), 'archives' => __( 'Car Archives', 'abcde' ), 'attributes' => __( 'Car Attributes', 'abcde' ), 'parent_item_colon' => __( 'Parent Car:', 'abcde' ), 'all_items' => __( 'All Cars', 'abcde' ), 'add_new_item' => __( 'Add New Car', 'abcde' ), 'add_new' => __( 'Add New', 'abcde' ), 'new_item' => __( 'New Car', 'abcde' ), 'edit_item' => __( 'Edit Car', 'abcde' ), 'update_item' => __( 'Update Car', 'abcde' ), 'view_item' => __( 'View Car', 'abcde' ), 'view_items' => __( 'View Cars', 'abcde' ), 'search_items' => __( 'Search Car', 'abcde' ), 'not_found' => __( 'Not found', 'abcde' ), 'not_found_in_trash' => __( 'Not found in Trash', 'abcde' ), 'featured_image' => __( 'Initial Image', 'abcde' ), 'set_featured_image' => __( 'Set initial image', 'abcde' ), 'remove_featured_image' => __( 'Remove initial image', 'abcde' ), 'use_featured_image' => __( 'Use as initial image', 'abcde' ), 'insert_into_item' => __( 'Insert into Car', 'abcde' ), 'uploaded_to_this_item' => __( 'Uploaded to this Car', 'abcde' ), 'items_list' => __( 'Cars list', 'abcde' ), 'items_list_navigation' => __( 'Cars list navigation', 'abcde' ), 'filter_items_list' => __( 'Filter Cars list', 'abcde' ), 'item_published' => __( 'Car published', 'abcde' ), 'item_published_privately' => __( 'Car published privately', 'abcde' ), 'item_reverted_to_draft' => __( 'Car reverted to draft', 'abcde' ), 'item_scheduled' => __( 'Car scheduled', 'abcde' ), 'item_updated' => __( 'Car updated', 'abcde' ), ); $capabilities = array( 'edit_post' => 'update_core', 'read_post' => 'update_core', 'delete_post' => 'update_core', 'edit_posts' => 'update_core', 'edit_others_posts' => 'update_core', 'delete_posts' => 'update_core', 'publish_posts' => 'update_core', 'read_private_posts' => 'update_core' ); $args = array( 'label' => __( 'Car', 'abcde' ), 'description' => __( 'Post Type Description', 'abcde' ), 'labels' => $labels, 'supports' => array( 'title', 'thumbnail' ), 'hierarchical' => false, 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 40, 'menu_icon' => 'dashicons-businessman', 'show_in_admin_bar' => true, 'show_in_nav_menus' => false, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => true, 'publicly_queryable' => false, 'rewrite' => false, 'capabilities' => $capabilities, 'show_in_rest' => false, ); register_post_type( 'abcde_car', $args ); }}} e.g. on post update the notice is Post updated. Not Car updated. " ninetyninew Candidates for Closure 49805 missing get_the_title / confusing the_title filter Posts, Post Types 5.5 normal normal Awaiting Review defect (bug) new reporter-feedback 2020-04-04T08:52:05Z 2020-04-04T15:19:16Z "I and probably many others (e.g. #39848) got problems with filtering H1 - the problem is, that in most templates (and also in twenty twenty) there is no way how to filter H1. There is the_title function, that encloses the get_the_content() result with defined prefix and suffix, but this the_title function has no filter! And what is VERY confusing - there is the_title filter, but that filter is not called from the_title function, but from get_the_title function! I understand that it would be probably very difficult to move that the_title function where it belongs and replace it with proper get_the_title filter, but i believe there must be some quick way, e.g. that proposed wrap (but i would recommend to add all the arguments of the the_title function, so resulting in apply_filters( 'the_title_wrap', $title, $before, $after, $echo ); This way we could easily filter the result based on any option. " thomask Candidates for Closure 43689 next_post_link()/previous_post_link() broken for custom post types in same custom taxonomy term Posts, Post Types 4.9.5 normal normal Awaiting Review defect (bug) new reporter-feedback 2018-04-04T09:11:13Z 2022-05-26T22:22:37Z "The link to the next post is being displayed however the third parameter $in_same_term seems to be completely ignored even though parameter $taxonomy is correct (https://codex.wordpress.org/Function_Reference/next_post_link). E.g. you are on singular pages of a custom post type ""Job"". You want to have the next post link of ""Jobs"" which are in the same ""Job Group"" (a custom taxonomy) e.g. ""Developer"". However next post link will deliver a next Job which is in the ""Job Group"" ""Graphic Designer"" even though $in_same_term was set to true." Blackbam Candidates for Closure 48201 post_updated_messages event stop working version 5.2.3 Posts, Post Types 5.2.3 normal normal Awaiting Review defect (bug) new reporter-feedback 2019-10-03T11:35:18Z 2019-10-09T08:10:20Z "I really think that there is some problem with post_updated_messages event in 5.2.3 version. Tried the same code in vanila vrsion 4.9.11 and vanila 5.2.3. In 4.9.11 messages are overwritten and they are working good in 5.2.3 nothing’s happened. Try to add next code in wp-content/plugins/hello.php and activate Hello Dolly plugin: {{{#!php ID); $messages['post'] = array( 0 => '', 1 => sprintf( __('Article updated. View post', 'frl'), esc_url($permalink)), 2 => __('Custom field updated.', 'frl'), 3 => __('Custom field deleted.', 'frl'), 4 => __('Article updated.', 'frl'), 5 => isset($_GET['revision']) ? sprintf(__('Article restored to revision from %s', 'frl'), wp_post_revision_title((int)$_GET['revision'], false)) : false, 6 => sprintf( __('Article published. View post'), esc_url($permalink)), 7 => __('Article saved.', 'frl'), 8 => sprintf( __('Article submitted. Preview', 'frl'), esc_url(add_query_arg('preview','true', $permalink))), 9 => __('Article scheduled. Preview', 'frl'), 10 => sprintf( __('Article draft updated. Preview', 'frl'), esc_url(add_query_arg('preview', 'true', $permalink))) ); return $messages; } add_filter('post_updated_messages', 'frl_change_post_updated_labels'); }}} Also tried adding new category ‘article’ instead of ‘post’ and create new array $messages[‘article’] and assinged post to article category but it is working the same. So the problem exists in both cases: – when we want to overwrite existing messages (post, page, attachment) – when we want to add the new message type I would be very thankful if someone helps me with solving this. Tnx." majavsc Candidates for Closure 46555 update fails when I have a print statement in my code. Posts, Post Types 5.1 normal minor Awaiting Review defect (bug) new reporter-feedback 2019-03-18T11:38:41Z 2019-03-18T18:12:42Z "I get the the pink bar message ""update failed"", when I attempt to update a page that has an executed print statement in the code. The file saves/updates, even though there is an error message. Can the message be changed to ""update returned unexpected characters"" or some such. running wordpress 5.1.1 " rweil55 Candidates for Closure 44991 wp-login.php postpass no redirect Posts, Post Types 4.9.8 normal normal Awaiting Review defect (bug) new dev-feedback 2018-09-25T14:52:12Z 2018-09-26T17:47:34Z "I'm running wordpress 4.9.8 on an Archlinux host. Whenever I try to password protect a post, the redirection after entering the correct password fails. Going back to the post using the browser history works, and the post is unlocked, but only a blank page is visible to the user after entering the password. I suspect {{{ wp_get_referer(); }}} to be the root of the problem. I've added some debug output to the code: {{{ $referer = wp_get_referer(); if ( $referer ) { $secure = ( 'https' === parse_url( $referer, PHP_URL_SCHEME ) ); print ""True""; } else { $secure = false; print ""False""; } }}} and it prints ""False"" on that formerly blank white page after entering the password. Also adding {{{ print $referer; print $_SERVER['HTTP_REFERER']; }}} to the code prints nothing. I've tested different up-to-date browsers: Firefox, Chromium on Linux, Firefox, Opera on Windows 8.1, Firefox Klar, Safari on iOS, to no avail. Only Internet Explorer on Windows 8.1 works as expected, the redirect occurs immediately. Any ideas what could cause this problem, or how to further debug this?" lukelr Candidates for Closure 41714 "wp_list_pages() - horrible performance due to eventual ""SELECT *""" Posts, Post Types 4.9 normal normal Awaiting Review defect (bug) new dev-feedback 2017-08-23T16:15:00Z 2023-07-06T14:29:05Z "I'm investigating awful performance (MySQL slow queries logged constantly) a site which uses a plugin to display a page list. The plugin calls wp_list_pages(). wp_list_pages() in turn calls get_posts(). And get_posts() ends up making the slow query: {{{ SELECT * FROM wp_posts WHERE (post_type = ‘page’ AND post_status = ‘publish’) ORDER BY wp_posts.post_date ASC; }}} So, all the post_content fields (along with everything else) are being requested, just for the purposes of constructing a page list. (The site has ~ 1200 pages - and the above call returns 34MB from the MySQL server). It looks like either get_posts() needs some more flexibility so that it has an option to return only specified fields." DavidAnderson Candidates for Closure 46171 "Add ""backing up this post in your browser"" label to post-type" Posts, Post Types normal normal Awaiting Review enhancement new dev-feedback 2019-02-01T20:58:56Z 2019-02-01T20:58:56Z "When the internet connection is lost, on a non-block-based post-type, some helpful text appears in an admin notice to alert users their content will not be lost: ""We’re backing up this post in your browser, just in case"" Keyword: **post**. It would be nice if that string were post-type specific, perhaps part of the `labels` array of the post-type registration process." johnjamesjacoby Candidates for Closure 41893 Add URL filter in posts list table get_edit_link() Posts, Post Types 4.9 normal normal Awaiting Review enhancement new dev-feedback 2017-09-15T19:58:55Z 2020-02-15T13:02:42Z "In `get_edit_link()` in the WP_Posts_List_Table class, the URL to edit.php is hard-coded and is not filterable. I'm currently working on a project that has complex filtering and the client wants to maintain the filters as they click through to different statuses. Currently, the only way to update just the URL to edit.php is to use the `""views_{$this->screen->id}""` filter, use regex to find the URL in the markup, then update the URL in the markup as-needed. The proposed `wp_posts_list_table_edit_url` filter would allow filtering of the generated URL separate from the markup. " GunGeekATX Candidates for Closure 44017 Add filter to display edit post link without 'edit_post' capability Posts, Post Types normal major Awaiting Review enhancement new reporter-feedback 2018-05-09T04:40:20Z 2018-06-05T04:12:20Z "WordPress has come a long way from just being a Blogging CMS. Now we can allow our end users to Post using different plugin without bringing the users in WP Admin. So, basically users don't need the 'edit_post' capability to be just able to create and edit posts using plugins. Hence, this filter is needed so that plugins can allow any user to view the built in edit post link on front-end if needed." rafsuntaskin Candidates for Closure 32545 "Adding actions before and after ""Add New"" button" Posts, Post Types 4.2.2 normal normal Awaiting Review enhancement reopened dev-feedback 2015-06-01T05:33:27Z 2019-05-30T00:04:12Z "We need a proper action to add new customs options (button, link, information) before and after the ""Add New"" button of post pages. Such as http://stackoverflow.com/questions/29811433/wordpress-add-custom-button-on-post-type-list-page on #wp-admin/edit.php line 281 on #wp-admin/edit-form-advanced.php line 395 This is just a addition of actions to make wordpress more customizable and modular. Few use-case scenarios [[Image(screenshot1.png)]] [[Image(screenshot2.png)]] '''Solution''' We can use the following sample code to solve the problem. {{{#!php /** * Fires before the Add New button is added to screen. * * The before_add_new- hook fires in a number of contexts. * * The dynamic portion of the hook name, `$pagenow`, is a global variable * referring to the filename of the current page, such as 'edit.php', * 'post.php' etc. A complete hook for the latter would be * 'before_add_new-post.php'. */ do_action('before_add_new-'.$pagenow); if ( current_user_can( $post_type_object->cap->create_posts ) ) echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; /** * Fires after the Add New button is added to screen. * * The after_add_new- hook fires in a number of contexts. * * The dynamic portion of the hook name, `$pagenow`, is a global variable * referring to the filename of the current page, such as 'edit.php', * 'post.php' etc. A complete hook for the latter would be * 'before_add_new-post.php'. */ do_action('after_add_new-'.$pagenow); }}} " vivekbhusal Candidates for Closure 50292 Change 'post updated' notification text to '[post type name] updated' Posts, Post Types normal normal Awaiting Review enhancement new close 2020-06-01T09:48:27Z 2020-07-28T01:36:16Z "When working with a custom post type if you update the post you get the notification ""Post updated."" - would this be better to show the post type name instead of post? It's more descriptive. I have flagged 'updated' but I suspect there maybe more instances of this with other statuses." ninetyninew Candidates for Closure 57597 Have a button to copy permalinks on the post & page overview Posts, Post Types normal normal Awaiting Review enhancement new close 2023-02-01T08:31:00Z 2023-02-02T06:50:31Z "I think it would be quite handy if in the post & page overviews, there is a button to copy to the link to that page/post in the quick links. So, you don't have to go to the page OR have to open the editor to copy the permalink. This would especially be handy if you work with hidden pages." NekoJonez Candidates for Closure 49773 Navigating through list of posts on single.php is not functioning Posts, Post Types 5.5 normal major Awaiting Review enhancement new dev-feedback 2020-04-01T23:30:54Z 2020-04-02T02:44:45Z "Wordpress is fantastic, but there are some flaws (at least from my perspective). I don't know if this can be classified as a bug or an enhancement, but WordPress expects that (single) pages could contain archive listings and might require pagination, yet single posts do not expected to have archive listings which is causing this issue. Instead of taking the page-slug/page/#/, it should take the post-slug/#/ when using the pagination in single.php. What's happening is that the page # request portion is ignored and $paged will always be 1, and the “wrong” URL is rewritten to the “correct” one. Taking the $paged value from the main query and use it in a custom query often is problematic. So, it does not allow us to add navigate through a list of posts in single.php. When using e.g. this snippet: {{{
    ...
    }}} It will only spit out the HTML elements, but not the buttons, as there is nothing to show. Another example: {{{#!php 25, 'paged' => $paged, ) ); $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; if ( $wp_query->have_posts() ) : ?> have_posts() ) : $wp_query->the_post(); ?>
  • "">
    "">
  • }}} Nothing works. Best case scenario is that it adds a page, but you then get the following: websiteURL/post-url/page/number And of course, that also does not work and therefore you can't scroll through posts as you like. Can we get this checked and hopefully fixed, please? I am desperately waiting for this, and many more are like me (Stackoverflow is filled with these questions)." 1BJK903 Candidates for Closure 39848 New filter 'the_title_wrap' Posts, Post Types 4.7.2 normal normal Awaiting Review enhancement new dev-feedback 2017-02-11T20:46:21Z 2017-07-03T15:18:35Z "== Problem: In plugin I wish to add some markup after/before the post and page title so, naturally, I use `the_title` filter. However, this filter is applied on `get_the_title()` function which is used by all instances of post title all over the page (menus, edit links etc). On top of that, more and more themes are using `the_title()` with before and after params which makes all my custom markup wrapped inside this before and after. So when theme is using `the_title( '

    ', '

    ' )`, and my markup in filter is, for example an image, then I get: {{{

    The title

    }}} Or something even worse if my custom markup is more complex. == Proposal (possible solution): I have tested another filter on `the_title()` function **(wp-includes/post-template.php)** and it gave me exactly what I needed: {{{#!php /** * Display or retrieve the current post title with optional markup. * * @since 0.71 * * @param string $before Optional. Markup to prepend to the title. Default empty. * @param string $after Optional. Markup to append to the title. Default empty. * @param bool $echo Optional. Whether to echo or return the title. Default true for echo. * @return string|void Current post title if $echo is false. */ function the_title( $before = '', $after = '', $echo = true ) { $title = get_the_title(); if ( strlen($title) == 0 ) return; $title = $before . $title . $after; /** * Filters the post title after 'the_title' filter. * * @param string $title The post title. */ $title = apply_filters( 'the_title_wrap', $title ); if ( $echo ) echo $title; else return $title; } }}} I named it `the_title_wrap` because it wraps everything that comes with `the_title` function and filter. This filter doesn't apply on menus, edit links etc. Tested on twenty* themes, it applies only on posts and pages title on singulars and on posts title inside the loop on archive pages. Also, my custom markup doesn't end up inside `

    ` or `` tags. Now it looks like this: {{{

    The title

    }}} This is, of course, somewhat uncertain because I'm counting on theme author to use `the_title()` instead of `get_the_title()` but I think it's worth of effort as sometimes it becomes nearly impossible to target only entry title on singular or inside loop on archives etc. Thank you." milana_cap Candidates for Closure 35097 New filter: `edit_post_type_title` Posts, Post Types normal normal Awaiting Review enhancement new dev-feedback 2015-12-15T09:15:30Z 2017-02-05T13:53:13Z "Filter in edit.php to filter title. Why ? I filter this page by term and I want have title of current term edit.php?post_type=investor-day&funds-categories=title" sebastian.pisula Candidates for Closure 45864 On list page All(x) count does not consider Trash items. Hence Trash should appear differently Posts, Post Types 5.0.2 normal normal Awaiting Review enhancement new dev-feedback 2019-01-08T13:29:48Z 2019-05-22T12:33:17Z "I find it confusing with the way WordPress shows `All(xx)` along with a broken down counts of each status when we have trashed items, `All(xx)` only considers un-trashed posts. So I feel displaying `Trash(xx)` exactly as rest of the status is not visually right. Since Trashed items are not considered in `All` count, it needs to be displayed a bit differently. I think if we can do something like the following it will look more logical. 1. Increase left margin before `Trash(xx)` so that it looks a bit separated. 2. Change the color of Trash link to `#dc3232`. Since `Delete Permanently` and `Trash` links are also using red color. 3. One more observation. We are writing `Published`, `Scheduled`, so I think rather `Trashed` could be used instead of `Trash` to match the rest. Here is a proposed solution: File: `/wp-admin/css/common.css` {{{ .subsubsub li.trash-posts { margin-left: 2rem; } .subsubsub li.trash-posts a { color: #dc3232; } }}} File: `wp-admin/includes/class-wp-list-table.php` {{{#!php $view ) { if( 'trash' === $class ) { $views[$class] = ""\t
  • $view""; } else { $views[$class] = ""\t
  • $view""; } } ... } }}} File: `wp-includes/post.php` {{{#!php _x( 'Trash', 'post status' ), ... ... 'label_count' => _n_noop( 'Trash (%s)', 'Trashed (%s)' ), ... ) ); }}} Please let me know if this makes sense." subrataemfluence Candidates for Closure 41773 Page Templates // Post Type Templates | Any Post Type? Posts, Post Types 4.7 normal normal Awaiting Review enhancement new reporter-feedback 2017-09-01T00:39:03Z 2021-06-07T09:59:55Z "If I add a template like this: {{{#!php cap->edit_others_posts ) on update Posts, Post Types normal normal defect (bug) new dev-feedback 2014-11-21T23:13:46Z 2019-06-04T20:48:03Z "The product use-case is that the creator of a post should always be able to edit the post, even when they've assigned someone else as a byline. To do so, I'm storing their user ID to post meta: {{{ public function action_wp_insert_post_persist_author( $post_id, $post, $update ) { $post_obj = Post::get_by_post_id( $post_id ); if ( $update || ! in_array( $post->post_type, Fusion()->get_post_types() ) || ! $post_obj || ! $post->post_author ) { return; } $post_obj->set_first_author_id( $post->post_author ); } }}} And then filtering `map_meta_cap`: {{{ /** * Filter map meta cap to do whatever custom caps we need */ public function filter_map_meta_cap( $caps, $cap, $user_id, $args ) { switch ( $cap ) { case 'edit_post': $post_obj = Post::get_by_post_id( $args[0] ); if ( ! $post_obj ) { break; } $post_type = get_post_type_object( $post_obj->get_post_type() ); // Allow first authors to always edit the post if ( $post_obj->get_first_author_id() && $user_id == $post_obj->get_first_author_id() ) { // Don't require editing others' posts if ( false !== ( $key = array_search( $post_type->cap->edit_others_posts, $caps ) ) ) { unset( $caps[ $key ] ); } // If the post is published... if ( 'publish' == $post_obj->get_status() ) { $caps[] = $post_type->cap->edit_published_posts; } elseif ( 'trash' == $post_obj->get_status() ) { if ( 'publish' == get_post_meta( $post_obj->get_id(), '_wp_trash_meta_status', true ) ) { $caps[] = $post_type->cap->edit_published_posts; } } else { // If the post is draft... $caps[] = $post_type->cap->edit_posts; } } break; } return $caps; } }}} This approach generally works — except the original author isn't able to save an update to a post because `_wp_translate_postdata()` aggressively checks `current_user_can( $ptype->cap->edit_others_posts )` ([https://core.trac.wordpress.org/browser/tags/4.0.1/src/wp-admin/includes/post.php#L67 ref]). A check for `current_user_can( $ptype->cap->edit_post, $post_data['ID'] )` was added to `_wp_translate_postdata()` in r22950, but the changeset also leaves in the `edit_others_posts` check. Given `current_user_can( 'edit_post' )` falls back to `edit_others_posts` behind the scenes ([https://core.trac.wordpress.org/browser/tags/4.0.1/src/wp-includes/capabilities.php#L1114 ref]), I'd expect we could remove the second check." danielbachhuber Tickets Needing Feedback 35871 before_delete_post incorrectly triggered from edit.php to post.php Posts, Post Types 4.4.2 normal normal defect (bug) new reporter-feedback 2016-02-19T10:44:18Z 2019-06-04T20:55:27Z "It seems there's a bug where {{{before_delete_post}}} triggers when clicking the post name (on edit.php) to go to the post.php admin edit screen. I have this code {{{#!php description){ echo '

    '; echo esc_html( $post_type_object->description); echo '

    '; }?> }}} It's a pretty small update but its pretty useful for clients so that know what this admin edit screen is for. I use them for outlining what type of content will be added here. If the content type doesn't have a description nothing is outputted. I can submit a pull request since it's a fairly straightforward change. Cheers Simon " simonrcodrington Tickets Needing Feedback 39666 "Put front page on top of ""All pages"" list" Posts, Post Types normal normal Future Release enhancement new dev-feedback 2017-01-23T03:33:36Z 2020-02-27T21:57:27Z "I'd like to see the front page and blog page as first elements in the pages list (if such are set of course), no matter what priority they may have. What do you think? Screenshot follows." Presskopp Tickets with Patches 41448 Contributors shouldn't be able to change the date of their drafts Posts, Post Types 2.7 low normal Future Release defect (bug) new needs-unit-tests 2017-07-26T12:33:48Z 2017-08-04T13:24:10Z "(I'm guessing that) contributors shouldn't be able to change a post's publication date—that's why the ''Publish'' box doesn't include the date when logged in as a contributor in the first place. However, if a contributor quick edits a post in the ''All Posts'' screen, they'll be able to change the post's date. We should remove the date field from the ''Quick Edit'' form. Or, alternatively, we should allow contributors to edit this date while they're editing a post. Either way, both screens should be consistent." davilera Tickets with Patches 37627 Custom Fields Heading shows up when all meta values are serialized arrays/objects Posts, Post Types normal normal defect (bug) new has-patch 2016-08-10T18:38:23Z 2019-06-04T21:02:53Z "`_list_meta_row` skips the meta rows when the value is a serialized array/objects. When all meta values are serialized arrays/objects OR when you only have one meta with the value being serialized array/object the table heading shows up: [[Image(https://cldup.com/sVKAp24YMF.png)]] [[Image(https://cldup.com/0axQNTon98.png)]] There is a check for protected metas before the table rendering wp-admin/includes/meta-boxes.php:631 {{{ $metadata = has_meta($post->ID); foreach ( $metadata as $key => $value ) { if ( is_protected_meta( $metadata[ $key ][ 'meta_key' ], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ][ 'meta_key' ] ) ) unset( $metadata[ $key ] ); } list_meta( $metadata ); }}} but it does not take in account meta values, which are skipped later. ''This might be considered an edge case, but it is better to be noted.'' Discovered this when I reported: #37626" implenton Tickets with Patches 34808 Deprecate get_media_embedded_in_content() and get_tag_regex() Posts, Post Types normal normal defect (bug) new has-patch 2015-11-28T05:08:54Z 2019-06-04T20:53:17Z "Both are ""dead"" functions not used anywhere in core. Seem like left overs from the post types code in 3.6. `get_media_embedded_in_content()` is buggy: cannot handle nested `` tags (which were popular few years ago for embedding flash) and doesn't match short ended tags without a slash at the end. `get_tag_regex()` is also buggy, see #26674. It was used in `get_media_embedded_in_content()` before [31574]. Not used anywhere since then." azaozz Tickets with Patches 60646 Docs: Incorrect return type specified for get_post_custom with negative post ID value Posts, Post Types 5.8 normal trivial Future Release defect (bug) new has-patch 2024-02-27T15:11:58Z 2024-03-08T12:03:04Z "On the documentation page for `get_post_custom`, the return type section says: ""False for an invalid $post_id (non-numeric, zero, or negative value)."" https://developer.wordpress.org/reference/functions/get_post_custom/ However, the function applies `absint` to the `$post_id`. So if its value would be negative (i.e. -10), this would be converted a positive value (10), and `get_post_meta` would be called for that post. This post ID can then either exists (resulting in an array being returned) or not (empty string). Perhaps a negative numerical value should not converted? There's a potential for mix-ups? If we keep the code as is, the docs should probably specify that negative values are converted to positive." roytanck Tickets with Patches 26809 Errors from wp_update_post obscured in edit_post Posts, Post Types 3.9 normal normal defect (bug) new has-patch 2014-01-10T20:00:59Z 2019-06-04T20:45:19Z "A sample reproduction of a bug that illustrates the general case I'd like to document: 1. Activate a theme that has page templates (e.g. twentyeleven). 2. Enable Jetpack and configure the Sharing module, which does things on `save_post` (or set up something else that does things on `save_post`). 3. Write a post and select a template (e.g. `single-page.php`). 4. Switch to a theme (e.g. twentythirteen) that doesn't have page template UX in the page editing screen. 5. Toggle the ""Show sharing buttons"" setting in the relevant metabox (or do something else that will occur on `save_post` that's easily detected after saving). 6. Save the post. Expected Result: If there's a failure saving any piece of the data, the user'll be notified, and possibly the whole save will be postponed until any errors are corrected. Actual Result: Changes to the main post fields are saved, but things that would have fired on `save_post` do not happen, resulting in a partial save of the data (e.g. sharing status is not saved). The code in `wp-includes/post.php` that checks for a valid page template returns before several actions (including `save_post`) fire because the valid template check fails. The failure is essentially silent because `edit_post()` doesn't check the return of `wp_update_post()`. In the particular case I outline above, the issue arises because post meta for the page template existed and lives in `$postarr` based on a save when the old theme was activated. When saved under a theme with no page template UX, the value from meta is used but is not a valid value for the new theme. So it correctly errors, but the early return causes later actions not to fire properly, wreaking havoc that's tricky to spot. Optimally, it seems like WP would at least check the return of `wp_update_post( $foo, true )` for `is_wp_error()` in `edit_post()` and would fail gracefully (or at least `wp_die()` as in other cases) if an error was returned, but then there are other issues as well, such as the fact that some meta values are saved in `edit_post()` before the `wp_update_post()` executes, and theoretically these'd need to be rolled back as well on failure. The template check in `wp-includes/post.php` should also be moved to higher up in the code than where it currently lives so that the check would bail prior to the database update. I imagine that there might be much larger architectural issues that would subsume any changes to the way `edit_post()` works, so rather than providing a fix for the specific issue that'd likely be rejected anyway, I wanted to raise the general issue for discussion/rejection/whatever. Possibly relevant: #21963." dllh Tickets with Patches 36738 No validation for $post_date_gmt parameter Posts, Post Types 4.5.1 normal normal defect (bug) new has-patch 2016-05-03T11:52:59Z 2019-06-04T20:58:26Z "1) When publishing a post via `wp_insert_post()`and the `$post_date_gmt` parameter has a wrong format it's silently set to `0000-00-00 00:00:00`. 2) If `$post_date` is omitted in the parameter array WP tries to determine it from `$post_date_gmt`. A wrong formatted `$post_date_gmt` leads to a `post_date` of `1970-01-01 00:00:00`. Just like `$post_date`it should throw an error to give a programmer the right hint for his malfunctioning code. " Latz Tickets with Patches 41471 Page dropdown walker must check selected against value field Posts, Post Types 4.9 normal normal Future Release defect (bug) new needs-unit-tests 2017-07-28T03:36:18Z 2019-02-20T21:18:08Z `Walker_PageDropdown` only checks `selected` with the page `ID` and ignores `value_field` option. geminorum Tickets with Patches 32295 Pagination on preview/scheduled posts Posts, Post Types 4.2.2 normal normal Future Release defect (bug) new has-patch 2015-05-07T18:47:45Z 2024-02-22T16:22:35Z "The option to add a NextPage (Pagination) is not functioning in page previews or when a post/page is scheduled to be published. The expected outcome is when adding the code for nextpage, you get links to Page 1, 2, etc. and when you click those links, you are taken to more content. However, when a page/post is not PUBLISHED but is in Preview or Scheduled, the Pagination does not function as expected. Clicking on Page 2 refreshes the page and shows the content on page 1 again. When the page is published, everything works as expected, but for someone who is trying to preview their post before publishing, this is not helpful." jacklyn.jade Tickets with Patches 39351 Passing 'none' to menu_icon of custom post type displays broken image in admin menu Posts, Post Types normal minor Future Release defect (bug) new has-patch 2016-12-20T22:39:43Z 2017-05-19T14:27:41Z "According to the inline documentation of class WP_Post_Type you have to pass 'none' for the menu_icon parameter to leave div.wp-menu-image empty to be able to add an icon via CSS. However passing none (or div) as menu_icon while registering a post type result in a broken image because instead of 'none' you get 'http://none'. The following condition in line 120 of menu-header.php does not match: {{{ if ( 'none' === $item[6] || 'div' === $item[6] ) { $img = '
    '; } }}} The conditional statement in line 103 of /wp-admin/menu.php url escapes any value of menu_icon that is neither a dashicons class nor a svg data: {{{ if ( 0 === strpos( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) || 0 === strpos( $ptype_obj->menu_icon, 'dashicons-' ) ) { $menu_icon = $ptype_obj->menu_icon; } else { $menu_icon = esc_url( $ptype_obj->menu_icon ); } }}} To make 'none' and 'div' (deprecated) work as documented either the first condition has to be extended or an additional elseif statement has to be included. I have opted for the second statement for better readability and documentation. " mensmaximus Tickets with Patches 44530 Post or page custom fields give wrong error message when enter value only. Posts, Post Types normal normal Future Release defect (bug) new has-patch 2018-07-06T10:20:24Z 2018-07-07T02:10:17Z "When I enter custom field's value without field name on the page and click on ""Add Custom Field"" button, The custom field gives the wrong error message ""Please provide a custom field value"". Normally, Message should ""Please provide a custom field name."" Because I entered only custom field value not a custom field name. I have attached the screenshot to get the better idea about the issue." harsh175 Tickets with Patches 40860 "Post that is ""Pending Review"" and Scheduled shows incorrect ""Last Modified"" date in Post Listing" Posts, Post Types 4.7.5 low normal Future Release defect (bug) new has-patch 2017-05-25T03:21:23Z 2018-01-15T16:42:00Z "Reproduction steps: 1. Create a new post 2. Schedule the post for a date in the future 3. Set the status to ""Pending Review"" 4. Save the post 5. Return to Posts listing 6. Observe that the ""Date"" column has an incorrect ""Last Modified"" flag" yearginsm Tickets with Patches 38507 Quick Edit: Parent label without input when editing page Posts, Post Types normal normal Future Release defect (bug) new has-patch 2016-10-26T07:53:42Z 2019-03-26T21:27:57Z "Noticed while working on #18375. To reproduce: 1. Delete all pages 2. Create a new page, save as Draft 3. Click Quick Edit or Bulk Edit 4. Notice a 'Parent' label without any dropdown It might make sense to always use 'show_option_none' in `wp_dropdown_pages()`, even when there are no pages. However, that might lead to data loss when a parent ID is set but the page does not exist anymore. Instead, the 'Parent' label could be hidden. Screenshot: [[Image(https://cldup.com/tUquX3xYvS.png)]] " swissspidy Tickets with Patches 36462 Updating or publishing a (custom) post that hasn't loaded completely closes comments Posts, Post Types 4.4.2 normal normal Future Release defect (bug) new dev-feedback 2016-04-10T14:44:28Z 2017-02-20T22:19:57Z "I am using a custom post type, but I assume this happens to the default post type as well. On the edit post screen (post.php?post=1&action=edit) I have several custom meta boxes. Some of these have content that is quite slow to load. You can reproduce this behavior by adding a sleep(5) statement somewhere in the code that loads the content for a custom meta box. Now in the document's DOM, the sidebar is loaded before the custom meta boxes. This introduces a situation where it is possible to update or publish a post before all the meta boxes have completely loaded. In most cases this isn't a huge problem - I myself check to see if the $_POST fields are there and if they are not then I don't act upon them. Unfortunately this does not happen for the included ""Discussion"" meta box. This box has a checkbox named ""Allow Comments"" which gets switched off when you update the post before this meta box has loaded into the DOM. The culprit is the code in wp-admin/includes/post.php on line 133 in the _wp_translate_postdata() function: {{{#!php if (!isset( $post_data['comment_status'] )) $post_data['comment_status'] = 'closed'; }}} Since the comment_status field is not in the post data, it is automatically assumed it needs to be closed. Of course there are two ""workarounds"" I can think of that would improve my current situation. One is for me to optimize the meta boxes so the page loads quicker, the other is to move the Discussion metabox to the top of the page, so it loads first. Is this expected behavior? I would much rather see the current comment_status be preserved - don't touch it if I didn't intend to modify it. Of course there might be a reason for this implementation that I don't know about. This post data is then finally presented to wp_insert_post in wp-includes/post.php which actually updates the post's comment_status to become closed, which finally answers my boss' question why comments kept getting disabled automatically." SeBsZ Tickets with Patches 11207 WordPress may display incorrect message when post is saved/published/etc Posts, Post Types 2.9 normal normal Future Release defect (bug) assigned has-patch 2009-11-20T20:23:23Z 2023-11-30T01:24:00Z When post is saved, WP calls `wp_insert_post_data` filter. Plugin can use it to change post status. But even post status has been changed via plugin, WP still displays message basing on action originally executed by user. Need to change this and take into account final post status too. sirzooro Tickets with Patches 36634 `register_post_status()` default causes notices in post list table Posts, Post Types normal normal defect (bug) new has-patch 2016-04-22T15:14:08Z 2019-06-04T20:57:24Z "The default value for the `$label_count` parameter in `register_post_status()` is an ""array of `$label`, twice."" As far as I can see, `$label_count` is used only once in core: in `WP_Posts_List_Table::get_views()`, where it's passed to `translate_nooped_plural()`. However, `translate_nooped_plural()` assumes the array it receives was generated through `_n_noop()` or similar. So the default `$label_count` value leads to undefined-index notices for each of the expected array keys when viewing the list table. To replicate, register a post status with these args, assign a post the 'test' status, and view the post list table: {{{ add_action( 'init', function () { register_post_status( 'test', array( 'label' => 'Test', 'show_in_admin_status_list' => true ) ); } ); }}} The attached patch would fix the notices by checking the `$nooped_plural` keys in `translate_nooped_plural()` and attempting to return a fallback value. Also, even though `$label_count` is an optional argument, it looks to me like developers are expected to register it as the list table expects. So, the patch would add a `_doing_it_wrong()` call to `register_post_status()` when no `$label_count` is included. This does, however, also flag the `auto-draft` and `inherit` statuses." dlh Tickets with Patches 28488 get_post_type_object on CPT in _count_posts_cache_key after a wp_insert_post returns null Posts, Post Types 3.9.1 normal normal defect (bug) new has-patch 2014-06-08T19:44:45Z 2019-06-04T20:47:17Z "After running a {{{wp_insert_post}}} in one of my plugins I got the following notices because {{{get_post_type_object}}} in {{{_count_posts_cache_key}}} returns null. I've added a simple not equals null check to the function to prevent these notices. Backtrace: {{{ Backtrace from warning 'Trying to get property of non-object' at /vagrant/latest/wp-includes/post.php 2188: /vagrant/latest/wp-includes/post.php 5484 calling _count_posts_cache_key() calling _transition_post_status() /vagrant/latest/wp-includes/plugin.php 470 calling call_user_func_array() /vagrant/latest/wp-includes/post.php 3665 calling do_action() /vagrant/latest/wp-includes/post.php 3200 calling wp_transition_post_status() /vagrant/latest/wp-content/plugins/my-plugin/core/classes/class-connection-manager-core.php 34 calling wp_insert_post() /vagrant/latest/wp-content/plugins/my-plugin/core/classes/class-connection-manager-core.php 271 calling add() /vagrant/latest/wp-content/plugins/my-plugin/core/classes/class-admin-menu.php 117 calling save() calling handle_post() /vagrant/latest/wp-includes/plugin.php 470 calling call_user_func_array() /vagrant/latest/wp-admin/admin.php 144 calling do_action() Backtrace from warning 'Trying to get property of non-object' at /vagrant/latest/wp-includes/post.php 2188: /vagrant/latest/wp-includes/post.php 5484 calling _count_posts_cache_key() calling _transition_post_status() /vagrant/latest/wp-includes/plugin.php 470 calling call_user_func_array() /vagrant/latest/wp-includes/post.php 3665 calling do_action() /vagrant/latest/wp-includes/post.php 3200 calling wp_transition_post_status() /vagrant/latest/wp-content/plugins/my-plugin/core/classes/class-connection-manager-core.php 34 calling wp_insert_post() /vagrant/latest/wp-content/plugins/my-plugin/core/classes/class-connection-manager-core.php 271 calling add() /vagrant/latest/wp-content/plugins/my-plugin/core/classes/class-admin-menu.php 117 calling save() calling handle_post() /vagrant/latest/wp-includes/plugin.php 470 calling call_user_func_array() /vagrant/latest/wp-admin/admin.php 144 calling do_action() Backtrace from warning 'Cannot modify header information - headers already sent' at /vagrant/latest/wp-includes/pluggable.php 1121: /vagrant/latest/wp-includes/pluggable.php 1121 calling header() /vagrant/latest/wp-content/plugins/my-plugin/core/classes/class-admin-menu.php 119 calling wp_redirect() calling handle_post() /vagrant/latest/wp-includes/plugin.php 470 calling call_user_func_array() /vagrant/latest/wp-admin/admin.php 144 calling do_action() }}}" barrykooij Tickets with Patches 27326 wp_list_pages - exclude parameter changes behaviour depending on depth Posts, Post Types 3.8.1 normal normal defect (bug) new has-patch 2014-03-08T15:01:38Z 2019-06-04T20:46:05Z "Let's say I have four top level pages with IDs 1,2 and 3 and each has three children, say, (11,12,13), (21,22,23) and (31,32,33). If I run {{{ }}} on that I'll get all the pages shown. So it'll be a list like: {{{ 1 11 12 13 2 21 22 23 3 31 32 33 }}} If I run {{{ }}} then page 3 will not be shown and the hierarchy will collapse so 31,32,33 appear in the top level of the hierarchy. So what I'll get is: {{{ 1 11 12 13 2 21 22 23 31 32 33 }}} Given the existence of a separate ''exclude_tree'' argument, that is pretty much what I'd expect to happen, after all it has to show the child pages somehow. If I now introduce a ''depth'' argument so it is: {{{ }}} I'd expect the same thing to happen as the ''depth'' shouldn't make any difference. What actually happens is that the ''exclude'' now behaves similarly to ''exclude_tree''. What I actually get is: {{{ 1 11 12 13 2 21 22 23 }}} Now that to me doesn't make sense." nosnurg Tickets with Patches 50447 wp_publish_post not checking for unique post slugs Posts, Post Types 5.5 normal major Future Release defect (bug) new has-patch 2020-06-22T16:59:10Z 2022-10-17T10:07:18Z "When published a post using wp_publish_post no check is done to see if the slug / post_name is unique. This leads to problems with the permalink. I have attached a patch file to the ticket as I could not make a PR to the github **Steps to reproduce**: Make and publish an article titled 'test'. ID 1 Make and set to draft a second article titled ' test'. ID 2 call wp_publish_post(2) the post name of articles 1 and 2 are both set to test. This can be worked around by calling the following code instead: {{{#!php 2, 'post_status' => 'publish', ]; wp_update_post($post); }}} " hughie.molloy Tickets with Patches 28145 wp_terms_checklist() returns all non-hierarchical terms even with $descendants_and_self parameter Posts, Post Types 3.9 normal normal defect (bug) new has-patch 2014-05-06T07:55:51Z 2019-06-04T20:46:52Z "Granted, I know that `wp_terms_checklist()` is meant for hierarchical terms, but I am also using it on non-hierarchical terms in my Radio Buttons for Taxonomies plugin. I was trying to use all core scripts/ajax-callbacks for the ""add new term"" feature in a posts taxonomy metabox, but it turns out that `WP_Lists` calls `_wp_ajax_add_hierarchical_term` via ajax which returns `wp_terms_checklist()` as part of the result. For hierarchical terms the `descendants_and_self` parameter limits the size of the returned checklist. For non-hierarchical terms, however, I found that it simply returns *all* terms in addition to the new term. {{{ wp_terms_checklist( $post_id, array('descendants_and_self' => $term_id )); }}} Obviously this isn't major, but it seems to me that if `descendants_and_self` is set, but there are no descendants... it should just return the single term. I've gotten around this by unhooking that ajax callback for non-hierarchical terms and substituting my own that returns just a single input. Here's the pertinent part of `wp_terms_checklist()`: {{{ if ( $descendants_and_self ) { $categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) ); $self = get_term( $descendants_and_self, $taxonomy ); array_unshift( $categories, $self ); } else { $categories = (array) get_terms($taxonomy, array('get' => 'all')); } }}} I think if for non-hierarchical terms we skipped the `get_terms()` call we could limit the returned checklist to a single term. {{{ if ( $descendants_and_self ) { $categories = is_taxonomy_hierarchical( $taxonomy ) ? (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) ) : array(); $self = get_term( $descendants_and_self, $taxonomy ); array_unshift( $categories, $self ); } else { $categories = (array) get_terms($taxonomy, array('get' => 'all')); } }}}" helgatheviking Tickets with Patches 50546 Add better error notices when deleting things fail Posts, Post Types normal normal Future Release enhancement new dev-feedback 2020-07-03T09:50:01Z 2020-07-07T13:48:56Z "I've stumbled upon this when working with foreign key restraints and post deletion. Working on a project I've added some data to the custom DB table row that has a foreign key association with custom post type post. So, when I try to delete the post it will fail, as it should 🎉. But the error I got was: `Error in deleting`. Hmmm, ok. Not a big deal. WordPress is pretty flexible in most cases, so there's bound to be a filter for that. When searching for it, upon checking the above string I've found 5 matches in 3 files. So if some error happens when deleting a post, you'll get that message in `wp_die`. If it happens on attachment delete, the same message. How are you supposed to know where that error came from, just from the message? You need to check the error log, etc. Which is ok when you're a developer, but what if you're not? A user could get this message on the screen from some plugin and then they'll open up a support question with this message. Not really helping the debugging process. I'm not saying the entire stack trace should be visible (that is advanced debugging), but even just adding `Error in deleting a post`, or `Error in deleting an attachment` would be an improvement IMO. Having some extra details would be even better, but small steps first. " dingo_d Tickets with Patches 33714 Add custom post types to the 'At a Glance' widget Posts, Post Types 3.8 low normal enhancement new needs-docs 2015-09-03T20:48:57Z 2019-06-04T21:03:54Z "This patch introduces a new argument to the `register_post_type()` function which will list a custom post type in the 'At a Glance' widget. A few notes: - For backwards compatibility reasons the new argument is set to false by default. - If no menu_icon argument is set, then it will default to `dashicons-marker`. This is the same behaviour as previous. - I've added menu_icon arguments to the core post/page post_types. I'm not sure if this has any negative implications. - Removed a small chunk of unnecessary CSS where the dashicons were hardcoded into the styling rather than using the existing `.dashicons` classes. (Related #27414) - `wp_dashboard_quota()` was slightly refactored due to the removal of some of the CSS." paulwilde Tickets with Patches 36237 Add filter for post statuses in quickedit Posts, Post Types 4.4.2 normal normal enhancement new has-patch 2016-03-14T16:53:31Z 2019-06-04T20:55:48Z "To make changes to the quick edit status list, one has to use JS or action ''quick_edit_custom_box'' to add extra fields. In instances where some of the statuses need to be removed, JS is required. [[BR]] I propose that the statuses in ''wp-admin/includes/class-wp-posts-list-table.php (line 1284-1300)'' be stored in an array then filtered using ''quick_edit_statuses'' before the array is iterated through to create the select options.[[BR]] I'm available to submit a patch that does this " kakomap Tickets with Patches 40311 Disable inline edit post via filter Posts, Post Types normal normal Future Release enhancement new has-patch 2017-03-30T10:03:11Z 2017-03-30T10:44:51Z "I suggest add new filter: {{{ disable_inline_edit_post }}} if true inline edit is disable." sebastian.pisula Tickets with Patches 37332 Enhancement: Add a wrong password message on password protected posts Posts, Post Types 4.5.3 normal normal enhancement new has-patch 2016-07-11T22:15:07Z 2024-02-15T14:11:33Z "If a post is password protected, the user is shown a form where they can enter a password to gain access. If a wrong password is given, there's no helpful message shown to the user. The page is simply reloaded. Something like ""Wrong password. Please try again."" would be helpful here." henry.wright Tickets with Patches 37667 Handle post type support in `WP_Post_Type` Posts, Post Types 4.6 normal normal Future Release enhancement new has-patch 2016-08-15T11:29:21Z 2019-04-18T21:43:17Z "Currently post type features are stored in a global variable `$_wp_post_type_features`. Now that we have `WP_Post_Type`, I think it would make sense to let the class handle this functionality. Post type features are part of a post type, so they should also be part of it in the implementation. This would also allow us to get rid of the global variable we currently use (note that it's private, so it's not intended to be used directly by other developers). There's a single possible caveat I would see with this implementation: That would be if post type support is added before the post type is even registered. However, I would think we might be able to change this (with a dev note) since it should be best practices to add post type support either directly (via the `supports` argument in `register_post_type()`) or after registering the post type. Adding a post type feature without the post type being registered is not logical in my opinion." flixos90 Tickets with Patches 37462 Introduce is_private() conditional Posts, Post Types normal normal enhancement new has-patch 2016-07-25T17:20:10Z 2019-08-07T09:20:38Z Add a quick conditional tag to check whether the post is private. sillybean Tickets with Patches 39106 Make hierarchy level indicator text changeable [WP List] Posts, Post Types 4.6.1 low minor Future Release enhancement assigned has-patch 2016-12-06T10:09:08Z 2021-01-31T16:29:57Z " In `WP_Posts_List_Table` class, dashes(—) used to indicate the hierarchy level of post item, which is not changeble by any filter, we can add a new filter to replace this string. {{{ $pad = str_repeat( '— ', $this->current_level ); }}} https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-posts-list-table.php#L918-L919 Source: http://wordpress.stackexchange.com/questions/248405/replace-dashes-before-title-in-page-list" gk.loveweb Tickets with Patches 60038 Pass original array of arguments to hooks that fire within `wp_insert_post()` Posts, Post Types normal normal Future Release enhancement new has-patch 2023-12-08T16:55:31Z 2024-02-23T07:48:49Z "The `$postarr` value passed to the `wp_insert_post()` function contains context that can be useful to callbacks attached to the actions that fire within this function, but this value isn't passed to any of them. Strangely enough it ''is'' passed to most of the filters there. As an example, a plugin of mine needs to perform logic within a callback on the `wp_insert_post` action based on a mixture of the `tax_input` argument and a custom argument. The `wp_insert_post_data` filter needs to be used to access these values. The `$postarr` value gets copied to `$unsanitized_postarr`. This is the value that should be passed to the actions because it contains the original input array, rather than `$postarr` which includes defaults and sanitised values. Or both should be passed, as per the filters in the function. This affects the following actions: * `pre_post_update` * `edit_attachment` * `attachment_updated` * `add_attachment` * `edit_post_{$post->post_type}` * `edit_post` * `post_updated` * `save_post_{$post->post_type}` * `save_post` * `wp_insert_post` And the following filters: * `add_trashed_suffix_to_trashed_posts` " johnbillion Tickets with Patches 27736 Save one query when inserting a new post Posts, Post Types 3.0 normal normal enhancement new has-patch 2014-04-09T13:31:34Z 2019-06-04T20:46:31Z "The workflow when inserting a new post is the following : 1) `wp_insert_post()` sets a few vars (post type, post status, ...), updates `$wpdb->posts`, then calls `wp_set_post_categories()` 2) first thing `wp_set_post_categories()` wants to know is `$post_type` and `$post_status`, for which it performs an SQL query, instead of getting this info from caller function Same things goes for `wp_insert_attachment()` Patch passes extra optional parameters `$post_type` and `$post_status` to `wp_set_post_categories()`, to save one query when adding a post, or a whole bunch when importing a batch." ozh Tickets with Patches 28172 edit_post() should call {un}stick_post() before calling wp_update_post() Posts, Post Types 4.0 normal normal Future Release enhancement new needs-unit-tests 2014-05-08T01:37:34Z 2023-01-26T17:48:29Z "In a plugin I'm writing I have a need to hook into the `save_post` action and decide whether to allow a given post to be sticky based on postmeta associated with that post (and possibly other posts). However, if the function I attach to the `save_post` action calls `{un}stick_post()` it doesn't have the desired effect because of the way `edit_post()` is written. In particular, lines 320-332 of [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/post.php#L320] are: {{{ wp_update_post( $post_data ); // Now that we have an ID we can fix any attachment anchor hrefs _fix_attachment_links( $post_ID ); wp_set_post_lock( $post_ID ); if ( current_user_can( $ptype->cap->edit_others_posts ) ) { if ( ! empty( $post_data['sticky'] ) ) stick_post( $post_ID ); else unstick_post( $post_ID ); } }}} The `save_post` action is fired within `wp_update_post()` (technically, it is fired by `wp_insert_post()` which is called by `wp_update_post()`). Since `edit_post()` calls `{un}stick_post()` '''after''' it calls `wp_update_post()`, anything I do in my `save_post` function with regard to whether the post should be sticky is undone! Hence, I suggest changing the relevant portion of `edit_post()` to {{{ if ( current_user_can( $ptype->cap->edit_others_posts ) ) { if ( ! empty( $post_data['sticky'] ) ) stick_post( $post_ID ); else unstick_post( $post_ID ); } wp_update_post( $post_data ); // Now that we have an ID we can fix any attachment anchor hrefs _fix_attachment_links( $post_ID ); wp_set_post_lock( $post_ID ); }}} Is there a specific reason why `edit_post()` currently calls `wp_update_post()` before `{un}stick_post()`? (it isn't apparent to me) Another option I investigated was whether it was possible to have my plugin change `$post_data` via a filter but I couldn't find one. If others agree that this change would be good and wouldn't break anything else, I'll submit a patch. [Note: I went back and forth on whether to call this a bug or an enhancement. It's a bug in the sense that there is certainly an unexpected result ({un}sticking a post in a `save_post` action is undone...I lost about an hour trying to figure out why my `save_post` function wasn't doing the right thing); But it is an enhancement in the sense that core, itself, is not broken]." pbiron Tickets with Patches 35308 get_the_excerpt: For protected posts the output should be able to be filtered Posts, Post Types normal normal enhancement new has-patch 2016-01-04T20:47:24Z 2020-07-03T21:11:05Z "If I want to show an excerpt of a protected post, then I have to search the output of get_the_excerpt for a string like ""There is no excerpt because this is a protected post."" and replace this string by the actual excerpt. In a multilanguage environment this creates a source of possible errors. I would like to see that the filter ""get_the_excerpt"" is also applied to the ""There is no excerpt ..."" message. Code in the function get_the_excerpt could look like this: {{{#!php post_excerpt; }; // emanaku new /** * Filter the retrieved post excerpt. * * @since 1.2.0 * * @param string $post_excerpt The post excerpt. */ // return apply_filters( 'get_the_excerpt', $post->post_excerpt ); // emanaku replace with next line return apply_filters( 'get_the_excerpt', $excerpt ); // emanaku changed } }}} With this change a filter asking for protected content can hook into get_the_excerpt and can deliver any kind of excerpt (the real excerpt, a customized protected text, a form to give the password etc.) " emanaku Tickets with Patches 36603 wp_publish_post() does not fire post_updated action Posts, Post Types 4.6 normal normal enhancement new has-patch 2016-04-20T13:25:14Z 2019-06-04T20:57:19Z "{{{ do_action( 'post_updated', $post_ID, $post_after, $post_before); }}} Gives convenient access to before/after state of the post for actions that are conditional on exact changes performed. `wp_publish_post()` inconsistently doesn't fire this hook, even though it does fire `edit_post` and `save_*` hooks that come before and after it. This makes it impossible to rely on `post_updated` hook since it will never fire for any update performed by `wp_publish_post()`." Rarst Tickets with Patches 37068 wp_unique_post_slug() should accept `$post` parameter rather than post properties Posts, Post Types normal normal enhancement new has-patch 2016-06-10T03:30:31Z 2022-01-18T13:48:49Z "Breaking this ticket off from #20419. The function signature for `wp_unique_post_slug()`' is currently: {{{ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) }}} This is a departure from `wp_unique_term_slug()`, which accepts two parameters: `$slug` and `$term` (where `$term` is a term object). For greater consistency, we should prefer a post object in `wp_unique_post_slug()`. There are also some cases where the current function signature requires weird hacks, such as when generating sample permalinks. See #20419. Another argument for standardizing the signature. Latest patch is at https://core.trac.wordpress.org/attachment/ticket/20419/20419.5.diff" boonebgorges Unpatched Bugs 47279 $post object passed to clean_post_cache action can contain outdated values Posts, Post Types normal normal Future Release defect (bug) new needs-unit-tests 2019-05-15T14:28:45Z 2019-05-15T21:57:01Z "This occurs when publishing or deleting a post. In the `clean_post_cache()` function, `get_post( $post )` is called and assigned to `$post`. At that moment, the value of the `$post` parameter `post_status` = `draft` if publishing, `publish` if deleting the post. There is then a call to `wp_cache_delete( $post->ID, 'post_meta' );`, which correctly updates the value of post_status, if you perform another `get_post()` right after. But, the `$post` object is then passed to the action `clean_post_cache`, with the outdated values instead. So if someone hooks a function on `clean_post_cache`, and uses the `$post` object passed, it's going to receive incorrect values compared to what would be expected. But if you perform a `get_post()` inside that function, you will get the correct values. I only tested this with the `post_status` parameter, but this might be affecting others too. I would expect that the `$post` object passed to the `clean_post_cache` action contains up-to-date values." tabrisrp Unpatched Bugs 31331 $post->post_date displays current time if status is pending or draft Posts, Post Types 4.1 normal normal defect (bug) new 2015-02-14T17:11:45Z 2019-06-04T20:49:15Z "Create a new post and save as a draft or save as 'pending'. On single.php enter these lines of code: {{{ global $post; var_dump(date(""Y-m-d H:i:s"")); //current time var_dump($post); }}} If you wait about 5 minutes to refresh the front-end page after saving the post as draft/pending, you'll notice that the current time and the $post->post_date are the same (accounting for timezone differences). Further more, if you refresh the page after another 5 minutes, the $post->post_date will change. However, the $post->post_date and $post->post_modified are different. When comparing to the database values, the $post->post_modified matches its database value, but $post->post_date will continue to match the current time and '''not''' what is in the database for `post_date`. It seems to me that the post object should reflect what is in the database regardless of the post_status. If a post is draft/pending, it is inconsistent to use post_date to note when the post was originally created. I can see the code that is responsible for this is on wp-includes/query.php on line 3527-3528: {{{ if ( 'future' != $status ) $this->posts[0]->post_date = current_time('mysql'); }}} I apologize if I'm thinking about this wrongly." danbrellis Unpatched Bugs 46288 'get_extended' breaks when using 'more' gutenberg block Posts, Post Types 5.0 normal normal Future Release defect (bug) new 2019-02-20T10:21:14Z 2019-04-24T06:21:18Z "'get_extended' returns the closing tag ' in the extended content, which prevents 'the_content' filter from working correctly. Steps to replicate: {{{#!php ', '', $post); }}} " joewebber Unpatched Bugs 31504 Add new item gives bunch of errors if disabled Posts, Post Types 4.1 normal normal defect (bug) new 2015-03-02T14:00:00Z 2019-06-04T20:49:24Z "I created new post category 'cars'. But cars are added/deleted via Php code automatically via: wp_insert_post(...) and wp_delete_post(...) So I wanted to remove 'add new car' from navigation menu. And somehow remove the 'delete' capability. So I used this code in plugins register_post_type $args: {{{ array( ... 'capability_type' => 'car', /*'capabilities' => array( 'create_posts' => false, // Removes support for the ""Add New"" function - DOESN'T WORK 'delete_post' => false, 'publish_posts' => false, ), 'map_meta_cap' => true, // Set to false, if users are not allowed to edit/delete existing posts */ ...) }}} Appears the 'add_new' is not shown, but now I got bunch of warnings all over the admin: {{{ Notice: Undefined offset: 0 in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1075 Notice: Trying to get property of non-object in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1077 Notice: Trying to get property of non-object in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1081 Notice: Trying to get property of non-object in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1083 Notice: Trying to get property of non-object in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1084 Notice: Trying to get property of non-object in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1084 Notice: Trying to get property of non-object in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1087 Notice: Trying to get property of non-object in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1087 Notice: Undefined offset: 0 in C:\Program Files (x86)\Zend\Apache2\htdocs\GitHub\*WEB-NAME*\wp-includes\capabilities.php on line 1075 }}} " ozzWANTED Unpatched Bugs 35550 AllPosts page: Tags field does not accept characters <> Posts, Post Types 4.4.1 normal minor defect (bug) new 2016-01-20T21:43:49Z 2019-06-04T20:54:37Z " STEPS TO REPRODUCE 1. Log in as administrator and create new post ""Test post"". 2. Go to AllPosts page. Check ""Test post"" and perform ""Edit"" bulk action. 3. Type into ""Tags"" 2 characters ""<>"". Click ""Update"" EXPECTED RESULT: Characters <> are added as a tag. EXPECTED RESULT: Characters <> are not added as a tag." antonrinas Unpatched Bugs 35606 AllPosts page: contradiction in filtering by Category and category assigning to the post Posts, Post Types 4.4.1 normal minor defect (bug) new 2016-01-25T20:52:14Z 2019-06-04T20:54:43Z "'''STEPS TO REPRODUCE''': 1. Log in as administrator. 2. Go to Posts->Categories. 3. Add category: Name - ""Test category"", Slug - ""test-category"". 4. Add category: Name - ""Test subcategory"", Slug - ""test-subcategory"", Parent - ""Test category"". 5. Go to AllPosts page. 6. Add new post: Title - ""Test post"", assign it to ""Test category"". 7. Add new post: Title - ""Test post for subcategory"", assign it to ""Test subcategory"". 8. Go to AllPosts page. 9. Filter posts by category ""Test category"". '''EXPECTED RESULT''': Post ""Test post"" is presented as a result of filtration. '''ACTUAL RESULT''': Posts ""Test post"", ""Test for subcategory"" is presented as a result of filtration. If to follow this logic, post ""Test post for subcategory"" had to be assigned to ""Test subcategory"" and automatically to parent category in the moment of creation. See attachment." antonrinas Unpatched Bugs 47637 Enhance excerpt_remove_blocks to handle more types of group blocks Posts, Post Types 5.2.2 normal normal Future Release defect (bug) reopened 2019-07-02T11:29:15Z 2021-11-22T07:21:00Z "The function excerpt_remove_blocks only considers top-level Blocks in an allowed list for the autogeneration of excerpts. However, since there is now a Group Block in Core (and a lot of self-developed Grouping Blocks out there), this can lead to autogenerated Excerpts being empty although there is plenty of content within the Post. I propose to add a new filterable ""group blocks"" array, which adds another level to be included in the autogeneration. Additionally, there should be a possibility to register a callback which can be used to generate a custom excerpt dynamically if needed for custom blocks. Change function excerpt_remove_blocks to this: {{{ function excerpt_remove_blocks($content){ $allowed_inner_blocks = array( // Classic blocks have their blockName set to null. null, 'core/freeform', 'core/heading', 'core/html', 'core/list', 'core/media-text', 'core/paragraph', 'core/preformatted', 'core/pullquote', 'core/quote', 'core/table', 'core/verse', ); $group_block_excerpt_functions = array( 'core/group' => 'parse_group_block_excerpt', ); $allowed_blocks = array_merge( $allowed_inner_blocks, array( 'core/columns' ) ); /** * Filters the list of blocks that can contribute to the excerpt. * * If a dynamic block is added to this list, it must not generate another * excerpt, as this will cause an infinite loop to occur. * * @since 4.4.0 * * @param array $allowed_blocks The list of allowed blocks. */ $allowed_blocks = apply_filters( 'excerpt_allowed_blocks', $allowed_blocks ); $group_blocks = apply_filters('excerpt_allowed_group_blocks',$group_block_excerpt_functions); $blocks = parse_blocks( $content ); $output = ''; foreach ( $blocks as $block ) { if(in_array($block['blockName'],$group_blocks,true)){ //We have a group Block with no extra excerpt function $output.= parse_group_block_excerpt($block,$allowed_inner_blocks); } elseif(in_array($block['blockName'],array_keys($group_blocks),true)){ //The Block registered a custom callback for autogenerating an Excerpt $output.=call_user_func($group_blocks[$block['blockName']],$block,$allowed_inner_blocks); } elseif( in_array( $block['blockName'], $allowed_blocks, true ) ) { if ( ! empty( $block['innerBlocks'] ) ) { if ( 'core/columns' === $block['blockName'] ) { $output .= _excerpt_render_inner_columns_blocks( $block, $allowed_inner_blocks ); continue; } // Skip the block if it has disallowed or nested inner blocks. foreach ( $block['innerBlocks'] as $inner_block ) { if ( ! in_array( $inner_block['blockName'], $allowed_inner_blocks, true ) || ! empty( $inner_block['innerBlocks'] ) ) { continue 2; } } } $output .= render_block( $block ); } } return $output; } }}} Add a function parse_group_block_excerpt {{{ function parse_group_block_excerpt($block,$allowed_blocks){ $output = """"; if(!empty($block['innerBlocks'])) { foreach($block['innerBlocks'] as $inner_block){ if('core/columns' === $inner_block['blockName']){ $output .= _excerpt_render_inner_columns_blocks( $inner_block, $allowed_inner_blocks ); continue; } // Skip the block if it has disallowed or nested inner blocks. foreach($inner_block['innerBlocks'] as $inner_inner_block){ if ( ! in_array( $inner_inner_block['blockName'], $allowed_inner_blocks, true ) || ! empty( $inner_inner_block['innerBlocks'] ) ){ continue 2; } } } } return $output; } }}} After that, a custom block can register itself as an group block just by using {{{ add_filter('excerpt_allowed_group_blocks','add_my_awesome_group_block_to_excerpt'); function add_my_awesome_group_block_to_excerpt($allowed_blocks=array()){ $allowed_blocks[] = 'my-awesome/groupblock'; return $allowed_blocks; } }}} or even by using a custom excerpt function for dynamic blocks by using {{{ add_filter('excerpt_allowed_group_blocks','add_my_awesome_group_block_to_excerpt'); function add_my_awesome_group_block_to_excerpt($allowed_blocks=array()){ $allowed_blocks['my-awesome/groupblock'] = 'my_awesome_group_block_custom_excerpt'; return $allowed_blocks; } }}} (I hope i did this right as this is my first ticket)" kuchenundkakao Unpatched Bugs 49812 "EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'""." Posts, Post Types normal normal defect (bug) reopened 2020-04-04T18:33:34Z 2020-11-11T11:26:21Z "We got a problem =( Clean wp installation. Pages /wp-admin/post-new.php /wp-admin/post.php?post=1&action=edit Server configuration: NGINX + PHP-FPM I have a security file /etc/nginx/blog.anv.me/security.conf ... add_header Content-Security-Policy ""default-src 'self' http: https: data: blob: 'unsafe-inline'"" always; ... Content Security Policy is an effective measure to protect my blog from XSS attacks. Console log {{{ [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) (anonymous function) (blocks.js:6146:95) __webpack_require__ (blocks.js:21) (anonymous function) (blocks.js:85) Global Code (blocks.js:86) [Error] TypeError: undefined is not an object (evaluating 'wp.blocks.setCategories') Global Code (post-new.php:1673) [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) (anonymous function) (rich-text.js:761:95) __webpack_require__ (rich-text.js:21) (anonymous function) (rich-text.js:85) Global Code (rich-text.js:86) [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) createReduxStore (data.js:1722) createNamespace (data.js:1611) (anonymous function) (data.js:2240) (anonymous function) (keyboard-shortcuts.js:853:91) __webpack_require__ (keyboard-shortcuts.js:21) (anonymous function) (keyboard-shortcuts.js:85) Global Code (keyboard-shortcuts.js:86) [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) createReduxStore (data.js:1722) createNamespace (data.js:1611) (anonymous function) (data.js:2240) (anonymous function) (viewport.js:340:91) __webpack_require__ (viewport.js:21) (anonymous function) (viewport.js:85) Global Code (viewport.js:86) [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) (anonymous function) (lodash.js:5115) (anonymous function) (block-editor.js:9447) __webpack_require__ (block-editor.js:21) (anonymous function) (block-editor.js:85) Global Code (block-editor.js:86) [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) (anonymous function) (core-data.js:2233:108) __webpack_require__ (core-data.js:21) (anonymous function) (core-data.js:85) Global Code (core-data.js:86) [Error] TypeError: undefined is not an object (evaluating 'external_this_wp_blockEditor_[""withFontSizes""]') (anonymous function) (block-library.js:3388:104) __webpack_require__ (block-library.js:21) (anonymous function) (block-library.js:85) Global Code (block-library.js:86) [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) createReduxStore (data.js:1722) createNamespace (data.js:1611) (anonymous function) (data.js:2240) (anonymous function) (notices.js:548:91) __webpack_require__ (notices.js:21) (anonymous function) (notices.js:85) Global Code (notices.js:86) [Error] TypeError: undefined is not an object (evaluating 'external_this_wp_blockEditor_[""SETTINGS_DEFAULTS""]') (anonymous function) (editor.js:2095) __webpack_require__ (editor.js:21) (anonymous function) (editor.js:85) Global Code (editor.js:86) [Error] EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: ""default-src 'self' http: https: data: blob: 'unsafe-inline'"". Function (data.js:161) (anonymous function) (data.js:161) combineReducers (data.js:162) (anonymous function) (lodash.js:5115) (anonymous function) (edit-post.js:1491:148) __webpack_require__ (edit-post.js:21) (anonymous function) (edit-post.js:85) Global Code (edit-post.js:86) [Error] TypeError: undefined is not an object (evaluating 'external_this_wp_richText_[""registerFormatType""]') (anonymous function) (format-library.js:1897) forEach (anonymous function) (format-library.js:1893) __webpack_require__ (format-library.js:21) (anonymous function) (format-library.js:85) Global Code (format-library.js:86) [Error] TypeError: undefined is not an object (evaluating 'wp.editPost.initializeEditor') (anonymous function) (post-new.php:1827) [Error] TypeError: undefined is not an object (evaluating 'wp.blocks.unregisterBlockStyle') (anonymous function) (editor-script-block.js:8) }}} " anvme Unpatched Bugs 39651 Find Posts modal does not show post-type labels correctly Posts, Post Types 4.7.1 normal normal Future Release defect (bug) new 2017-01-20T11:59:21Z 2017-01-21T02:22:58Z "The screenshot shows the output of four different posts in the '''Find Posts Modal'''. The last two post are correct, at the first and second post the post-type-label (e.g. cpt_example) is missing. The problem is the post-type parameter ""''public''"", if it is set to ""''false''"" the label will not be shown AND you will get the following PHP-Notice (if DEBUG is true): {{{ Undefined index: cpt_example in ... /wp-admin/includes/ajax-actions.php on line 1803 Trying to get property of non-object in ... /wp-admin/includes/ajax-actions.php on line 1803 }}} At the following code (1745 ff.) you will notice the reason of this issue: '''$post_types''' only includes '''public posts''' {{{#!php true ), 'objects' ); ^^^^^^^^^^^^^^^^ }}} The output of this modal shows all posts (public and unpublic), so i don't think that this ""filter"" was set for security reasons. In my opinion it must either show all posts correctly with their labels (which would be great) or it must suppress all ""unpublic"" posts completely. " arkonisus Unpatched Bugs 28288 New Post overwriting a previously published post Posts, Post Types 2.5 normal normal defect (bug) new 2014-05-17T01:03:45Z 2019-06-04T20:47:04Z "This was seen on wordpress.com, a user had multiple draft windows open. At one point when saving one draft, it wrote over another previously published post. I believe that it was caused by a race condition that has to do with the environment being hosted on multiple servers. '''To reproduce:''' 1. Open in quick succession multiple draft windows. 2. Check in developer tools for post_id duplicate. I believe that a possible solution would be to enhance post-locking to include if a post is open in duplicate windows by the same user." jackreichert Unpatched Bugs 37064 No checkbox in Posts list table for bulk action Posts, Post Types normal normal defect (bug) new 2016-06-09T15:25:20Z 2019-06-04T21:00:24Z In posts list table it checks that user has edit_post capability or not and output checkbox depend on that. WP_Posts_List_Table also output table for any CPT. But user may not have edit_post capability but have delete_post capability or may be any other capability which need bulk select. In my case i created a CPT and which i restricted users from editing published post using 'edit_published_posts' but i did not restrict users from delete published post. But when i saw post table for that CPT i saw that no checkbox after post being published. But have Trash link individually when i mouse over that post. shamim51 Unpatched Bugs 49969 "Previewing the page designated as ""latest posts"" shows the frontpage" Posts, Post Types normal normal Future Release defect (bug) new 2020-04-21T11:32:13Z 2024-02-21T18:00:31Z "This continues the discussion from https://github.com/WordPress/gutenberg/issues/2409 **The issue** * Create two pages (let's call them ""My home"" and ""My posts"") * Go to customizer and set Homepage to be ""My home"" and Posts page to ""My posts"" * Edit ""My posts"" in editor mode * Press preview * Confirm you got ""My home"" instead of ""My posts"" **The root cause** When you click ""Open preview in new tab"" while editing ""My posts"", Gutenberg redirects to a preview URL like this one: https://mywpsite.com/?page_id=5&preview_id=5&preview_nonce=12bd60d6f4&preview=true When you visit that URL, WordPress will load the front page instead of the posts page. This is because class-wp-query.php assumes that posts page is also the front page: https://github.com/WordPress/WordPress/blob/b4373fafe9b87f75bf9d65e808be8049510dff8b/wp-includes/class-wp-query.php#L1032 Then, when rendering a preview, it substitutes the page_id that was requested with the value of get_option( 'page_on_front' ): https://github.com/WordPress/WordPress/blob/b4373fafe9b87f75bf9d65e808be8049510dff8b/wp-includes/class-wp-query.php#L1904 If I remove the preview parameters and leave only ?page_id=5, it displays the correct page." zieladam Unpatched Bugs 32039 Publish date when publishing a scheduled post in the past Posts, Post Types 4.1.1 normal normal defect (bug) new 2015-04-21T16:04:42Z 2019-06-04T20:49:37Z "Given the following steps: 1. Set a post to be scheduled at a later date, i.e. 20/04/2015 11:30 2. Wait until that time has passed and then click 'Publish', i.e. at 21/04/2015 09:00 The post's published date is set to the date at which it was scheduled to go live, when in reality it was not actually pushed to a published state until the time publish was clicked. `$post->date` was `2014-04-20T11:30` and not the expected `2014-04-21T009:00`, and published date in UI shows the incorrect date. Although this is not necessarily a common occurrence (basically forgetting to click Publish / Schedule) it is possible in the UI and leads to a confusing date, and one that in our case breaks other functionality that relies on a published date." adambarclay Unpatched Bugs 27002 Scheduling not working when editing posts Posts, Post Types 3.8.1 normal normal defect (bug) new 2014-02-04T00:56:19Z 2019-06-04T20:45:34Z "I didn't see this the list but I have had this happen to me more than once. I have posts scheduled 2-3 weeks in advance to work on them and set for Feb 22 at 14:00 posting time. While working on the post the button that should be ""schedule"" says ""publish"" If you click the publish butting it will publish it immediately rather then que it for posting via scheduling. I have to go in change the time or date, click the ok button below scheduling and then change it back. This has happened more than once for me. If the post does publish it is still listed as the original date rather than the date it publishes. I have to double check them but I don't always catch them. This has happened on both firefox and Safari. Today is February 3 but the post says it was posted on February 22, 2014. It is now set to private " timgoleman Unpatched Bugs 28017 Slug conflict with hierarchical Custom Post Types Posts, Post Types 3.9 normal normal defect (bug) new 2014-04-24T20:32:46Z 2019-06-04T20:46:48Z "To Replicate, create a '''hierarchical ''' custom post type and make sure it has support for page attributes, lets call it ""items"" Publish 3 ""items"" posts with the following slug and content ( IN THIS ORDER! ) Post 1: Slug - samsung , No Parent , content : ""Welcome to Samsung"" Post 2: Slug - cell-phones , No Parent , content : ""Welcome to cell phones"" Post 3: Slug - samsung , Parent: cell-phones , content : ""Welcome to cell phones by Samsung"" Navigate to http://localhost/items/samsung/ , You will see the content for Post 3. The correct content should be from Post 1. http://localhost/items/cell-phones/samsung/ works just fine. To get the correct results: Modify wp-includes/query.php , line 2340: {{{ // ORIGINAL LINE if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ], '/') === false ) { // MODIFIED LINE if ( ! $ptype_obj->hierarchical ) { }}} " internetrnd Unpatched Bugs 48622 `editable_slug` filter does not pass the correct value Posts, Post Types 5.3 normal normal Future Release defect (bug) new 2019-11-14T05:23:52Z 2019-11-14T15:36:42Z "''Originally reported in https://github.com/WordPress/gutenberg/issues/15802.'' **Describe the bug** When using the block editor, the 1st param $post_name passed to the editable_slug filter hook is not the same as the classic editor, which is the expected one. **To reproduce** 1. Install Classic Editor to switch from block to classic 2. Create a draft post with title ""the post title"" and slug ""this-is-the-slug"" 3. Create a muplugin with: add_filter( 'editable_slug', function( $post_name ) { wp_die( $post_name ); } ); 4. Refresh your edit page **Expected behavior** With the classic editor you should have ""this-is-the-slug"" but when using block editor you have ""the-post-title"", sounds like the post_title sanitize with sanitize_title, it should be the real post_,name like classic is doing." noisysocks Unpatched Bugs 36595 can't set post_modified in wp_insert_post, becomes post_date Posts, Post Types 1.0 normal normal defect (bug) new dev-feedback 2016-04-19T15:34:29Z 2020-04-01T19:46:50Z "When manually instering a post, post_modified isn't working, it becomes the post_date {{{#!php 'test', 'post_content' => 'test', 'post_status' => 'publish', 'post_type' => 'test', 'post_author' => 1, 'post_date' => '2015-01-22 22:00:12', 'post_modified' => '2016-04-18 12:12:12', 'comment_status' => 'closed' ); wp_insert_post( $wp_test ); }}} outcome: post_modified = '2015-01-22 22:00:12'" gijsgg Unpatched Bugs 32057 fix: allow plugins to access click event in edit inline post Posts, Post Types 2.7 normal normal defect (bug) new 2015-04-22T12:03:58Z 2019-06-04T20:49:45Z "I wanted to add custom functionality to inline post edit, but there is code that prevents me from doing this. ---trunk--- in /wp-admin/js/inline-edit-post.js, line 53 {{{ 51: $('#the-list').on('click', 'a.editinline', function(){ 52: inlineEditPost.edit(this); 53: return false; 54: }); }}} fix: {{{ 51: $('#the-list').on('click', 'a.editinline', function(e){ 52: inlineEditPost.edit(this); 53: e.preventDefault(); 54: }); }}} but first time appered in 2.7 {{{ 82: addEvents : function(r) { 83: r.each(function() { 84: var row = $(this); 85: $('a.editinline', row).click(function() { inlineEditPost.edit(this); return false; }); 86: }); 87: }, }}} " wasikuss Unpatched Bugs 32651 get_adjacent_post() doesn't return posts with the same date Posts, Post Types 4.3 normal normal Future Release defect (bug) new 2015-06-15T05:48:40Z 2019-06-24T05:28:53Z "When using `get_adjacent_post()` on a post, the query skips posts with exactly same date and time. In a blog context, the problem is rarely encountered, but it's more present when posts are added programmatically." willybahuaud Unpatched Bugs 37441 get_default_post_to_edit() function is broken Posts, Post Types normal normal defect (bug) new 2016-07-22T08:32:09Z 2019-06-04T21:02:04Z "The [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/post.php?rev=38118#L591 get_default_post_to_edit()] function contains the following code (formatted for the sake of better readability) in case a new post should be inserted to the database: {{{#!php __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft', ) ); $post = get_post( $post_id ); }}} Later in the function, we just ''work'' with the `$post` object. The problem is, there are [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php?rev=38125#L2919 se]-[https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php?rev=38125#L2966 ve]-[https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php?rev=38125#L3038 ral] [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php?rev=38125#L3205 rea]-[https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php?rev=38125#L3220 sons] under which [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php?rev=38125#L2873 wp_insert_post()] returns `0`. In such a case, [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post.php?rev=38125#L451 get_post()], in turn, will return `null`, which is neither a `WP_Post` object nor an `object` at all. Then, [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/post.php?rev=38118#L639 setting a property on this null post] will automatically create a new `stdClass`, resulting in the `$post` object only having the three explicitly set properties `post_content`, `post_title` and `post_excerpt`. If you want to see how this affects WordPress, just put `$post = null;` before [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/post.php?rev=38118#L631 wp-admin/includes/post.php:L631]." tfrommen Unpatched Bugs 36313 get_pages() child_of argument does not work in combination with meta_key/value query Posts, Post Types 4.4.2 normal normal defect (bug) new 2016-03-23T21:38:48Z 2023-07-06T12:21:02Z "If you pass both `child_of` and `meta_key/value` parameters to the `get_pages()` function, there are problems. To reproduce: Create a page structure like so: Grandparent (id=1) -Parent (id=2) --Child (id=3) Add a custom field to the Child page. Say `meta_key='bark'` and `meta_val='woof'`. Call {{{ get_pages(array( 'child_of'=>1, 'meta_key'=>'bark', 'meta_value'=>'woof' )); }}} And it will return an empty array. The reason this is happening is because in the `get_pages` function (`wp-includes/post.php`) on line 4562, the `$pages` array only contains Child because it's been filtered by the `meta_key`, but `get_page_children()`, which is being used to determine which pages are `child_of`, requires the complete hierarchy of connected pages to determine which are children, and so it returns nothing. I hope this is helpful. Obviously there are workarounds using loops and get_posts() and people are always suggesting you don't use get_pages() but anyhow, there it is, a bug report. :)" MarcGuay Unpatched Bugs 37372 "missing ""edit permalink button"" below the title" Posts, Post Types 4.5.3 normal normal defect (bug) new 2016-07-14T22:14:25Z 2019-06-04T21:01:40Z "With posts and pages there is an ""edit permalink button"" below the title. Also, permalinks change when the title is changed. For custom posts that does not seem to work in the same way: For the function register_post_type() there is a 'public' argument which is merely a way of defining 4 other arguments in 1. If you set that to false and then set 'show_ui' to true to get the user interface back you get the complete user interface except the ""edit permalink button"" below the title. Also, permalinks do not change when the title is changed. That seems like a bug and not like intended functionality." realblueorange Unpatched Bugs 34253 wp_insert_post() can assign a random, unauthorized user_id's Posts, Post Types 4.3.1 normal normal defect (bug) new 2015-10-11T07:48:09Z 2019-06-04T20:52:13Z "Hello, When using wp_insert_post, the `get_current_user_id()` function is being called when post_author is left empty. When updating a plugin, and this function appears, you would assume the admin (whoever updated the plugin) would ""insert the post"". But this is not always the case, for instance when you update the plugin through FTP, or use auto-update, or static Opcode caching, etc. However, the admin area is accessible to many on a multisite environment with open registrations. But is also accessible by subscribers, if permitted. The user who accesses the admin area first after updating the code be assigned as post author. An example code below will show you the defect in action, on a Multisite environment: {{{ // Update 'plugin' here, log out and flush opcode cache. // This 'plugin' now executes the following code in admin_init: // Some options. $the_post_id = false; $main_blog = 0; $post_title = 'About WordPress'; $post_content = 'WordPress is great!'; $post_id_option = 'the_inserted_post_id'; // Switch to main blog switch_to_blog( $main_blog ); // Prevent code from running twice with option $page = get_post( get_option( $post_id_option ) ); if ( !$page ) { // Page doesn't exist yet // Insert post $the_post_id = wp_insert_post( array( 'post_title' => $post_title, 'post_status' => 'publish', 'post_type' => 'page', 'post_content' => $post_content ) ); } if ( $the_post_id ) { // Prevent code from running twice by updating option. update_option( $post_id_option, $the_post_id ); } // Back to current blog. restore_current_blog(); }}} A resolution would be to check if the current user has rights to post content. Either by default or parameter. Even more so, assign the site admin if the `current_user_can()` check fails. Thanks!" Cybr Unpatched Enhancements 30917 "Add ""Save and Close"" button to page/post edit screen" Posts, Post Types normal normal enhancement new 2015-01-05T19:36:30Z 2019-06-04T20:48:23Z It would be useful to have an additional button in the Publish box of the page/post the edit screen to save the post and then return to the main page/post edit/listing screen. Currently, the Save button reloads the page/post and you then have to click on the menu link to view the page/post main edit/listing screen. Vitzkrieg Unpatched Enhancements 34546 Change in function `get_post_field` Posts, Post Types normal normal enhancement new 2015-11-01T18:35:51Z 2019-06-04T20:53:00Z "I suggest change for function get_post_field(); 1. Second param should be optional; 2. Add default value in param of function. Additional I have question. Why in function get_the_ID() or get_post_title(); don't call function get_post_field ? In many functions in first line is $post = get_post( $post ); If we insert my patch then we can use: {{{ function get_the_ID() { return get_post_field('ID', null, 'display', false); } }}} OR {{{ function get_the_guid( $id = 0 ) { return apply_filters( 'get_the_guid', get_post_field( 'guid', $id ) ); } }}} " sebastian.pisula Unpatched Enhancements 37671 Emptying Bin with large amount of posts results in whitescreen Posts, Post Types normal normal Future Release enhancement new needs-unit-tests 2016-08-15T16:01:56Z 2017-08-06T00:31:10Z "When the Bin has a large amount of posts, e.g over 1,500, clicking Empty takes a long time to load, several minutes. After it finishes, it loads a blank white page and has only deleted about 75% of the posts. There's ~500 remaining." atomicjack Unpatched Enhancements 36849 Filter to limit length of post slug (filter for _truncate_post_slug) Posts, Post Types 4.5.2 normal normal enhancement new 2016-05-16T14:38:16Z 2019-06-04T20:59:05Z "There are circumstances where you need to limit the lenght of the post slug. Unfortunately there is no filter in _truncate_post_slug to do so. It will be a great enhancement, if there would be a filter in this function. Related function: -wp_unique_post_slug - calling _truncate_post_slug Additionally it would be very usefull, if there could be a filter right at the start of wp_unique_post_slug for filtering the slug. " wp-entwickler.at Unpatched Enhancements 36314 If orderby undefined, alter get_posts to defer to WP_Query's default Posts, Post Types normal normal enhancement new needs-unit-tests 2016-03-23T22:22:46Z 2019-06-04T20:56:15Z "If the argument is undefined, defer `get_posts` orderby & order to that of WP_Query's. For search strings, this will order posts by relevance. In other cases it will have no effect." peterwilsoncc Unpatched Enhancements 57496 Lazy load post meta Posts, Post Types 4.5 normal normal Future Release enhancement assigned 2023-01-18T12:33:40Z 2023-05-10T11:15:00Z "Introduced in [36566], there is was a API introduced to lazily load metadata using the class `WP_Metadata_Lazyloader`. Currently this is only used comment and term meta data. However, this could be expanded to support over meta types like posts. WP_Query is now run multiple lines per page load. Meaning that post meta is primed even when it is not needed. Using the `WP_Metadata_Lazyloader` class, post meta could be loaded on demand and save database queries and object cache lookups. " spacedmonkey Unpatched Enhancements 29014 Normalization of template tag filters Posts, Post Types 3.9 normal normal enhancement new 2014-07-24T04:42:14Z 2019-06-04T20:47:26Z "The filters for the template tags, specifically, title, content and excerpt, are not very uniform. Some of them have a filter for their `get_the` variant, but not others. Only `the_title` sends the post id through the filter while the others do not. The included patch does the following: - Add `get_the` filters to the proper functions for `get_the_title`, `get_the_content`, `get_the_excerpt` - Added post_type specific variants of the filters ( ex. `the_title_{$post->post_type}` - All filters now pass the post id as a second argument" Funkatronic Unpatched Enhancements 36324 Post status labels use inconsistent grammar Posts, Post Types normal normal enhancement new dev-feedback 2016-03-25T05:57:25Z 2019-06-04T20:56:27Z "Our post status labels switch back and forth between being verbs, adjectives, or potentially past-participles: * All * Mine * Published * Scheduled * Drafts * Trash I'd like to suggest we tidy these up. Maybe something like: * All * Authored (I don't love this, but you get the idea) * Published * Scheduled * Drafted * Trashed " johnjamesjacoby Unpatched Enhancements 35842 Register Post Type function label default Posts, Post Types normal normal enhancement new dev-feedback 2016-02-16T10:14:42Z 2019-06-04T20:55:17Z "When registering a Post type if the label or labels arguments are not set the label takes on a default of 'Posts' and not the Post type's name. It states in the documentation that the label takes on the name of the Post type passed in as the first argument. I believe the fix is as simple as updating the defaults variable in wp-includes/post.php on line 1017 with the label argument set to the post_type variable. {{{#!php $post_type, 'labels' => array(), 'description' => '', 'public' => false, 'hierarchical' => false, 'exclude_from_search' => null, 'publicly_queryable' => null, 'show_ui' => null, 'show_in_menu' => null, 'show_in_nav_menus' => null, 'show_in_admin_bar' => null, 'menu_position' => null, 'menu_icon' => null, 'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => null, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'has_archive' => false, 'rewrite' => true, 'query_var' => true, 'can_export' => true, 'delete_with_user' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', ); }}}" moshiezz Unpatched Enhancements 44842 Search post box in mobile Posts, Post Types normal normal Future Release enhancement new 2018-08-25T06:15:19Z 2022-05-18T16:41:22Z "In mobile view when I go to posts screen, I found that search box is not on the top so I dragged all the way down and found that search box is there which is bit odd because why someone will go all the way down looking at posts to search any post. Please see: https://prnt.sc/kmo3jn We can make it like themes screen https://prnt.sc/kmo3k4 by just leaving the search box with a placeholder to search posts and since just typing and entering the text in the box works so they will be able to search the post " prashantvatsh Unpatched Enhancements 35082 get_adjacent_post() when using in term doesn't account for child terms Posts, Post Types normal normal enhancement new 2015-12-14T21:05:29Z 2019-06-04T20:53:35Z "When using any of the next or previous post functions with $in_term set to true only top level terms are accounted for. This means if two posts are in the same child term, and a third is not but is between the posts date range then the third will take precedence. Although I am sure it will be up for discussion, I believe child terms should take priority. Take the following posts for example: '''Post 1''' Date: 01/01/2015 Categories: Parent -> Child '''Post 2''' Date: 02/01/2015 Categories: Parent '''Post 3''' Date: 01/01/2015 Categories: Parent -> Child '''Expected Functionality (In my opinion):''' Post 1 get_adjacent_post(true) should return Post 3 '''Actual Functionality:''' Post 1 get_adjacent_post(true) returns Post 2, which does not match the child term. My attached patch simply removes parent terms from the query, where a child of it is set. This means that only the deepest selected terms will be used, where children and parent terms are set. I have also attached an export of my posts to highlight the issue more clearly, along with a patch to Twenty Fifteen purely to help represent the issue. This really is just an initial draft suggestion for the code, backwards compatibility is obviously extremely important however more discussion about this is needed. There is another issue related to this function involving dates . Sorry if this should be tagged as an enhancement rather than a bug." WazzaJB Unpatched Enhancements 36579 global $wp_rewrite not set when create_initial_post_types() first run Posts, Post Types 4.4 normal normal enhancement new 2016-04-18T17:59:18Z 2019-06-04T20:57:05Z "The global $wp_rewrite is set in wp-settings.php, after create_initial_post_types(). If you want to hook into the 'register_post_type_args' filter, to set `$args->rewrite` then you currently have to jump through hoops to avoid an `Uncaught error Call to a member function add_rewrite_tag() on null` Could the call to set `$GLOBALS['wp_rewrite']` be moved to before `create_initial_post_types()`? Or perhaps some defensive programming in `rewrite.php` to test if $wp_rewrite is set. Functions `add_rewrite_tag` and `add_permastruct` are candidates for that change. " bobbingwide Unpatched Enhancements 43256 wp_delete_post() should use get_post() not wpdb->prepare Posts, Post Types 1.0 normal normal Future Release enhancement new 2018-02-08T06:22:26Z 2018-02-13T11:24:59Z "wp_delete_post() uses a custom SQL query to pre-load the post info in a raw state and ends up adding one extra data I/O call per post/page being deleted. This bypasses the WP_Post::get_instance() wp_cache seeding. Consequently later calls to get_post() such as the 'before_delete_post' action to call _reset_front_page_settings_for_post() then falls through and calls WP_Post::get_instance() calling a nearly-identical SQL query (adds LIMIT 1 to to the same query. Is there any reason why the start of wp_delete_post() should not just call $post = get_post( $postid ) ? Replace: {{{ $post = $wpdb->get_row( $wpdb->prepare( ""SELECT * FROM $wpdb->posts WHERE ID = %d"", $postid ) ); if ( ! $post ) { return $post; } $post = get_post( $post ); }}} With: {{{ $post = get_post( $postid ); if ( ! $post ) { return $post; } }}} reference article for in-depth analysis and performance implications is online at [http://lance.bio/2018/02/08/improving-wp_delete_post-wordpress-core/] If this warrants attention I can find time to spin up my VVV box on latest build and generate a patch file when time allows. " charlestonsw Tickets Awaiting Review 20438 Custom Post Types with Post Format support aren't registered against post_format taxonomy Posts, Post Types normal normal Awaiting Review defect (bug) reopened 2012-04-13T16:56:40Z 2022-05-13T22:06:11Z "When a custom post type adds support for {{{post-formats}}}, this doesn't actually register the {{{post_format}}} taxonomy for the post_type. Here's a quick test: {{{ add_action( 'init', function() { register_post_type( 'not-post', array( 'supports' => 'post-formats' ) ); global $wp_taxonomies; var_dump( 'post supports post_format:', in_array( 'post', $wp_taxonomies[ 'post_format' ]->object_type ) ); var_dump( 'not-post supports post_format:', in_array( 'not-post', $wp_taxonomies[ 'post_format' ]->object_type ) ); } ); }}} The {{{post_format}}} taxonomy doesn't get returned when {{{get_object_taxonomies}}} is called for the custom post type and one side-effect of this is that the {{{post_format_relationships}}} cache does not get flushed by {{{clean_object_term_cache}}} leading to stale values when a post format is changed. (The {{{post}}} post_type is immune to this because core registers the {{{post_format}}} taxonomy with it.) When a post_type adds support for post-formats, an explicit association should be made between the post_type and the {{{post_format}}} taxonomy." batmoo Tickets Awaiting Review 18264 Future private posts listed as already published with future date specified Posts, Post Types normal normal Awaiting Review defect (bug) new 2011-07-27T00:05:27Z 2019-05-23T19:33:38Z "Setting a post to private, and scheduling it for some future date or time, results in the stamp that the post was ""Published on (future date)"" in the publish module. The discussion on tickets #5608 and #9136 suggests that all private posts are published immediately (and privately), and that this is intentional. So, it's misleading and confusing to report that it already was published on some future date. In source:trunk/wp-admin/includes/meta-boxes.php#L163, I suggest we replace: {{{ else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published $stamp = __('Published on: %1$s'); } }}} with: {{{ else if ( 'publish' == $post->post_status ) { // already publicly published $stamp = __('Published on: %1$s'); } else if ( 'private' == $post->post_status ) { // published privately $stamp = __('Published privately'); } }}}" chrisrudzki Tickets Awaiting Review 42323 Posts vs CPT user permissions issue Posts, Post Types 4.9 normal normal Awaiting Review defect (bug) assigned needs-unit-tests 2017-10-24T14:51:56Z 2017-10-24T15:10:29Z "We have the following use case: 1. User does not have access to create new ""Posts"" 2. User does have access to create new Product Submissions (CPT post type) With these prerequisites, when the user clicks on ""New Product Submission"" from the list view (or the edit view), they get the No access message. This happens because in core we check for `edit.php` no_priv instead of `edit.php?post_type=product_submission`." bor0 Tickets Awaiting Review 17115 Publishing an empty post results in success Posts, Post Types 3.1 normal normal Awaiting Review defect (bug) new dev-feedback 2011-04-12T11:32:50Z 2020-05-03T23:40:21Z "'''Steps to reproduce:''' 1. Go to Add New post screen 1. Publish post 1. Success message is displayed with link to initial auto-draft of post The issue can be traced back to the `editpost` switch case in `post.php` (line 204), which calls `edit_post()` and `redirect_post()`. `edit_post()` saves any meta values passed with the post to the auto-draft, which isn't necessarily desirable, and returns the auto-draft post ID. `redirect_post()` then defaults to status message code 6 which incorrectly reports success in publishing." kawauso Tickets Awaiting Review 21132 "List tables' ""select all"" should let you really select all, regardless of screen options" Posts, Post Types normal normal Awaiting Review enhancement new 2012-07-02T04:38:38Z 2017-06-08T06:51:24Z "The select all checkbox in list tables selects all the items in your current view. Usually what I really want is to select all the items on all the pages. As a hack, I'll often leave the screen options setting for items per page on something really high, like 1,000. Unfortunately this means the tables are often really slow for no benefit (most of the time I don't need them all). A better solution would be a way to intelligently select all items without needing to show them on the page. The best example of this that I know of is Gmail, which adds a line above the list of emails when you click the select all box that looks something like this: ""All 50 conversations on this page are selected. Select all 653 conversations in Spam"". The second sentence is a link that, as expected, selects all of your emails that fit the current view, regardless of paging. Screenshot attached." evansolomon Tickets Awaiting Review 24705 wp_link_pages() does not showing active current element Posts, Post Types 2.2 normal major Awaiting Review enhancement new dev-feedback 2013-07-07T22:19:44Z 2018-12-09T22:00:39Z "By full analogy of all wp functions, wp_link_pages must generate active class element too. {{{ 1 2 3 4 }}} but should be {{{ 1 2 3 4 }}} " Alexufo Tickets Awaiting Review 28006 Add visual cues when viewing drafts on the frontend Posts, Post Types normal normal Awaiting Review feature request assigned 2014-04-24T08:07:28Z 2019-04-22T16:46:38Z "This is a relatively minor issue, but I've often had the problem where I think a post is published because I can view it on the frontend and there is nothing on the page that indicates that I am viewing a draft. If this happens to me from time to time then I'm sure it happens to other users too. I propose adding a few unobtrusive visual cues to the single post page that indicates that you are viewing a draft. I have attached my changes here - they include: * Adding ""(Draft)"" to the end the 'edit post' text in the admin bar * Adding ""(Draft)"" to the end of the default link generated by {{{ edit_post_link() }}} * Adding a new body class to single post pages: {{{ single-status-{status} }}} These changes are minor enough to not break the existing display, yet significant enough to clearly show that you are currently viewing a draft. The addition of the post status to the body class will also help with customising the page according to the current status." hlashbrooke Candidates for Closure 24672 Remove final from WP_Post class Posts, Post Types 3.5 normal normal Awaiting Review enhancement reopened dev-feedback 2013-07-02T03:48:03Z 2018-04-18T19:44:22Z "After discussing it with stephdau and reading through #21309, I think a discussion should be had on the validity of using the final keyword on the class. While I agree that a decorator pattern is probably best for building the class, there is still no reason for the keyword to be used. If someone wants to extend the class then they should be allowed to do so." carlalexander Candidates for Closure 14558 Separate Database Table Support for Custom Post Types Posts, Post Types normal normal Awaiting Review enhancement reopened dev-feedback 2010-08-07T06:55:07Z 2024-03-04T09:51:27Z "While working on custom post types, I felt need for this enhancements. This can be achieved by adding an extra argument to the register_post_type function like below... {{{ register_post_type( 'acme_product', array( 'labels' => array( 'name' => __( 'Products' ), 'singular_name' => __( 'Product' ) ), 'public' => true, /* Database separation */ 'db_tables' => array( 'prefix' => '', //by default, value of $table_prefix will be used. If user sets this value to something, it will be used as prefix for both of following tables 'base_prefix' => '' , //this will control it tables are to be kept sitewide or per blog 'posts_name' => 'acme', 'postmeta_name' => 'acmemeta', ), ); }}} This small enhancement (not from coding perspective) will help more plugins authors go for custom post type. Reasons are - first they will get option to have separate data storage. Second - if some other badly coded plugin manipulates wp_posts table in some wrong way, it won't have sideeffect on third-party data. Third - Plugin authors will get more space to experiment as at any time they will be dealing with their own plugin's data. Of course, one of the goal of this nice feature must be to abstract database layer, but as a developer I feel it would be better if I can have some control over database without loosing power of this new (custom post type) feature." rahul286 Tickets Needing Feedback 24415 The 'show_in_admin_all_list' argument for the 'register_post_status' function is ignored when the argument 'public' is set to 'false' Posts, Post Types 3.5.1 normal normal defect (bug) new dev-feedback 2013-05-25T00:06:51Z 2023-05-24T16:08:16Z "Hello, I stumbled upon a bug in the admin section of WordPress. I'm currently running the latest release (3.5.1) without any third-party plugins. After creating some custom post statuses via the 'register_post_status' function, I noticed that posts with them do not appear in the default (all) post listing in the admin section, despite me setting the 'show_in_admin_all_list' argument to 'true'. I narrowed this problem down only to the 'public' argument of the same ('register_post_status') function: if the 'public' argument of custom post status is set to 'true', then everything works as expected and the posts with a custom post status appear in the default (all) post listing in the admin section — but this also makes posts with that custom post status appear to the regular users, making them public, hence the name of the argument. It's worth noting that the 'public' argument has no such buggy effect on the 'show_in_admin_status_list' argument of the same ('register_post_status') function: it doesn't matter to what the 'public' argument is set — the links to the appropriate post statuses are showed at the top of the post listing only based on the 'show_in_admin_status_list' argument, just like it should." XyntaMan Tickets Needing Feedback 8107 get_next_post, get_previous_post do not work for posts posted within same second Posts, Post Types 2.7 normal normal Future Release defect (bug) new dev-feedback 2008-11-08T12:34:22Z 2018-12-09T21:00:15Z "if you have posts that are published shortly one after the other (e.g. through a script or plugin that posts several posts at once) several of them may end up having the same post_date in the wordpress database table. this is due to the fact that mysql datetime seems to only maintain a precision of one second (see also this discussion: http://bugs.mysql.com/bug.php?id=8523). the problem now is that wordpress functions like get_next_post/get_previous_post (get_adjacent_post resp.) will no longer work correctly if something like this happens as they solely rely on a comparison of the post_date field and they don't treat the case where these timestamps are the same for several posts. the result is that e.g. get_next_post will pick one of the posts having the same timestamp and ""jump"" over the others, so the user will never see them. i see two possibilities around this 1.) treat cases with the same post_date by e.g. looking also at the post id (assuming it is always strictly increasing) or probably preferably 2.) make sure that no two posts have the same post_date timestamp by e.g. increasing post_date artificially when publishing the post and if another post already has the same timestamp. " whoismanu Tickets Needing Feedback 15230 Action hook before the inserting post into the database Posts, Post Types 3.1 normal normal Future Release enhancement new dev-feedback 2010-10-27T09:18:46Z 2021-05-11T12:51:37Z "Something like {{{ do_action( 'pre_post_insert', $data, $postarr ); }}} added to ''wp_insert_post'' function right after the ""else"" statement on line 2501 in .../wp-includes/post.php " johnnypea Tickets Needing Feedback 23207 Add $labels argument to register_post_status() Posts, Post Types 3.0 normal normal enhancement reopened dev-feedback 2013-01-15T19:32:54Z 2019-06-04T20:43:43Z "WordPress functions '''register_taxonomy()''' and '''register_post_type()''' has '''labels''' argument. Why not add labels to '''register_post_status()'''? The current way to add status: {{{ $args = array( 'label' => __( 'draft', 'text_domain' ), 'label_count' => _n_noop( 'Draft (%s)', 'Drafts (%s)', 'text_domain' ), 'public' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'exclude_from_search' => true, ); register_post_status( 'draft', $args ); }}} The new way (using labels): {{{ $labels = array( 'name' => __( 'Draft', 'text_domain' ), 'singular_count' => __( 'Draft (%s)', 'text_domain' ), 'plural_count' => __( 'Drafts (%s)', 'text_domain' ), 'any_other_label' => __( 'Any Other Label', 'text_domain' ) ); $args = array( 'labels' => $labels, 'public' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'exclude_from_search' => true, ); register_post_status( 'draft', $args ); }}}" ramiy Tickets Needing Feedback 36492 Add `WP_Post_Status` class Posts, Post Types 3.0 normal normal enhancement reviewing dev-feedback 2016-04-12T10:30:14Z 2019-06-04T20:56:46Z "Similar to #36217 and #36224, a dedicated class for post statuses would make it easier to work with those as they are currently represented through raw objects. The global variable `$wp_post_statuses` would then hold objects of `WP_Post_Status` which would provide the benefits of autocompletion in IDEs, and we could possibly add methods to the class in the future to make post status management easier." flixos90 Tickets Needing Feedback 12726 Add get_post_by_*() functions Posts, Post Types 3.0 normal normal enhancement assigned dev-feedback 2010-03-27T05:57:13Z 2019-06-04T20:41:11Z "Current there are get_page_by_path() and get_page_by_title() function but they hardcode the post_type of 'page'. With support for new custom post types I'm finding a need for functionality to look up posts of custom post types: {{{ $args = array('post_type','my_custom_post_type'); $path = 'foo-bar'; $post = get_post_by_path($path,$args); $title = 'Foo Bar' $post = get_post_by_title($title,$args); }}} Another option would be a simple get_post_by(): {{{ $args = array('post_type','my_custom_post_type'); $path = 'foo-bar'; $post = get_post_by('path',$path,$args); $title = 'Foo Bar' $post = get_post_by('title',$title,$args); }}} This code is not hard to write but looking at the functions in post.php there's not one consistent style so I'm not sure what the best approach would be to write it. Further, I don't completely understand the significance of all the code in get_page_by_path() so wouldn't want to start with it (although I could see it being modified to use the more generic functions that I propose.) I can make these updates if I get enough direction from the core team, or I'd happily just see them get done. :) " mikeschinkel Tickets Needing Feedback 14077 Add support for removal of multiple features from a post type in remove_post_type_support Posts, Post Types 3.0 normal minor enhancement new dev-feedback 2010-06-24T18:10:59Z 2020-01-09T00:34:23Z "From [http://groups.google.com/group/wp-hackers/browse_thread/thread/1843101eba1f29fc this thread] add_post_type_support allows an array to be passed as the 2nd parameter, but remove_post_type_support doesn't. The patch attached adds the functionality." Utkarsh Tickets Needing Feedback 24572 Should be able to unlock a post outside of ajax handler Posts, Post Types normal normal enhancement new dev-feedback 2013-06-12T20:28:37Z 2019-06-04T20:44:25Z "Right now you can programmatically lock a post for editing using wp_set_post_lock, but you can't unlock it in a similar fashion. The only unlocking code is found in the ajax handler wp_ajax_wp_remove_post_lock. I've created a function wp_unset_post_lock in the style of wp_set_post_lock that unlocks a post with a given ID. I've also refactored wp_ajax_wp_remove_post_lock to use this function. The only resulting difference is that we use the current user's ID instead of the one supplied in the ajax call, but since we're unlocking the post instead of locking it, it doesn't really matter who's ID is in the meta. This change was requested by Joey Kudish of the VIP team." bbrooks Tickets Needing Feedback 12955 Add get_post filter Posts, Post Types normal normal Future Release feature request new dev-feedback 2010-04-10T13:50:07Z 2018-08-28T13:43:50Z This patch filters the return value of the get_post() function. I would find this very helpful for a plugin I'm developing. JohnLamansky Tickets with Patches 24248 'guid' not properly escaped Posts, Post Types 2.5 normal normal defect (bug) new has-patch 2013-05-02T14:03:35Z 2022-10-04T20:12:24Z "Probably related issues: #18274 #19248 'guid' being saved in database not properly escaped, example: {{{http://www.wordpress.dev/?post_type=changeset&p=57}}} , see the ampersand encode {{{&}}} It supposed to be {{{&}}} or at least {{{&}}} Once 'auto-draft' saved, 'guid' is correct: {{{http://www.wordpress.dev/?post_type=changeset&p=57}}} Once post is saved as 'draft' or published (triggered 'update post' on auto-draft), 'guid' gets malformed. Source of issue: inappropriate usage of {{{get_post_field()}}} function in the {{{wp_insert_post()}}} {{{get_post_field()}}} defaults to 'display' context, we not specify context while obtaining field, and in the {{{wp_insert_post()}}} we are not going to display it anywhere, just get, check, and save again, correct? Attached patch adds the 'raw' context to usage of {{{get_post_field()}}} with 'guid' " meloniq Tickets with Patches 13972 Add new category link - capability check needed Posts, Post Types 3.0 normal minor Future Release defect (bug) new has-patch 2010-06-18T09:01:43Z 2018-01-23T03:26:40Z "/wp-admin/link-add.php If user doesn´t have ""manage_categories"" capability, add new link page, will show ""add new category"" link and form, it should be hidden. " wjm Tickets with Patches 15784 Contributors can't easily view others' posts in a certain term Posts, Post Types 3.0 normal normal defect (bug) new has-patch 2010-12-12T11:38:39Z 2019-06-04T20:41:39Z "As a contributor, the default tab is 'Me', not 'All'. But you can go to 'All' and see a list of all posts. At that time, you can also search for posts, and filter by category, date, etc. Those all work fine. You can also filter by category or tag by clicking a term in those columns, but this doesn't work -- all_posts=1 gets removed, and you end up seeing the 'Me' tab again. You can manually append all_posts=1, but there's no way to actually filter by term viewing all posts via the UI. Interestingly, the author query var works. That'd be bad if it didn't. But it doesn't append all_posts=1, so it's done internally." nacin Tickets with Patches 24131 Fix post previews for multisite with domain mapping Posts, Post Types normal normal defect (bug) new has-patch 2013-04-18T22:51:54Z 2019-06-04T20:44:05Z Currently when previewing latest changes we create a nonce in the admin, then redirect to the front-end and check that nonce on 'init' before showing the preview. This fails sometimes on multisite with domain mapping as they may use JS redirects to log the user in on the front-end. azaozz Tickets with Patches 11697 Keep private posts in the admin area / Was: Make private posts a canonical plugin Posts, Post Types 2.9 normal normal defect (bug) assigned has-patch 2010-01-02T21:33:21Z 2021-09-08T14:44:42Z "Said Matt: > Also, a lot of the complexity of private posts could be avoided by a relatively simple change: saying they're only viewable in the dashboard. (Which I think is close to how people use them already.) ---- There are quite a few tickets related to private posts that can be viewed by users who should, and even more tickets related to private comments that can be viewed by users who aren't authorized to view the post. There also is at least one ticket that highlights a performance issue related to private posts. http://core.trac.wordpress.org/search?q=private Would it be an option to turn this into a canonical plugin and begone with the problems?" Denis-de-Bernardy Tickets with Patches 11235 "Pages whose ancestors are not all ""published"" cannot be used as parents for other pages." Posts, Post Types 2.9 normal normal Future Release defect (bug) new needs-unit-tests 2009-11-23T01:04:01Z 2019-06-04T18:12:41Z Pages with trashed parents cannot be used as parents for other pages (they do not appear on the list). caesarsgrunt Tickets with Patches 22957 get_boundary_post Only works from a single page Posts, Post Types 2.8 normal normal defect (bug) new has-patch 2012-12-16T00:36:35Z 2019-06-04T20:43:33Z "I was trying to use `get_boundary_post` in my theme to display a link to the first and last posts, but it does not work from the homepage. Unless called from a single post, `get_boundary_post` will return NULL. I can't see any reason for this behavior, or any good way around it." pathawks Tickets with Patches 10230 get_pages function: number and child_of parameters conflict Posts, Post Types 2.8 normal normal defect (bug) assigned has-patch 2009-06-21T19:26:29Z 2021-01-15T23:31:39Z "Passing both number and child_of parameters to get_pages will produce nonsensical results. Within the function number is used first to limit the number of results, then child_of is used to establish results within a certain hierarchical scope. So with a structure of: {{{ Parent 1 Parent 2 Parent 3 Child 1 Child 2 Child 3 }}} passing a number=2 and child_of=(parent 3 id) will not give the expected output. In this case, the result will first be limited to only include: {{{ Parent 1 Parent 2 }}} so the child_of will be ignored. To produce a more logical result, child_of should be evaluated first, then number should be evaluated to limit the result set." ortsaipekim Tickets with Patches 16843 wp_unique_post_slug() doesn't check pagination base when CPT has archive Posts, Post Types 3.1 normal minor defect (bug) new needs-unit-tests 2011-03-13T06:22:22Z 2019-06-04T20:41:56Z Title says it all. scribu Tickets with Patches 10219 """Older Entries"" and ""Newer Entries"" links are wrong when entries displayed in ascending order" Posts, Post Types normal normal enhancement new has-patch 2009-06-19T16:41:02Z 2019-06-04T20:40:45Z "I added ""?order=ASC"" to a tag URL I was sending out to some people, because I wanted them to view a set of blog postings in ascending chronological order, and I noticed that the ""Older Entries"" and ""Newer Entries"" links at the bottom of the page were reversed. I fixed this with the attached changes to the default theme. I don't know if this is the ""right"" fix, but it worked for me, and if it isn't quite wrong, perhaps at least it will give a more experienced WordPress developer than I an idea for how to fix it properly. " jikamens Tickets with Patches 12826 AJAX trash posts Posts, Post Types 2.9 normal normal enhancement new has-patch 2010-04-03T02:57:06Z 2019-07-05T03:15:38Z "Add AJAX to trash posts, like comment moderation. From GSoC ideas list: >Add AJAX Paging to Admin Screens. Something we've never gotten around to is adding AJAX paging to the list-type screens (edit.php, etc). Currently, getting to the next page of items means a screen refresh. For this project, add ajax paging to all the list-type screens in the WordPress admin. We have all the underlying PHP, but it needs some JavaScript love." meheranandk Tickets with Patches 20810 Add disable arg or attributes arg to wp_dropdown_categories() & wp_dropdown_pages() Posts, Post Types 2.1 normal normal enhancement new has-patch 2012-06-01T19:27:07Z 2019-06-04T20:43:12Z "It would be beneficial to be able to add disabled=""disabled"" attribute to the select tag or add multiple attributes to the select tag. Related: #20156, #20167" wpsmith Tickets with Patches 20167 Add wp_pages_checklist for creating checklist of pages on site Posts, Post Types normal normal enhancement new has-patch 2012-03-04T04:57:00Z 2019-06-04T20:42:54Z "Per conclusion of [http://core.trac.wordpress.org/ticket/20156#comment:15 ticket #20156] ""If someone does write a patch that implements wp_posts_checklist() and uses it in nav-menus.php, please open a new ticket."" The attached patch: - extends Walker with Walker_Page_Checklist - adds wp_pages_checklist() and wp_pages_checklist() functions functionality structure was modeled after wp_category_checklist and wp_dropdown_pages to keep with WP standards. If this patch is accepted my intention is to finish the request and implement it into nav-menus.php." jackreichert Tickets with Patches 25349 Can't retrieve calculated excerpt bound by on single page view Posts, Post Types 3.6.1 normal normal Future Release enhancement new has-patch 2013-09-18T05:22:53Z 2021-06-01T13:35:00Z "Submitting as Mr. Nacin suggested would be a good idea. The issue in words I understand is: when you use the_excerpt() on (for instance) a custom page template, it ignores the comment that you might have carefully placed in your content. I would expect it to honor this, since that is kind of the point of that special comment. the_content() will honor it when used on non-single-pages, but in the case of a custom page template, the_content() will of course spit out the entirely of the content. Andrew gave me this code which does the trick: https://gist.github.com/nacin/ab97d4b0e57b169d26d5 but is apparently hacky and not for public consumption. This is my lame visual of where I was running into the issue: http://glui.me/?i=5bcy8yr99pl7xel/2013-09-17_at_4.28_PM_2x.png/ Also apparently I'm not the only one who's had this come up recently: https://twitter.com/ShaneHudson/status/380105193419186176" chriscoyier Tickets with Patches 16415 Don't require CPTs to have archives in order to have feeds Posts, Post Types 3.1 normal normal enhancement new has-patch 2011-01-30T22:58:47Z 2019-06-04T20:41:47Z "When archives and feeds were added to custom post types (see #13818) it was set up so you had to have archives (has_archive) in order to have feeds (rewrite[feeds]). There are some situations where it would be nice to have feeds but archives aren't needed." aaroncampbell Tickets with Patches 20717 Filter For Requiring Post Password Posts, Post Types normal normal enhancement new has-patch 2012-05-21T03:37:43Z 2019-06-04T20:43:08Z "I've had the need to conditionally disable the password on a post based on criteria that I define in a plugin. In order to do this, I added a filter in the post_password_required() function in wp-includes/post-template.php. This is helpful to allow search engines to crawl password protected pages or allow certain users to view the page without typing in the password. It would be great if this could get included in the core. Thanks for your time." BrandonGodwin Tickets with Patches 16784 Introduce post_type_archive_description() Posts, Post Types 3.1 normal normal enhancement new needs-unit-tests 2011-03-07T10:36:40Z 2021-04-24T16:12:27Z "if using the standard archive.php page, the common function for getting archive page name (e.g. single_tag_title) or description (e.g. tag_description) do not work - the best now is to use get_queried_object()->name resp. get_queried_object()->description Also it is not obvious, that when you create a custom post type and taxonomy (with public=true) they are not visible on menu navigation page - you must make them visible using the top View menu (it took me a while to realize it) " thomask Tickets with Patches 18400 "Suggested label change for ""Stick this post to the front page""" Posts, Post Types normal normal Future Release enhancement new dev-feedback 2011-08-14T01:19:53Z 2020-02-06T19:45:40Z "In the Publish meta box, it would be more clear to say ""Stick this post to the top of the front page"" compared to saying ""Stick this post to the front page""." designsimply Tickets with Patches 18613 get_adjacent_post() doesn't find private posts Posts, Post Types normal normal enhancement new has-patch 2011-09-07T15:52:25Z 2019-06-04T20:42:17Z The status is always 'publish'. scribu Tickets with Patches 12706 Custom post status bugs Posts, Post Types 3.0 normal normal Future Release task (blessed) reopened needs-unit-tests 2010-03-25T14:41:39Z 2022-06-02T13:42:36Z "A developer should be able to register a custom post status using `register_post_status()`. The admin UI (including post submit box and quick edit) should reflect this new custom post status. Furthermore, there are many hard-coded references to 'draft' and 'pending' statuses in core that should properly use the post status API. All existing arguments to `register_post_status()` should be fully implemented, should also support per-post-type arguments. As things get implemented across core, there will likely be a need for supporting capabilities and bits of API. Related: #23169 (register_post_status_for_object_type), #23168 (unregister_post_status)." ptahdunbar Unpatched Bugs 13926 Adding 'page-attributes' to a custom post type slows down edit screen in the admin Posts, Post Types 3.0 normal normal defect (bug) new 2010-06-16T20:01:17Z 2019-06-04T20:41:18Z "When I add 'page-attributes' to a custom post type it takes roughly 1.5 to 2 min for the edit screen to load... When I remove 'page-attributes' edit screen load is extremely fast. Under the post type i created I have 5000+ entries." granulr Unpatched Bugs 16600 AdminMenu rendering code chokes on uppercase Posts, Post Types 3.1 normal minor defect (bug) reopened 2011-02-20T02:43:25Z 2019-06-04T20:41:50Z "When registering custom taxonomies for a custom post type, if the post type name contains uppercase letters, the menu items for the custom taxonomies are not shown. It looks like the post type name is lowercased in some parts of the core code (but no all) and so string comparisons fail. Just isolated this behaviour, so I'm still not sure how much of the core this affects. Moreover, when I saved posts with the intended mixed-case name, they have been saved to the DB with lowercased post_type It it is indeed the intended behaviour, a note should be added to the Codex: ""Custom Post Type names must be lowercase"" The attached sample (real) code reproduces the problem by setting ""post_type_tag"" to ""DomainName"" instead of ""domain_name"". Numbers work properly, however. Tested with latest SVN (RC4 + r17467)" jltallon Unpatched Bugs 22022 Can’t properly add pages of type edit.php?post_type=xxx as submenu items to arbitrary parent menus Posts, Post Types 3.0 normal normal defect (bug) new 2012-09-27T20:22:43Z 2019-06-04T20:43:26Z "The following code illustrates the problem. {{{ add_menu_page('My Pages', 'My Pages', 'edit_posts', 'parentslug', array(class, func)); add_submenu_page('parentslug', 'Settings', 'Settings', 'edit_posts', 'mysettings', array(class, func)); add_submenu_page('parentslug', 'Custom Post Type', 'Custom Post Type', 'edit_posts', 'edit.php?post_type=xxx'); }}} When you click on the first submenu item, the menu stays open, displaying the submenu items as it should. When you click on the item for the custom post type, the parent menu is closed and submenu pages are not displayed. The root of the problem is how $parent_page is handled for pages of type edit.php?post_type=xxx. In get_admin_page_parent(), $parent_file is always set to $submenu[$parent], which may cause the submenu slug to be different from $parent_file. But in _wp_menu_output, if the submenu slug and parent slug are not equal, the 'wp-has-current-submenu wp-menu-open' classes do not get added which means the menu gets displayed as being closed. Since there are no actions called between get_admin_parent_page() and the output of the menu, the only workaround I can see is some ugly JS that fixes up the classes. It seems like the least intrusive fix would be to just move the call to apply_filters(""parent_file) in menu-header.php to after the call to get_admin_page_parent() so that $parent_file can truly be overridden. This also seems inline with the intent of the filter. " jjharr Unpatched Bugs 19031 Category view incorrectly counting custom posts Posts, Post Types 3.2 normal normal defect (bug) new 2011-10-24T02:40:31Z 2019-06-04T20:42:32Z "If you define a custom post-type something like this: {{{ Array ( [taxonomies] => Array ( [0] => category [1] => post_tag ) [label] => Book [rewrite_slug] => [query_var] => [public] => [show_ui] => 1 [show_in_nav_menus] => 1 [publicly_queryable] => [exclude_from_search] => 1 ) }}} Even if the post-type is NOT public or NOT publicly_queriable (see above), the counts of the posts in each category still shows, totally ignoring the settings of the post-type. == Expected Output == I would expect the count to be related to the results displayed. If there are no visible results for that category (i.e. the user can't see them due to public settings), I would expect the count to go to zero. == Actual Output == The count of posts in the given category seems to have nothing to do with the visible results. This is related to this bug: #18950" fireproofsocks Unpatched Bugs 25798 Certain single CPT items result in 404 since 3.7 Posts, Post Types 3.7 normal normal defect (bug) new needs-unit-tests 2013-11-01T14:58:10Z 2019-06-04T20:45:08Z "Related: #25749 The changes in [25182] to the query_var mapping of hierarchical post types have broken single permalinks in some cases, when Permalink setting is set to ""Post name"". To reproduce: 1. Register a post type as follows: {{{ register_post_type( 'bbg_test', array( // ... 'hierarchical' => true, 'public' => true, 'rewrite' => true, // any value other than false 'query_var' => false, // ... ) ); }}} 2. Set permalink settings to ""Post name"" (and flush) 3. Create a new post of the type above, and attempt to visit at the url `http://example.com/bbg_test/foo` (or whatever). Result: 404. 4. Change to any other permalink setting. Result: page loads as expected. Cause: When the CPT is registered with `'rewrite'` other than `false`, it passes the test at http://core.trac.wordpress.org/browser/tags/3.7/src/wp-includes/post.php#L1275. When it's hierarchical, it passes the test at line 1293. When, because `'query_var'` is set to `false`, the rewrite tag set on line 1294 is of the form 'post_type=bbg_test&pagename=foo' (instead of 'bbg_test=foo'). Then, when an item is loaded, during `WP::parse_request()`, it passes the `preg_match()` test here http://core.trac.wordpress.org/browser/tags/3.7/src/wp-includes/class-wp.php#L198, but a page (ie, an item with `post_type` 'page') is not found by `get_page_by_path()`, and as a result the correct rewrite rule is not matched. As noted, this is a regression in 3.7 [25182], before which `preg_match( '/pagename=\$matches...` wouldn't have matched. Obviously it's an edge case that (a) a post type is hierarchical AND has query_var set to false, and also (b) permalinks are set to ""Post name"", but it is a change in behavior that broke one of my plugins, and has been a bit of a bear to track down :) I'm going to set `query_var` to true for my purposes (no harm done on my end) but that may not be possible for others." boonebgorges Unpatched Bugs 18395 Non-URL GUIDs are stripped on post update Posts, Post Types 3.2.1 normal normal defect (bug) new 2011-08-13T18:31:48Z 2019-06-04T20:42:09Z "The post guid is run through several filters before the post is saved. the esc_url_raw() call will end up setting a GUID to an empty string if the GUID does not begin with a known/accepted protocol. If a plugin/etc. wants to use the GUID column to store an external ID for an item brought in from another system (say a Flickr photo ID), then updating a post that has the Flickr ID as its GUID through the WP admin will end up setting the GUID for that post to ''. This would need to be changed if the move was made to UUIDs for GUID values as well. Related: #6492. A very basic patch for this specific issue is attached, but a larger discussion around how this should work is likely needed. Related: #18315" alexkingorg Unpatched Bugs 21234 Recursive directory creation & get_calendar() for custom post types Posts, Post Types 3.4.1 normal normal defect (bug) new 2012-07-12T12:31:28Z 2019-06-04T20:43:17Z "Hello! I made two patches, and sent the pull request on githab. https://github.com/WordPress/WordPress/pull/12 https://github.com/WordPress/WordPress/pull/14 And I want to join to contributers team. How can I do it? Irc chanel is Terminated :(" avaddon Unpatched Bugs 22003 Saving custom fields goes to post-new.php rather than post.php Posts, Post Types 2.5 normal normal defect (bug) reopened 2012-09-26T15:57:01Z 2019-08-09T00:46:50Z "Create a new post or page. Add a title and message. Add a custom field (click ""Add Custom Field"") The post is saved, but as you are taken to post-new.php rather than post.php, it looks as if your post has disappeared! All is well - it is actually saved - but it's confusing. Tested on 3.5-alpha-21989" curiousdannii Unpatched Bugs 15993 Sort arrows improperly wrap on narrow columns Posts, Post Types 3.1 normal normal defect (bug) reopened 2010-12-27T06:14:21Z 2019-06-04T20:41:43Z Specifically, I noticed the 'Posts' column on a taxonomy screen (or 'Links' for link categories, etc). nacin Unpatched Bugs 11311 kses converts ampersands to & in post titles, post content, and more Posts, Post Types 2.9 normal normal Future Release defect (bug) new 2009-12-03T01:49:32Z 2022-08-03T15:41:48Z "Make a test user that has the ""author"" role (i.e. no `unfiltered_html`) and write a post with a title that has `&` in it. After saving, it will becomes `&` due to `wp_filter_kses()`. It gets saved in the database this way too. It's confusing to the user." Viper007Bond Unpatched Bugs 25113 non-latin CPT rewrite slugs fail `wp_safe_redirect` Posts, Post Types 3.6 normal normal defect (bug) new 2013-08-21T20:37:36Z 2019-06-04T20:44:40Z "If you localize your custom post type rewrite slugs in non-latin language and pass it to `wp_safe_redirect` it will strip all non-latin characters and attempt to redirect to stripped location. This can be easely reproduced if your custom post type supports comments and you submit a comment from post type single page as `wp_safe_redirect` is called after comment submission." entr Unpatched Enhancements 30250 Add filter for query used in `wp_count_posts()` Posts, Post Types normal normal enhancement assigned 2014-11-04T18:04:59Z 2019-06-04T20:47:58Z "Use case: if my list table is filtering to a specific taxonomy term, I'd like my view counts to reflect that filter. The existing filter added in #16603 still means I need a lot of duplicate code, and two queries." danielbachhuber Unpatched Enhancements 20748 Include CPT Posts in Author Count & Archive Page Posts, Post Types normal normal enhancement new 2012-05-25T17:59:48Z 2019-06-04T20:43:09Z "For whatever reason, the default behavior is to only count the number of 'post' that an author has published. With the advent of custom post types, they should be included as well if the CPT has the 'author' capability. Currently, the author archive can include CPTs if you manually alter the query - this should be enabled by default if authorship is allowed." iridox Unpatched Enhancements 23169 Introduce register_post_status_for_object_type Posts, Post Types normal normal enhancement new 2013-01-10T08:35:46Z 2019-06-04T20:43:41Z Similar to what `register_taxonomy_for_object_type` does with taxonomies. kovshenin Unpatched Enhancements 23168 Introduce remove_post_status Posts, Post Types normal normal enhancement new 2013-01-10T08:32:49Z 2019-06-04T20:43:39Z Plugins and themes should be able to remove the default post statuses defined by core. kovshenin Unpatched Enhancements 15930 Make trashed posts/pages still readable Posts, Post Types 2.9 normal minor enhancement new 2010-12-21T10:32:30Z 2019-06-04T20:41:42Z "I hoped I was able to see the pages which I delete (in the trashbin) but the all stay dark... So I can't view them! I think it would be a good feature to see them to see if somebody didn't delete the wrong page! Or when you need something form a deleted page that you can still get it without restoring it first" JonezJeA Unpatched Enhancements 22845 On 32-bit systems, with post IDs higher than PHP_INT_MAX (2147483647) wordpress does not run fine Posts, Post Types 3.4.2 normal normal enhancement assigned 2012-12-10T09:13:01Z 2019-06-04T20:43:30Z "Logging all the MySQL queries I discovered that the queries that should pick my posts were all doing something like this: SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647) This 2147483647 number clearly has something in it: it's the PHP_INT_MAX value on 32-bit operating systems, while on 64-bit machines it's 9223372036854775807 http://php.net/manual/en/language.types.integer.php So, the problem is divided in 2 parts: I run on a 32 bit system, and I have my IDs a bit too high. I know that 2147483647 is a bit high for a post ID, but I discovered this the hard way. Now, I would have preferred an error message in the administrator interface. Do you think it's a good idea?" copesc Unpatched Enhancements 7745 Private posts cannot have unpublished or pending review status Posts, Post Types 2.6.1 low minor Future Release enhancement new 2008-09-15T16:32:19Z 2019-03-15T00:32:37Z "Posts with private ticked are immediately set to published, and cannot be reverted to unpublished or pending review while private is ticked. Given the default use of private posts, this behavior is understandable, but it seems far simpler if the behavior remained consistent with public posts. In our particular case, we are using Role Manager to allow subscribers to read private posts. A simple solution that suits our particular needs well. But we really need the full draft/review process, just as with public posts." nyoungman Unpatched Enhancements 12567 make post_submit_meta_box more generic Posts, Post Types normal normal enhancement new 2010-03-10T00:46:20Z 2019-06-04T20:41:05Z "Currently there isn't a way to modify the meta boxes which set the post status. The function post_submit_meta_box in wp-admin/includes/meta-boxes.php is a closed function with post statuses hard coded. A new post status registered using register_post_status is available to the query object and plugins but cannot be added to the post status select box in the publish meta box. A lot of the post_submit_meta_box is hardcoded to the default post status types. Consider the use case where you want posts to only be visible to logged in users. A custom post status selectable by the user in add/edit post could be used which is then added or excluded in the query (filtered by posts_where) depending on whether the user is logged in or not. This way core can handle the non-visible posts the way private or future posts are handled. " themattharris Unpatched Enhancements 19572 switch_to_post() stack implementation (similar to switch_to_blog()) Posts, Post Types 3.3 normal normal enhancement new 2011-12-15T21:54:57Z 2019-06-04T20:42:36Z "One of the challenges themes and plugins have is the balance between utilizing the core APIs that rely on global variables, while leaving things in a ""clean"" state for the next worker in the chain. For example, I might have a shortcode that pulls content from another post, outputs a title or some other data, then needs to restore the previous post environment. The attached patch provides APIs for doing just this - using the same stack approach that switch_to_blog() takes in a multi-site instance. To set up a post context, call: switch_to_post($post_id); This can be called multiple times, diving deeper into the stack. Then each process is responsible for restoring the $post context by calling: restore_post(); This goes back to the stack, bumps out the current post and restores the previous post's context. There is some test code for demonstration here: https://gist.github.com/1309915" alexkingorg Unpatched Enhancements 14561 wp-admin/edit.php tags of post are hard to compare Posts, Post Types normal normal enhancement new 2010-08-08T08:25:02Z 2019-06-04T20:41:26Z "To get an overview about tags used between articles on the post listing in the admin is hard to achieve by the user because they appear not to be ordered. A solution could be to sort them alphabetically. That done, it's easier for the user to compare the usage of tag distribution accross the listing." hakre Unpatched Enhancements 14375 Post pagination should have a show all option Posts, Post Types 3.0 normal normal Future Release feature request reopened 2010-07-21T07:03:29Z 2017-06-12T05:22:35Z When people use the nextpage html comment tag to paginate posts we should also have a show all link displayed to make it easier for people to read the whole content without pagination. westi Unpatched Enhancements 14513 Time for a wp_post_relationships table? Posts, Post Types 3.0.1 normal normal feature request reopened 2010-08-03T00:10:30Z 2023-05-30T15:04:16Z "Now that we have custom post types the obvious next step for people using them is to start relating post types using parent-child and/or many-to-many relationships. I've implemented a taxonomy-mirrored-posts plugin but am starting to discover [http://lists.automattic.com/pipermail/wp-hackers/2010-July/033510.html many of the problems that @prettyboymp has pointed out on wp-hackers] and think it might be time we consider adding a new table to allow us to relate post and to allow us to build functionality around this table such as related post pickers, etc. I'd like to offer a [http://en.wikipedia.org/wiki/Straw_man_proposal straw man proposal] to start discussions of a potential `wp_post_relationships` table added to WordPress 3.1 with three fields: `parent_id`, `post_id` and `term_taxonomy_id.` This allows us to relate any two post records and optionally associate at taxonomy+term to classify the relationship (here's the SQL to create the table): {{{ CREATE TABLE `wp_post_relationships` ( `parent_id` bigint(20) unsigned NOT NULL, `post_id` bigint(20) unsigned NOT NULL, `term_taxonomy_id` bigint(20) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`parent_id`,`post_id`,`term_taxonomy_id`), KEY `term_taxonomy_id` (`term_taxonomy_id`), KEY `post_id` (`post_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; }}} Looking forward to your feedback." mikeschinkel Candidates for Closure 48013 Can't make a new post < default> Posts, Post Types normal normal Awaiting Review defect (bug) assigned reporter-feedback 2019-09-10T22:41:31Z 2019-10-08T19:22:07Z "{{{ TypeError: Cannot read property 'show_ui' of undefined at https://tjinews.xyz/wp-includes/js/dist/editor.min.js?ver=9.2.6:17:119556 at i (https://tjinews.xyz/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.11:6:91) at An.filter (https://tjinews.xyz/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.11:99:338) at https://tjinews.xyz/wp-includes/js/dist/editor.min.js?ver=9.2.6:17:119521 at Td (https://tjinews.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:82:11) at hi (https://tjinews.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:102:385) at Qg (https://tjinews.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:144:217) at Rg (https://tjinews.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:145:76) at Sc (https://tjinews.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:158:109) at Z (https://tjinews.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.8.4:156:492) }}}" tjinews Tickets with Patches 3670 Removing CDATA close tag ( ]]> ) unbalances the CDATA block andy Posts, Post Types 2.1 normal minor Future Release defect (bug) new needs-unit-tests 2007-01-25T05:55:47Z 2023-02-10T03:00:14Z "I'm not sure if this is a bug per se, but it breaks included JS in my posts that are escaped with a CDATA section. I've basically commented out the following line in the_content() every time I upgrade: //$content = str_replace(']]>', ']]>', $content); A user on the wp-testers list indicated that this was part of making sure that included CDATA blocks didn't break RSS feeds. I don't use CDATA sections directly in my RSS feeds, so I haven't tested this. In my particular case, the JS is used to embed Flash movies (e.g. YouTube videos) in an XHTML compliant way (without embed tags). I have a custom plugin I've written that strips out the JS and replaces it with the embed tag in the RSS feed. Perhaps we should use a flag to activate this when the app is going through a feed. Ideally, though, it would simply be removed. Odds are that the CDATA block is being used for a JS block in a post body, and since most RSS aggregators don't allow JS by default, it would be safe to simply remove CDATA blogs if is_feed() is set." scenic Tickets Awaiting Review 54920 Problem with blog posts updating to WordPress 5.9 audrasjb Posts, Post Types 5.9 normal normal Awaiting Review defect (bug) reviewing 2022-01-26T12:54:59Z 2022-02-01T13:53:40Z Posts preview view are showing the same text for all of them order by categories. Titles and images are ok. jorgemartineznb Tickets with Patches 37043 New filter `pre_unique_post_slug` boonebgorges Posts, Post Types normal normal enhancement reviewing has-patch 2016-06-07T07:42:35Z 2019-06-04T21:00:08Z "This filter will be for multilanguages plugins helpful. For example I have page: News in English with url http://example.com/en/news/ and News in Polish with url http://example.com/pl/news/ For Polish version this will be have slug news-2 but should be have news. If new filter will be added then we can generate slug for my pages. I know that I can use wp_unique_post_slug filter but more optimally will be add pre_unique_post_slug filter because will be less SQL Queries because this code: {{{#!php posts WHERE post_name = %s AND post_type IN ( %s, 'attachment' ) AND ID != %d AND post_parent = %d LIMIT 1""; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID, $post_parent ) ); /** * Filters whether the post slug would make a bad hierarchical post slug. * * @since 3.1.0 * * @param bool $bad_slug Whether the post slug would be bad in a hierarchical post context. * @param string $slug The post slug. * @param string $post_type Post type. * @param int $post_parent Post parent ID. */ if ( $post_name_check || in_array( $slug, $feeds ) || 'embed' === $slug || preg_match( ""@^($wp_rewrite->pagination_base)?\d+$@"", $slug ) || apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ) ) { $suffix = 2; do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . ""-$suffix""; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID, $post_parent ) ); $suffix++; } while ( $post_name_check ); $slug = $alt_post_name; } } else { // Post slugs must be unique across all posts. $check_sql = ""SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1""; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) ); // Prevent new post slugs that could result in URLs that conflict with date archives. $post = get_post( $post_ID ); $conflicts_with_date_archive = false; if ( 'post' === $post_type && ( ! $post || $post->post_name !== $slug ) && preg_match( '/^[0-9]+$/', $slug ) && $slug_num = intval( $slug ) ) { $permastructs = array_values( array_filter( explode( '/', get_option( 'permalink_structure' ) ) ) ); $postname_index = array_search( '%postname%', $permastructs ); /* * Potential date clashes are as follows: * * - Any integer in the first permastruct position could be a year. * - An integer between 1 and 12 that follows 'year' conflicts with 'monthnum'. * - An integer between 1 and 31 that follows 'monthnum' conflicts with 'day'. */ if ( 0 === $postname_index || ( $postname_index && '%year%' === $permastructs[ $postname_index - 1 ] && 13 > $slug_num ) || ( $postname_index && '%monthnum%' === $permastructs[ $postname_index - 1 ] && 32 > $slug_num ) ) { $conflicts_with_date_archive = true; } } /** * Filters whether the post slug would be bad as a flat slug. * * @since 3.1.0 * * @param bool $bad_slug Whether the post slug would be bad as a flat slug. * @param string $slug The post slug. * @param string $post_type Post type. */ if ( $post_name_check || in_array( $slug, $feeds ) || 'embed' === $slug || $conflicts_with_date_archive || apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ) ) { $suffix = 2; do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . ""-$suffix""; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID ) ); $suffix++; } while ( $post_name_check ); $slug = $alt_post_name; } } }}} Will useless for my plugin and unnecessary SQL Queries will be generate" sebastian.pisula Tickets Awaiting Review 30188 Introduce utility functions to check constants chriscct7 Posts, Post Types normal normal Awaiting Review enhancement assigned dev-feedback 2014-10-29T23:31:14Z 2017-09-22T10:40:31Z "At the moment it's pretty obnoxious to check the various DOING_* constants throughout core and within plugins and elsewhere. The annoyance is compounded whenever we need to verify multiple constants, for example on the save_post hook: {{{#!php function do_some_post_stuff_the_current_way() { // Bail if doing autosave if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Bail if doing AJAX if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { return; } // Bail if running cron if ( defined( 'DOING_CRON' ) && DOING_CRON ) { return; } // Maybe some other checks... // Do my stuff.. } add_action( 'save_post', 'do_some_post_stuff_the_current_way' ); }}} I initially set out to solve this problem exclusively for saving posts, but became waylaid just in naming such a function (What are we checking exactly? The environment state/context? The mechanism that triggered save_post? etc). I spent the whole day thinking about it and realized the solution reaches beyond just saving post. Enter `wp_check_constants()` and `is_constant_true()`. The former accepts a single or array of constants, the latter only validates one. In these we confirm first that the constant is defined and then that it is explicitly set to `true`. Full stop. I've written a few different tests to support that the function works as advertised. If the general consensus here is that these functions are useful I'd also be happy to submit patches that introduce them throughout core in place of the current `defined( 'FOO' ) && FOO` conditions. Related: #25669 " rzen Tickets Needing Feedback 27253 Enhancement Request: direct link to Drafts under Posts and Pages on the sidebar chriscct7 Posts, Post Types 3.8.1 normal normal enhancement assigned 2014-03-02T04:32:36Z 2019-06-04T20:45:53Z "It would be awesome if there were a link under posts and pages to get directly to Drafts. So, for example the sidebar would have: {{{ Pages All Pages Drafts Add New }}}" imanilea Tickets Needing Feedback 19711 Posts edit list window display no information about filtering chriscct7 Posts, Post Types normal normal enhancement assigned has-patch 2012-01-02T16:39:30Z 2019-06-04T20:42:39Z "The ""All Posts"" page lists the available posts. It can filtered by authors or terms, for example by clicking on a category name or the author name next to a post. The URL will change to apply the filtering, but there's no other visual indication of the filtering, nor a link to quickly disable filtering. This can lead to confusion when users are accessing filtered lists directly or via links in other part of the dashboard. " yoavf Tickets with Patches 24722 get_post_statuses() and get_page_statuses() are hardcoded chriscct7 Posts, Post Types normal normal defect (bug) assigned has-patch 2013-07-10T10:46:10Z 2019-06-04T20:44:28Z "Despite the support for registering custom post/page statuses in core, both `get_post_statuses()` and `get_page_statuses()` are hardcoded. Both of these functions are only used in the XML-RPC API in core, however this may affect plugins. (Somewhat related to the editorial-flow component, although that's on hiatus at the moment.)" rmccue Tickets Needing Feedback 17374 get_pages() with child_of forgets sort DrewAPicture Posts, Post Types 3.1.2 normal normal defect (bug) assigned dev-feedback 2011-05-11T10:06:17Z 2023-04-18T12:45:36Z "If you call {{{get_pages()}}} with both the {{{child_of}}} and {{{sort_column}}}, the sorting is not applied. {{{child_of}}} makes it select all pages (sorted) and later applies a subselect via {{{get_page_children()}}}. This subselect can mess up the sort order. An example was reported on http://wordpress.stackexchange.com/questions/16921/get-pages-not-ordering-as-it-should Related: #12821" janfabry Unpatched Bugs 18701 """hierarchical"" argument for get_pages() does nothing" DrewAPicture* Posts, Post Types 3.0 normal normal defect (bug) accepted 2011-09-19T06:48:32Z 2019-06-04T20:42:19Z "The `hierarchical` argument for `get_pages()` is never actually used. It is in an `if` statement, but one that requires `child_of` to also be set: {{{ if ( $child_of || $hierarchical ) $pages = & get_page_children($child_of, $pages); }}} Props Vynce Montgomery for pointing this out to me." Viper007Bond Tickets with Patches 50877 Always sanitize post types' and taxonomies' rewrite arguments flixos90 Posts, Post Types normal normal Future Release defect (bug) assigned has-patch 2020-08-07T21:42:39Z 2020-08-19T03:41:57Z "When registering a post type or taxonomy, currently the `$rewrite` argument / property is only sanitized if pretty permalinks are enabled. While this condition makes sense for whether to add the actual rewrite rules, sanitization itself should not depend on this external factor. Right now, effectively the `$rewrite` property will be invalid for post types and taxonomies when pretty permalinks are not enabled. When changing the permalink structure during a request (e.g. relevant in tests), this may result in PHP warnings, since the `$rewrite` property is expected to be an array, but due to lack of sanitization could still be e.g. a boolean `true`. Sanitization of rewrite arguments should always happen for post types and taxonomies to ensure integrity of the property." flixos90 Unpatched Enhancements 50921 Consider adding title attributes for metabox order buttons joedolson* Posts, Post Types 5.5 normal normal Future Release enhancement accepted 2020-08-12T04:48:33Z 2021-05-26T09:02:02Z It's obvious but I feel the title attribute for new metabox indicators will be helpful for some users to know what will these indicator buttons do by browser's tooltip. ibachal Tickets with Patches 47642 Order by comment count - posts list tables johnbillion Posts, Post Types normal normal Future Release defect (bug) reviewing has-patch 2019-07-02T23:20:20Z 2023-07-18T16:21:07Z "Results from posts list tables with enabled ordering by comment count are mixed (posts are missing and aren't unique). Pagination required. Links: wp-admin/edit.php?orderby=comment_count&order=asc wp-admin/edit.php?orderby=comment_count&order=asc&paged=2 No matter which post type. You need to set 'Number of items per page' in screen options in order to get a pagination. [[Image(https://i.imgur.com/HupwtnS.png)]] Set sorting by comment count in comments column. [[Image(https://i.imgur.com/zFDU7Oj.png)]] In lists of posts some of them are missing. Page number 1 and number 2 don't have unique posts. I was testing it for some cases: 30+ posts and 'posts_per_page' = 20 30+ posts and 'posts_per_page' = 10 250+ posts and 'posts_per_page' = 20 24 pages and 'posts_per_page' = 20 Results in all cases were wrong. The official queries are from wp-includes/class-wp-query.php (line: 2984) [https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-query.php#L2984], variable: $this->request. Below applied filter are generated ids for current posts. [[Image(https://i.imgur.com/tWevfpW.png)]] SQL queries from debugging (official queries): **Page number 1 (paged=1):** {{{ SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') ORDER BY wp_posts.comment_count ASC LIMIT 0, 20 }}} Result: [[Image(https://i.imgur.com/rFyTHjE.png)]] **Page number 1 (paged=2):** {{{ SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') ORDER BY wp_posts.comment_count ASC LIMIT 20, 20 }}} Result: [[Image(https://i.imgur.com/THMM1Ri.png)]] What's funny if I added **'wp_posts.post_title'** to query the problem is solved (unique posts): [[Image(https://i.imgur.com/nxn3tCy.png)]] [[Image(https://i.imgur.com/whvDFaI.png)]] I think that problem is actually in the database queries/ settings what's caused the bad output in admin's panel. For other sorting like title or date this problem doesn't occur. " alektabor Tickets with Patches 42936 get_adjacent_post won't find any posts that are published in the same minute johnbillion Posts, Post Types 4.9.1 normal normal Future Release defect (bug) assigned close 2017-12-19T10:34:26Z 2021-11-14T17:03:28Z "`get_adjacent_post` won't find any posts that are posted in the same minute, even if they are technically posted before or after the other post. This sounds silly but if you use a '''clone''' function to create multiple posts for a website, then you you can't navigate them using links created with `get_previous_post` or `get_next_post`." sheepysheep60 Tickets Awaiting Review 49428 Extend get_the_post_pagination() to consider total argument luludak Posts, Post Types normal minor Awaiting Review enhancement assigned 2020-02-13T16:57:34Z 2020-02-13T16:57:34Z "Right now, the usage of the_posts_pagination() is associated directly with the Global query. By investigating its code in [https://developer.wordpress.org/reference/functions/the_posts_pagination/ documentation], I noticed that, it practically retrieves the pagination arguments expected by {{{paginate_links($args)}}}, but it checks on global query ({{{$GLOBALS['wp_query']}}}) for the maximum number of pages. However, one of the arguments of {{{paginate_links($args)}}} is {{{total}}}, which, by documentation is: ""The total amount of pages. Default is the value WP_Query's max_num_pages or 1."". Since this exists as argument, my question is, why don't we check for the {{{total}}} in {{{get_the_posts_pagination()}}}? That way, we can allow its usage on custom queries (they can propagate the number of pages in the {{{total}}} argument), not using the global query at all - as this check can block the use of {{{total}}} as argument. This fix can be made by changing this code in **link-template.php**: {{{if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {}}}} into: {{{if ( (! empty( $args['total'] ) && $args['total'] > 1 ) || $GLOBALS['wp_query']->max_num_pages > 1 ) {}}} Note I did not remove the previous check on global query, to ensure backwards compatibility - {{{paginate_links($args)}}} uses global query to retrieve default arguments - so this part of code is useful. I also check for emptiness and then checking for the argument check in order to apply partial evaluation. Please note I am adding this ticket for further discussion - since I am new to the community. If this is considered of value, I will be happy to work on the patch. " luludak Unpatched Bugs 24867 Feeds for custom posts type can not be set independently of has_archive and supports => comments nacin Posts, Post Types 3.8 normal normal defect (bug) assigned 2013-07-29T00:12:27Z 2019-06-04T20:44:35Z "I was testing the patch for ticket (Feeds or Feed - add_permastruct missunderstanding: #23302) and discovered a few things (I'm using trunk rev 19712). Turning of feeds for custom post types only works if supports feeds & has_archive are set to either false or true. If you, e.g. set the argument feeds in rewrite to true and has_archive to false then the rewrite rules for feeds do not get created (some happens of you switch true & false around in both arguments). This happens due to this condition in /wp-includes/post.php, line 1242: {{{ if ( ! isset( $args->rewrite['feeds'] ) OR ! $args->has_archive ) $args->rewrite['feeds'] = (bool) $args->has_archive; }}} Another problem I run into is that: With the patch for ticket (#23302) you can not enable/disable the comments feed independent of the main feed of the custom post type. It also does not get disabled if you do not enabled comments via supports. Rewrite rules for feeds seem to always get created. I've attached an example to showcase what I wrote above." marcosf Tickets Needing Feedback 14017 "New template ""tag"": get_custom_field()" obenland Posts, Post Types 3.0 normal normal Future Release enhancement assigned needs-unit-tests 2010-06-21T04:13:03Z 2022-08-14T14:59:34Z "It would be helpful to have a way to retrieve a custom field value that is somewhat agnostic of current context. '''Current way to do this''' In the header (i.e., before the Loop), one has to access the currently-queried object to get a custom value, with something like this: `$value = get_post_meta($GLOBALS['wp_query']->get_queried_object_id(), 'field', true);` In the Loop: `$value = get_post_meta(get_the_ID(), 'field', true);` And, lots of tutorials out there tell people to do things like the following, with varying degrees of success (depending on variable scope): `$value = get_post_meta($id, 'field', true);` or `$value = get_post_meta($post->ID, 'field', true);` '''My proposed function (or ""template tag"")''' mixed '''get_custom_field''' ( string ''$fieldname'' [, int ''$post_id'' ] ) `$value = get_custom_field('field');` It picks the current object like so: {{{ Passed post object ID? / \ yes no | | use it | | within Loop? / \ yes no | | use current | Loop ID | | currently queried object is singular? / \ yes no | | use its ID ID = 0 }}}" filosofo Tickets Needing Feedback 31977 "Ping status of pages changes to ""closed"" in quick edit" pareshradadiya Posts, Post Types 4.2 normal normal Future Release defect (bug) assigned dev-feedback 2015-04-15T11:14:50Z 2022-10-14T17:26:39Z "WP version: 4.2-beta4 Every page is created with ping_status set to ""open"". If the page is edited in the ""full"" edit form, the ping_status remains untouched. However, if the page is edited in the quick edit form, the ping_status field is changed to ""closed"" since WP 4.2. Since pages don't support the ping functionality, I suppose it shouldn't change the field. Maybe ""closed"" is the propper one, but it should be set on the creation. It makes testing of our plugin a little bit tricky. Thanks. Jan" JanVoracek Unpatched Bugs 11381 display_page_row() generates boat loads of needless queries pbearne Posts, Post Types normal normal defect (bug) assigned 2009-12-10T12:41:45Z 2024-02-22T22:43:04Z "on sites with many static pages that are spread across multiple parents, display_page_row() triggers multitudes of calls to the db. specifically, it's repeatedly calling get_pending_comments_num(). it's also calling get_editable_user_ids() and wp_dropdown_users(), both of which do not seem to cache their results in case they're used several times on the same page." Denis-de-Bernardy Tickets with Patches 19958 "Allow custom post types as ""home"" and get_posts() to return results for more than one post type" pbearne* Posts, Post Types 3.3.1 normal normal Future Release enhancement accepted has-patch 2012-02-04T00:59:13Z 2023-11-10T16:27:20Z "In {{{ Wordpress admin > Settings > Reading }}} there is an option to define what the home page or the front page should be {{{ Front page displays }}} Radio button {{{ A static page (select below) }}} is followed by a dropdown containing a list of all pages. I would request that custom page types be allowed in this dropdown. This way, I could make my bbPress forums or my All-in-one event calendar, etc my homepage. " sooskriszta Tickets with Patches 19826 Error behavior for deleting trashed posts is different for Bulk Delete versus Empty Trash piontkowski Posts, Post Types 3.1.2 normal minor Future Release defect (bug) assigned has-patch 2012-01-13T18:38:00Z 2018-06-06T23:11:56Z "Bug testing a custom blog build, but I may have located a bug with core (wp-die) Trash error messages. Background: *The blog has different users, with different roles. *Issue occurs on trash page of a custom post type (post status = trash .../edit.php?post_status=trash&post_type=subject) *Trash contains posts by both an admin role (who can add/edit/delete all custom posts) and an author role (who can add/edit/delete his/her own posts). *Logged in as an author. *Using Capability Manager Plug-in. (Tested bug without plugin too) *Issue is specific to behavior after normal WP-error is thrown. Issue: Same WP error. Two different behaviors. Different functionality occurs between using the Bulk Actions (Delete Permanently) > ""Apply"" button and the ""Empty Trash"" button, after a normal WP error is thrown. In the first case (Bulk Actions > Apply [1a below]), after I return from the error page and refresh the Trash page, all of the selected author pages have been deleted. No admin pages have been deleted. In the second case (""Empty Trash"" [1b below]), after I return from the error page and refresh the Trash page, all of the selected author pages have NOT been deleted. No admin pages have been deleted. Behavior: 1a. When I am logged in as an author and I highlight posts by both author and admin, and I attempt to delete using Bulk Actions (Delete Per.) > ""Apply"", I receive the WordPress error ""You are not allowed to delete this item."" ///After I return from the error page and refresh the Trash page, all of the selected author pages have been deleted. No admin pages have been deleted. 1b. When I am logged in as an author and I highlight posts by both author and admin, and I attempt to delete using ""Empty Trash"" button, I receive the WordPress error ""You are not allowed to delete this item."" ///I return from the error page and refresh the Trash page, all of the selected author pages have NOT been deleted. No admin pages have been deleted. returning to the Trash page. Tested both scenarios. 1. I hit back on the browser, and return to the Trash page. I refresh the page. 2. Move to a different WP admin page, not the Trash page, then return to the Trash page. Question, because the same text/error is thrown for both buttons, why is the functionality different? Both single functions seem appropriate, however, having both functions exist together instead of picking one behavior seems problematic." jpbellona Tickets with Patches 18833 Pass raw data into save_post/wp_insert_post rmccue Posts, Post Types normal normal enhancement new has-patch 2011-10-01T09:15:14Z 2019-06-04T20:42:21Z "Almost all tutorials about custom metaboxes (in addition to post meta) use `$_POST` to get the data that was submitted. Unfortunately, this breaks if a plugin uses anything that calls `wp_insert_post()` in the same request. The patch attached here includes the `$postarr` array, which is the raw data passed in, and which is `$_POST` from `wp-admin/post.php`. This allows one to use the third parameter to the callback to set meta data instead of having to use `$_POST` directly." rmccue Tickets Needing Feedback 52820 Possible logic error in wp_trim_excerpt() SergeyBiryukov Posts, Post Types normal normal Future Release defect (bug) reviewing reporter-feedback 2021-03-15T16:26:58Z 2022-04-30T05:23:17Z "https://core.trac.wordpress.org/browser/tags/5.7/src/wp-includes/formatting.php#L3845 Reading this code, it looks like the `wp_trim_excerpt` filter's `$raw_excerpt` parameter will be empty if `$text` as supplied to the function is empty. This should be the value of `$text` at L3824 should it not? Or do I mis-understand?" theMikeD Tickets Needing Feedback 52888 Docs: Update get_children function SergeyBiryukov Posts, Post Types normal minor Future Release enhancement reviewing dev-feedback 2021-03-23T01:38:42Z 2022-09-20T00:31:17Z get_children documentation is very confusing to read, an entire essay for what could be said in a single paragraph, so I've rewritten it. ribaricplusplus Tickets Needing Feedback 8592 Private Pages not listed in the Parent dropdown SergeyBiryukov Posts, Post Types normal critical Future Release enhancement reopened has-patch 2008-12-12T16:22:24Z 2023-12-06T17:33:31Z "Private pages are not available as a choice in the Parent dropdown of the Attributes module. You should be able to create a hierarchy of private pages if you want to. Tested with r10194." mtdewvirus Tickets with Patches 47849 Post excerpts accept spaces SergeyBiryukov Posts, Post Types 5.2.2 normal normal Future Release defect (bug) reviewing has-patch 2019-08-07T23:10:00Z 2019-10-15T14:21:59Z "Post excerpts accept spaces. This is image shows the spaces https://d.pr/i/2th5zq " adeltahri Tickets with Patches 44752 wp_get_archives() with the parameter limit = 0 generates an error SergeyBiryukov Posts, Post Types 1.2 normal normal Future Release defect (bug) reviewing has-patch 2018-08-08T08:52:28Z 2019-01-06T17:24:56Z "Hello. I'm working on an extension of the `WP_Widget_Archives` class, in which I implement the ability to specify the archive type and the limit of output links. These parameters are then passed to the `wp_get_archives()` function. It is noticed that if the parameter `limit=0`, then the query to the database turns out to be wrong and the following error is generated: {{{ [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0' at line 1] SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date) ORDER BY post_date DESC 0 }}} Of course, I can check this parameter from my side and zero is replaced by an empty string, but it is logical that the function itself does this." campusboy1987 Unpatched Bugs 45516 Auto Draft title issue for custom post types SergeyBiryukov Posts, Post Types 5.0 normal minor Future Release defect (bug) reopened has-patch 2018-12-07T08:52:14Z 2023-02-09T13:15:40Z "I have register post type without title support {{{ $labels = array( 'name' => _x( 'Social posts', 'post type general name', 'text-domain' ), 'singular_name' => _x( 'Social post', 'post type singular name', 'text-domain' ), 'menu_name' => _x( 'Social posts', 'admin menu', 'text-domain' ), 'name_admin_bar' => _x( 'Social post', 'add new on admin bar', 'text-domain' ), 'add_new' => _x( 'Add New', 'social-post', 'text-domain' ), 'add_new_item' => __( 'Add New Social post', 'text-domain' ), 'new_item' => __( 'New Social post', 'text-domain' ), 'edit_item' => __( 'Edit Social post', 'text-domain' ), 'view_item' => __( 'View Social post', 'text-domain' ), 'all_items' => __( 'All Social posts', 'text-domain' ), 'search_items' => __( 'Search Social posts', 'text-domain' ), 'parent_item_colon' => __( 'Parent Social posts:', 'text-domain' ), 'not_found' => __( 'No social-posts found.', 'text-domain' ), 'not_found_in_trash' => __( 'No social-posts found in Trash.', 'text-domain' ) ); $args = array( 'labels' => $labels, 'description' => __( 'Description.', 'text-domain' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'social-post' ), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => 10, 'menu_icon' => 'dashicons-id', 'delete_with_user' => true, 'can_export' => true, 'show_in_rest' => true, 'supports' => array( 'editor' ) ); register_post_type( 'social-post', $args ); }}} And if i add post the list post page shows title as ""Auto Draft"" " rajanit2000 Unpatched Bugs 52389 Consistently check for non-empty post ID in attachment functions SergeyBiryukov* Posts, Post Types normal normal Future Release defect (bug) accepted 2021-01-28T10:53:31Z 2021-02-17T23:54:41Z "Background: #50679, #52196. As a result of the changes in [49084] and [50039], `wp_get_attachment_metadata()` conditionally calls `get_post()` if the attachment ID is not passed: {{{ $attachment_id = (int) $attachment_id; if ( ! $attachment_id ) { $post = get_post(); if ( ! $post ) { return false; } $attachment_id = $post->ID; } }}} This is not really consistent with other attachment functions, which just always call `get_post()` unconditionally: {{{ $attachment_id = (int) $attachment_id; $post = get_post( $attachment_id ); }}} Let's bring some consistency here, there is no reason for these minor differences. This applies at least to: * `wp_get_attachment_metadata()` * `wp_get_attachment_url()` * `wp_get_attachment_caption()` * `wp_get_attachment_thumb_file()` * `wp_get_attachment_thumb_url()`" SergeyBiryukov Tickets with Patches 7231 wp_link_pages: option next_and_number sorich87* Posts, Post Types normal normal Future Release enhancement accepted has-patch 2008-07-03T09:25:43Z 2019-03-15T00:33:27Z "with the next_or_number option of the wp_link_pages() function, it would be nice to have the option to use both. it gives the user the opportunity to easily go to the next/previous page, without loosing the other option of going immediately to a certain page example: __next__ __1__ 2 __3__ __4__ __5__ __6__ __previous__ " jan831 Tickets Needing Feedback 30775 Delete empty post problem wonderboymusic Posts, Post Types 3.3 normal normal defect (bug) reopened dev-feedback 2014-12-19T02:20:16Z 2021-11-27T03:26:30Z "If empty post was created it cannot be deleted Details are here http://arul.ru/pages/writings/delete_post_problem.htm" axdr Unpatched Bugs 25493 Sorting posts in ascending order of date at admin side wonderboymusic Posts, Post Types 3.1 normal normal defect (bug) reopened 2013-10-06T08:57:14Z 2019-06-04T20:44:49Z Posts are displayed in descending order of date in the admin side but if we click on date column header to sort it then again it is sorted in descending order of date instead it should be sorted in ascending order of date. vinod dalvi