Add, fix, update bookmark related functions #359
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add_link()
,edit_link()
,get_bookmark_field()
,get_default_link_to_edit()
,sanitize_bookmark_field()
,wp_get_link_cats()
get_bookmark_field()
sanitize_bookmark_field()
get_default_link_to_edit()
marked impure (return value depends on$_GET
)wp_update_link()
Notes
add_link()
,edit_link()
, andwp_update_link()
all callwp_insert_link()
with the default$wp_error
value (false
). Therefore, none of these functions returnsWP_Error
. (Forwp_update_link()
the documentation was misleading; and I incorrectly addedWP_Error
to the return type in Narrow return type of wp_update_link() #357.)$field
parameter has been narrowed forget_bookmark_field()
andsanitize_bookmark_field()
to be a key of the$linkdata
array (seewp_insert_link()
). Enforcing this allows the return type to be narrowed accurately. Forget_bookmark_field()
, the documented type was incorrect; compared with the documented type, the actual return type is wider.bookmark-admin.php
; general bookmark functions are inbookmark.php
.Hopefully, this is the end of my bookmarks journey. 🙂