
构建自定义古腾堡区块:权威WordPress区块开发教程
edit_bookmark_link ( $link = '', $before = '', $after = '', $bookmark = null )
edit_bookmark_link: 这个函数生成一个链接来编辑WordPress管理面板中的指定书签(链接)。
显示编辑书签链接锚的内容。
function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) { $bookmark = get_bookmark( $bookmark ); if ( ! current_user_can( 'manage_links' ) ) { return; } if ( empty( $link ) ) { $link = __( 'Edit This' ); } $link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>'; /** * Filters the bookmark edit link anchor tag. * * @since 2.7.0 * * @param string $link Anchor tag for the edit link. * @param int $link_id Bookmark ID. */ echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after; }