-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow the use of query strings #67
Conversation
Thank you Ian! |
Does that mean that all those types are not in the stubs already I suppose? Just asking because I remember registering a post type recently and it did enforce the arg type with keys properly |
just checked, looks like I was using |
Veto? Anyone? |
This needs to go into functionMap62.php as well, right? |
Yes. |
@IanDelMar I'm very glad that you continue with this PR. |
The PR should be up to date now |
Thank you! |
@IanDelMar What's your use case for needing the shape of the args for Having those shapes defined in this repo increases the maintenance burden and the chance that they get out of sync with the args in core. The |
@johnbillion Maybe they are not needed. In fact this is not about the shapes at all but removing the string from /**
* Constructor.
*
* See the register_post_type() function for accepted arguments for `$args`.
*
* Will populate object properties from the provided arguments and assign other
* default properties based on that information.
*
* @since 4.6.0
*
* @see register_post_type()
*
* @param string $post_type Post type key.
* @param array|string $args Optional. Array or string of arguments for registering a post type.
* Default empty array.
*/
public function __construct( $post_type, $args = array() ) {
$this->name = $post_type;
$this->set_props( $args );
} If there's a better way to do this, I'm happy to learn! |
Got it. I'll take a look. |
This PR adds array shapes for the
$args
parameter to the functionsMap.php forget_objects_in_term()
WP_List_Table::set_pagination_args()
WP_Post_Type::__construct()
WP_Taxonomy::__construct()
wp_widget_rss_form()
.As already done with other functions in the WP stubs this disallows the use of query string for the functions listed above.