Conversation
7ffc0eb to
1e8de9a
Compare
|
@westonruter Can you please update the patch at westonruter/PHP-CSS-Parser#2 which is causing this deprecation warning |
|
Plugin builds for e8f73c5 are ready 🛎️!
|
e0ce678 to
14b70d7
Compare
| 'edit_terms' => 'do_not_allow', // Terms are created (and updated) programmatically. | ||
| // Terms are created (and updated) programmatically, but we still need to assign capabilities while generating edit link for term. | ||
| // @see <https://github.com/ampproject/amp-wp/issues/7604#issuecomment-1704244763>. | ||
| 'edit_terms' => AMP_Validation_Manager::VALIDATE_CAPABILITY, |
There was a problem hiding this comment.
Won't this then allow users to access the edit term page when they shouldn't be able to access it?
There was a problem hiding this comment.
At the very least we'll also need to unset($actions['edit']) in:
amp-wp/includes/validation/class-amp-validation-error-taxonomy.php
Lines 1679 to 1738 in 828f229
Then there's the question of the REST API. I suppose they can't access it because it's not public and show_in_rest is not true.
On the other hand, is this actually a bug that should rather be fixed in core?
There was a problem hiding this comment.
Won't this then allow users to access the edit term page when they shouldn't be able to access it?
We are not providing an edit link so it will be hard to generate the link with the correct tag_ID.
At the very least we'll also need to unset($actions['edit']) in:
I think it will do it.
There was a problem hiding this comment.
On the other hand, is this actually a bug that should rather be fixed in core?
Yes, and I have filed a ticket for that - https://core.trac.wordpress.org/ticket/59336
| public function register() { | ||
| add_submenu_page( | ||
| '', | ||
| 'options.php', |
There was a problem hiding this comment.
Linking your pervious #7614 (comment) here.
This was made an empty string in e30168c.
You say:
But adding
options.phpprovides the same behavior without breaking anything. So updating it tooptions.php.
Can you clarify further what this is doing? Is it that there is no menu item for options.php so it won't add anything to the menu?
There was a problem hiding this comment.
Yes. It won't be accessible from a submenu item but rather only accessible via the URL which is options.php?page=amp-onboarding-wizard.
There was a problem hiding this comment.
Or if we want to hook it to amp-options page and keep it hidden in the submenu items then we need to only register it when it's called via URL - e0ce678
This reverts commit 308e17c.
| add_filter( 'pre_term_description', 'wp_filter_kses', $has_pre_term_description_filter ); | ||
| } | ||
|
|
||
| // Bail if redirect_is passed as null. |
There was a problem hiding this comment.
It should be $redirect_to. Will update it.
|
|
||
| // Set title to be used in the screen. | ||
| global $title; | ||
| $title = 'Test Title'; |
There was a problem hiding this comment.
I see this is coming from 1e8de9a. It was needed due to a PHP warning during tests?
There was a problem hiding this comment.
Yes, while rendering the screen it requires the title, but the title is not being set anywhere.
There was a problem hiding this comment.
Is this commit needed to work around the issue in tests which you're fixing in core?
There was a problem hiding this comment.
Which commit? I am unable to see any diff with this comment.
There was a problem hiding this comment.
It's different from that one. handle_single_url_page_bulk_and_inline_actions() uses get_edit_post_link() which requires edit_post capability in general. In test cases we were not setting up the user hence it was resulting into deprecation warnings.
There was a problem hiding this comment.
What was the deprecation warning?
There was a problem hiding this comment.
Those were the same as passing null to add_query_arg()
Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /tmp/wordpress/src/wp-includes/functions.php on line 1157
Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /tmp/wordpress/src/wp-includes/functions.php on line 1164
Summary
Fixes #7604
Checklist