Make `$taxonomy` parameter optional in `get_edit_term_link()`.
Props nicdford, sc0ttkclark. Fixes #35922. Built from https://develop.svn.wordpress.org/trunk@36646 git-svn-id: http://core.svn.wordpress.org/trunk@36613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
87a9bf2b37
commit
8b786f3d1c
|
@ -907,21 +907,22 @@ function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
|
||||||
* Retrieve edit term url.
|
* Retrieve edit term url.
|
||||||
*
|
*
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
|
* @since 4.5.0 The `$taxonomy` argument was made optional.
|
||||||
*
|
*
|
||||||
* @param int $term_id Term ID.
|
* @param int $term_id Term ID.
|
||||||
* @param string $taxonomy Taxonomy.
|
* @param string $taxonomy Optional. Taxonomy. Defaults to the taxonomy of the term identified by `$term_id`.
|
||||||
* @param string $object_type The object type. Used to highlight the proper post type menu on the linked page.
|
* @param string $object_type Optional. The object type. Used to highlight the proper post type menu on the linked page.
|
||||||
* Defaults to the first object_type associated with the taxonomy.
|
* Defaults to the first object_type associated with the taxonomy.
|
||||||
* @return string|null The edit term link URL for the given term, or null on failure.
|
* @return string|null The edit term link URL for the given term, or null on failure.
|
||||||
*/
|
*/
|
||||||
function get_edit_term_link( $term_id, $taxonomy, $object_type = '' ) {
|
function get_edit_term_link( $term_id, $taxonomy = '', $object_type = '' ) {
|
||||||
$tax = get_taxonomy( $taxonomy );
|
$term = get_term( $term_id, $taxonomy );
|
||||||
if ( ! $tax || ! current_user_can( $tax->cap->edit_terms ) ) {
|
if ( ! $term || is_wp_error( $term ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$term = get_term( $term_id, $taxonomy );
|
$tax = get_taxonomy( $term->taxonomy );
|
||||||
if ( ! $term || is_wp_error( $term ) ) {
|
if ( ! $tax || ! current_user_can( $tax->cap->edit_terms ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.5-alpha-36645';
|
$wp_version = '4.5-alpha-36646';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue