add class to –> edit_post_link
-
Hello everyone… what I am attempting to do I feel should be relatively simple, but I have yet to really learn how to use WP filters. So if someone could, please show me how I would go about adding an addition class attribute to the “edit_post_link” filter.
edit_post_link is located at wp-includes/link-template.php:
function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) { if ( !$post = &get_post( $id ) ) return; if ( !$url = get_edit_post_link( $post->ID ) ) return; if ( null === $link ) $link = __('Edit This'); $post_type_obj = get_post_type_object( $post->post_type ); $link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>'; echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘add class to –> edit_post_link’ is closed to new replies.