[wp-hackers] Re: wp-hackers Digest, Vol 49, Issue 110

Thomas Belknap dragonfly at dragonflyeye.net
Sun Feb 22 19:27:23 GMT 2009


Thanks, Austin!




>
> Message: 5
> Date: Sun, 22 Feb 2009 09:03:36 -0600
> From: Austin Matzko <if.website at gmail.com>
> Subject: Re: [wp-hackers] Deleting WordPress Tags
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <674b4a3b0902220703s38be8f7bn2963cafb5ed7bd0e at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sun, Feb 22, 2009 at 8:38 AM, Thomas Belknap
> <dragonfly at dragonflyeye.net> wrote:
> > I am in the process of writing a simple little plugin that finds and
> allows
> > you to delete orphaned tags.  I figured I'd just use a WP function that
> > deletes tags gracefully, but I was surprised to find that as far as I can
> > tell, no such function exists.
>
> You want wp_delete_term( 123, 'post_tag'), where 123 is the ID number
> of the tag.
>
>
> ------------------------------
>
> Message: 6
> Date: Sun, 22 Feb 2009 10:06:46 -0500
> From: Casey Bisson <casey.bisson at gmail.com>
> Subject: Re: [wp-hackers] AJAX in plugins and public pages
> To: wp-hackers at lists.automattic.com
> Message-ID: <DA489DFD-BF68-4950-81C4-2D322B57BA17 at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
> http://core.trac.wordpress.org/browser/tags/2.7/wp-admin/admin-ajax.php#L60
>
> On Feb 22, 2009, at 10:02 AM, Heiko Rabe wrote:
>
> > The admin-ajax.php *only*! processes POST ajax calls, you can't
> > request admin ajax content by using GET.
> > I would prefere to permit public ajax requests additional to be
> > called by GET requests but the standard usage should be POST as done
> > in admin ajax.
> >
> > regards
> >
> > Heiko Rabe
> > (www.code-styling.de)
> >> On Sun, Feb 22, 2009 at 4:32 PM, Heiko Rabe <heiko.rabe at code-styling.de
> >> >wrote:
> >>
> >>
> >>> It's much easier to implement it in this way, if core would
> >>> support it:
> >>>
> >>> add_action('wp_public_post_ajax-myfunction',
> >>> 'my_public_post_ajax_function');
> >>> add_action('wp_public_get_ajax-myfunction',
> >>> 'my_public_post_ajax_function');
> >>>
> >>>
> >>
> >> If it get's implemented, shouldn't there be a single hook that
> >> handles both
> >> GET and POST request like in admin_ajax.php?
> >>
> >>
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
>
> ------------------------------
>
> Message: 7
> Date: Sun, 22 Feb 2009 16:28:10 +0100
> From: Heiko Rabe <heiko.rabe at code-styling.de>
> Subject: Re: [wp-hackers] AJAX in plugins and public pages
> To: wp-hackers at lists.automattic.com
> Message-ID: <49A16F0A.1010602 at code-styling.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> May be, but the only way getting admin ajax calls running at a WP 2.6
> based installation is POST, you would loose your backward compatibility!
> Here the only processed $_GET inside WP the 2.6 file:
>
> <?php
> define('DOING_AJAX', true);
>
> require_once('../wp-load.php');
> require_once('includes/admin.php');
>
> if ( !is_user_logged_in() )
>    die('-1');
>
> if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
>    if ( !current_user_can( 'manage_categories' ) )
>        die('-1');
>
>    $s = $_GET['q']; // is this slashed already?
>
>    if ( strstr( $s, ',' ) ) {
>        $s = explode( ',', $s );
>        $s = $s[count( $s ) - 1];
>    }
>    $s = trim( $s );
>    if ( strlen( $s ) < 2 )
>     die; // require 2 chars for matching
>    $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name
> LIKE ('%". $s . "%')" );
>    echo join( $results, "\n" );
>    die;
> }
>
> So you will be not able to get your plugin running related to admin ajax
> calls, if you do GET calls. This will limit your implemantation to
> WordPress 2.7 and above.
> If you prefere to combine POST and GET into one public ajax call hook,
> this could also be done.
> But it would be a good idea to be able to disable GET based public ajax
> calls because is much more easy to flood the server with ordinary
> clickable links forcing ajax processing
> instead of a form or application required to generate the POST call.
>
> regards
>
> Heiko Rabe
> (www.code-styling.de)
> >
> >
> http://core.trac.wordpress.org/browser/tags/2.7/wp-admin/admin-ajax.php#L60
> >
> >
> > On Feb 22, 2009, at 10:02 AM, Heiko Rabe wrote:
> >
> >> The admin-ajax.php *only*! processes POST ajax calls, you can't
> >> request admin ajax content by using GET.
> >> I would prefere to permit public ajax requests additional to be
> >> called by GET requests but the standard usage should be POST as done
> >> in admin ajax.
> >>
> >> regards
> >>
> >> Heiko Rabe
> >> (www.code-styling.de)
> >>> On Sun, Feb 22, 2009 at 4:32 PM, Heiko Rabe
> >>> <heiko.rabe at code-styling.de>wrote:
> >>>
> >>>
> >>>> It's much easier to implement it in this way, if core would support
> >>>> it:
> >>>>
> >>>> add_action('wp_public_post_ajax-myfunction',
> >>>> 'my_public_post_ajax_function');
> >>>> add_action('wp_public_get_ajax-myfunction',
> >>>> 'my_public_post_ajax_function');
> >>>>
> >>>>
> >>>
> >>> If it get's implemented, shouldn't there be a single hook that
> >>> handles both
> >>> GET and POST request like in admin_ajax.php?
> >>>
> >>>
> >>
> >> _______________________________________________
> >> wp-hackers mailing list
> >> wp-hackers at lists.automattic.com
> >> http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
>
> ------------------------------
>
> Message: 8
> Date: Sun, 22 Feb 2009 10:27:46 -0600
> From: Otto <otto at ottodestruct.com>
> Subject: Re: [wp-hackers] Improving the mailing list. (Was Auto Update
>        Plugins)
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <161617690902220827m1dfd25an93d7e37a94d23fb7 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sat, Feb 21, 2009 at 2:52 PM, Jacob Santos <wordpress at santosj.name>
> wrote:
> > "Why do they say, 'Code is Poetry'?"
> >
> > "I don't know, that is just something they say."
> >
> > "The code doesn't rhyme."
>
> Most poetry doesn't rhyme either.
>
> -Otto
>
>
> ------------------------------
>
> Message: 9
> Date: Sun, 22 Feb 2009 13:22:30 -0600
> From: Stephen Rider <wp-hackers at striderweb.com>
> Subject: Re: [wp-hackers] Improving the mailing list. (Was Auto Update
>        Plugins)
> To: wp-hackers at lists.automattic.com
> Message-ID: <6F618861-D096-4251-BA1E-B4CBE1CF6AD8 at striderweb.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
> On Feb 21, 2009, at 11:07 AM, Peter Westwood wrote:
>
> > If you want to help get your patch committed you need to make sure
> > that it is obvious what it fixes so that I can test the fix, and
> > join us in #wordpress-dev and promote your patch if it languishes
> > (or CC my user id on the patch in trac to get my attention)
>
> Careful Peter -- I think you just invited coders to cc you on every
> patch!  ;-)
>
> When is a good time to find people on IRC?  Still Wednesdays at 2-ish?
>
>
> Getting back briefly to the semi-original topic on this thread (where
> to put "support" files for plugins) -- as much as it did turn into an
> ego contest of sorts, in the end I did find the discussion useful.
> I'm going to pick a method and use it for my plugins, but the
> different arguments for why one location was better or worse than
> another were a good dose of perspective.
>
> If I had the chops for it, I would put in a system for in-admin
> uploading of Styles for my Pull-Quotes plugin.  As it is I wouldn't
> trust myself *not* to either introduce security issues OR to make a
> system that will break down on half the platforms that aren't just
> like mine.  Minor plugins don't get the security vetting that core
> does -- all the more reason sometimes to introduce certain types of
> things to core.
>
> On Feb 21, 2009, at 2:52 PM, Jacob Santos wrote:
>
> > The "Code is Poetry" mantra is a farce and should die as the
> > religion behind it is no more
> <snippety-snip-snip>
>
> I'm sorry, but you appear to be getting off the topic of what topics
> are off-topic.
>
> We just veered from "keep it technical" and "no bikeshedding" straight
> to "code isn't poetry unless it rhymes" and "code is like a woman"....?
>
> Stephen
>
>
>
> ------------------------------
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
> End of wp-hackers Digest, Vol 49, Issue 110
> *******************************************
>


More information about the wp-hackers mailing list