Minio
Forum Replies Created
-
Forum: Hacks
In reply to: Retrieve list of post from each categoryYeah, sure.
Code itself is available gist (I am not sure how markup here would handle it).
Notice how results are ordered by category slug. This way they are grouped together, so you can simply loop through array and print them, possibly with some header before each group (just check whether this iteration slug is different than previous iteration).
Or you can create another array that stores points where categories changes in
$all_postsarray. Later you can slice big array into per-category-arrays and shuffle them; you will get some randomness in your post list. That’s what I did – I shuffled each category array and printed only first 3 posts from each.Forum: Hacks
In reply to: Retrieve list of post from each categoryThanks for your reply.
I am not sure what do you mean when you say about subquery run 20 times. I managed to get all needed info with one query and few clever joins. Yes, there is some duplicated data in returned array, but I believe it is balanced off by the fact, that
$postobjects returned byget_postswould contain content of each post retrieved.As one can guess, currently I decided to go with direct connection with database and processing retrieved results in PHP.
But I think it would still be valuable to hear others opinions about this.
Forum: Fixing WordPress
In reply to: Esc key cancels comment – how to disable it?Let me answer myself.
The code is in wp-admin/js/edit-comments.js (this file is obfuscated; take a look at edit-comments.dev.js first). There is setTimeout function that adds keyup event listener to element with id of “replycontent”. You must remove this event listener:
$('#replycontent').focus().keyup(function(e){ if ( e.which == 27 ) commentReply.revert(); // close on Escape });In obfuscated code, look for “600” (timeout interval). Code that has to be removed is just before this number.
Unfortunately, it looks like there is no option to switch that setting. You must modify your WP files (and do it after every upgrade) or fool around with UserJS.