__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-29T11:33:28Z,"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:
{{{
}}}
",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,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,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,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,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,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,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,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 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,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,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
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,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
234
}}}
but should be
{{{
1234
}}}
",Alexufo
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,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
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,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
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'] );
}
*/
?>
';
}
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 '