Forum Replies Created

Viewing 15 replies - 256 through 270 (of 305 total)
  • I’ve posted a jQuery hack over here.

    See my post over here.

    The only way I’ve found is to use jQuery. I’m adding some custom fields using the edit_user_profile hook. So, at the start of the code that my function drops in at the end, I include something like this. I’m not using the jQuery( document ).ready method so the code runs asap.

    <script type="text/javascript">/* <![CDATA[ */
    var hideFields = [ "aim", "yim", "jabber" ];
    jQuery.each( jQuery( "form#your-profile tr" ), function() {
    	var field = jQuery( this ).find( "input,textarea,select" ).attr( "id" );
    	if ( hideFields.indexOf( field ) != -1 ) {
    		jQuery( this ).remove();
    	}
    });
    /* ]]> */</script>

    I’m doing other stuff, like slipping custom fields between built-in fields, but this is the basic method. Also, having the script inline means you can conditional write JS with PHP.

    Sorry for anyone not writing plugins or developing themes – I’ve not wrapped any of this up into a plugin, it’s just for functions.php in a custom theme.

    Glad I’m not alone… But still frustrating – did you find the answer?!

    I just got this too, using “day” as a query string parameter. It would be nice to have a definitive list of reserved qs var names, but it’s not a big stumbling block. It took me 2 seconds to find a name that worked 🙂

    I’m a bit perturbed that seems like such a murky subject. I’m working with a client who need registered users to be able to delete their WP Subscriber account if necessary. I’ve not researched it yet but I’m sure here in the UK at least websites are obliged to allow users to delete personal information (e.g. email address) being held if they so wish. Everyone knows how annoying the Facebook thing is – and I know it’s not in the same league, but for WP this seems odd.

    I guess I’ll direct users to the contact form to request the deletion. I know this will generally be fine, it won’t be an avalanche of users wanting deletion – but still, is it such a stretch for there to be a delete_own_account capability?

    I just came across this issue accidentally. I’m trying to work out exactly how to use the ${field_no_prefix}_save_pre filter. http://adambrown.info/p/wp_hooks seems to indicate that the hooks it’s replaced are deprecated, but I’m not clear how the new one’s used.

    SEO Slugs seems to still be doing its job, so I guess name_save_pre is deprecated but still working?

    Thread Starter Steve Taylor

    (@gyrus)

    Excellent! Many thanks Godfrey, great work.

    Thread Starter Steve Taylor

    (@gyrus)

    get_permalink and the_permalink are one and the same though are they not, with the exception being that one echoes, and the other not…

    the_permalink is basically a wrapper for get_permalink, applying filters and echoing the output. But the crucial difference is that get_permalink can take an ID (making it usable outside the Loop), whereas the_permalink can’t (making it exclusive to the Loop).

    I think this difference is the root of the whole discussion here, and the fact that get_permalink can be used outside the Loop changes things.

    You could say that if used outside the Loop, get_permalink requires an ID, but in practice it doesn’t – it just returns the URL of the last post in that request’s last Loop, which isn’t useful.

    Thread Starter Steve Taylor

    (@gyrus)

    I think the docs for the_permalink() are accurate. That function is intended for the Loop exclusively, hence no ID necessary and no confusion about its use outside the Loop.

    Thread Starter Steve Taylor

    (@gyrus)

    That Codex bit is mine 🙂

    I think Ryan’s reply is accurate in terms of how the function works, but I think how it works is slightly confused. You can pass an ID to it, and it’ll get the URL for a page or post (so Ryan’s saying “It only creates links to posts” is slightly inaccurate). But outside the Loop, on a page, without an ID, it returns the URL of the last post in the Loop. I can’t see any use for that and it’s counter-intuitive to boot.

    But I don’t see it as a big deal worth hassling contributors to the core about. As long as it’s documented, maybe we should let them fry the bigger fish 🙂

    Thread Starter Steve Taylor

    (@gyrus)

    Well, here we go:

    http://core.trac.wordpress.org/ticket/9963

    A bit odd, but as long as it’s documented… I’ve updated the Codex accordingly.

    Thread Starter Steve Taylor

    (@gyrus)

    My client has their own internal tracking system, it involves a transparent 1px GIF in the footer, with the current URL appended to the src. So yeah, it needs to be dynamic.

    As I said, I’ve achieved the result with $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"], but I thought it was worth noting as I do think get_permalink() outside the Loop should return the URL of the current page. I’ll maybe head over to Trac… Thanks for the responses!

    Thread Starter Steve Taylor

    (@gyrus)

    Hi Godfrey, yes, let’s drop the English and just post in witty PHP 😉

    How to make it less confusing, good question! I just had to explain to a client why is_home() doesn’t test as true on the home page (which is static), and I realized how confusing it can be if you’re not used to the WP way. But I think the answer is on the Reading settings page: they use “Front page” and “Posts page”. Coders are stuck with is_home(), but when talking English, I think these two terms are the best way of making the difference clear.

    So, a “Posts page” option, together with a brief explanation like the other Special pages, would be great.

    Thread Starter Steve Taylor

    (@gyrus)

    If I have a page created at /blog/, which under the Reading settings I’ve set to be the Posts page, and I call get_permalink on that page outside the Loop, it should return:

    http://my-site.com/blog/

    Inside the Loop, of course, it should return the permalink for whichever post is being iterated over. But this is outside the Loop, and we’re clearly on a single page which has an unambiguous URL.

    I’ve worked around this for now using $_SERVER vars to reconstruct the current URL, but I think this is an issue with get_permalink, unless I’m missing something. The docs do say you can use it outside the Loop.

Viewing 15 replies - 256 through 270 (of 305 total)