[wp-hackers] New Filter Request: get_tags_to_edit

Trevor Fitzgerald fitztrev at gmail.com
Fri Feb 15 22:22:31 GMT 2008


The hook isn't necessary to do what you want.  You can add a jQuery event
that, when the Write page is loaded, changes the value of either the newtags
or tags_input fields.

Trevor

On Feb 15, 2008 5:14 PM, Charles Iliya Krempeaux <supercanadian at gmail.com>
wrote:

> Hello,
>
> I'd like to request a new filter.  I want the filter so I can write a
> WordPress plugin that will set a default list tags to be
> pre-populated, on the write post page, when the user is writing a new
> post.
>
>
> >From what I can tell, the function that sets these tags is...
>
> function get_tags_to_edit( $post_id ) {
>        global $wpdb;
>
>        $post_id = (int) $post_id;
>        if ( !$post_id )
>                return false;
>
>        $tags = wp_get_post_tags($post_id);
>
>        if ( !$tags )
>                return false;
>
>        foreach ( $tags as $tag )
>                $tag_names[] = $tag->name;
>        $tags_to_edit = join( ', ', $tag_names );
>        $tags_to_edit = attribute_escape( $tags_to_edit );
>        $tags_to_edit = apply_filters( 'tags_to_edit', $tags_to_edit );
>        return $tags_to_edit;
> }
>
> (This can be found in "wp-admin/includes/taxonomy.php".)
>
> I'd like the hook to be something like...
>
>
> function get_tags_to_edit( $post_id ) {
>        global $wpdb;
>
>        $post_id = (int) $post_id;
>        if ( !$post_id )
>                return false;
>
>        $tags = wp_get_post_tags($post_id);
>
>        // NEW HOOK HERE
>        apply_filters('get_tags_to_edit', $tags);
>
>        if ( !$tags )
>                return false;
>
>        foreach ( $tags as $tag )
>                $tag_names[] = $tag->name;
>        $tags_to_edit = join( ', ', $tag_names );
>        $tags_to_edit = attribute_escape( $tags_to_edit );
>        $tags_to_edit = apply_filters( 'tags_to_edit', $tags_to_edit );
>        return $tags_to_edit;
> }
>
>
> Or something similar.
>
> Thanks.
>
> See ya
>
> --
> Charles Iliya Krempeaux, B.Sc.
> http://ChangeLog.ca/
>
> Motorsport Videos
> http://TireBiterZ.com/
>
> Vlog Razor... Vlogging News... http://vlograzor.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list