- var_dump: documentation ( source)
- array_merge: documentation ( source)
<?php
function func_get_args_in_current_user_can( $capability ) {
$args = array_slice( func_get_args(), 1 );
$args = array_merge( array( $capability ), $args );
var_dump($args);
}
function func_get_args_simplified( $capability ) {
$args = func_get_args();
var_dump($args);
}
// Passing 1 arg.
func_get_args_in_current_user_can( 'edit_posts' );
func_get_args_simplified( 'edit_posts' );
// Passing 2 args.
func_get_args_in_current_user_can( 'edit_post', 10 );
func_get_args_simplified( 'edit_post', 10 );
// Passing 3 args.
func_get_args_in_current_user_can( 'edit_post_meta', 10, 'meta_key' );
func_get_args_simplified( 'edit_post_meta', 10, 'meta_key' );