« first day (685 days earlier)      last day (4558 days later) » 

03:50
@TomJNowell haha My dad runs that. I have nothing to do with it. :)
 
2 hours later…
06:12
Changeset 21679 Introduce wp_send_json() to json-encode a variable, print it, and die, for Ajax requests. Effectively replaces WP_Ajax_Response, which was an XML-based response.
 
1 hour later…
07:17
am i missing something obvious - why am i not able to do __( "Get Quote", "gravity_form" ) and have that return a translation from another textdomain in my theme
i'm just getting the same english result back
probably not translated in GF?
it is
it could be a WPML thing
ok i know what it is. wpml assigns my gettext call another domain, prefixing it with "theme"
and registers a new thing called "theme gravity_form"
this is weird, it feels like it's working differently with a couple of other themes
maybe a setting thing
07:56
morning all
 
3 hours later…
10:43
is there an array or function for converting things like GB and US to United kingdom and United States?
core.trac.wordpress.org/changeset/21679 they finally put out WP_Ajax_Response out of misery
11:01
@Rarst yeah toscho said barely 5 6 messages ago =p
@TomJNowell missed it when skimming :)
 
2 hours later…
12:52
@toscho Is this now in core for 3.5?
13:04
@Rarst this doesnt look right though....
function wp_send_json( $response ) {
 	2153	    @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
 	2154	    echo json_encode( $json );
 	2155	    if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
 	2156	        wp_die();
 	2157	    else
 	2158	        die;
 	2159	}
$response != $json
@Brady LOL
tweeted Nacin
@Rarst obviously Nacin didn't have his Ready Brek this morning
behold what greeted my return from lunch at work
@TomJNowell Three screens. awsome
13:17
@Brady puny screens doesn't count :)
@Rarst yeah
@Rarst but its like stepping into a flight simulator
13:32
What a waste. No guns..no missiles..nothing to shoot at.
@Rarst PHP question incoming:
What's the easiest way to find the key for a value in a sub-sub-array? Example coming.
$example = array(
	 'A' => array(
	 	 'A-1'
		,'A-2'
		,'A-3'
		,'A-4'
	 )
	,'B' => array(
		 'B-1'
		,'B-2'
	 )
);
So I got for example 'A-4' and need to return 'A'. Any idea?
foreach if ( in_array() ) return $key
That's what I currently got. Thought there's something more elegant like wp_list_pluck_special() or something like that.
Problem is that I'm already looping through some array and need to check if the key is one of the ↑ sub-arrays...
14:00
don't follow context... I don't think there is something more elegant here, too uncommon
Yea, maybe. One of those rare cases, where I've to dig in deep - build 5 solutions and time measure/compare them. Thanks anyway.
is it like giant set so you feel a need to benchmark?
@Rarst I'm trying to align the data structure from various HTTP responses.
14:31
Nice question @kaiser
@userabuser HTTP response? Or recursive filters?
Recursive.. Love arrays ;)
Haven't seen the other http one yet, on phone currently
@userabuser HTTP response was just here a question to @Rarst ↑
Ah ok I see.. Maybe there is more elegant solution but the contextnis hard to follow without more deep example.. Usually more than one way to skin the array-cat
sorry typo on phone "context is" I meant..
14:49
we still need some collaborative tool for indulging in code review and snipettism in chat...
Right. I've to solve a problem with the plugin directories plugin and will then come back with a real live example. I'm pretty sure, that my solution can be made much better.
@Rarst Agree
Koding might fit later as it looses under construction signs on everything
Maybe we should just start using jFiddle
for PHP?..
Why not
14:54
not sure, hadn't tried... isn't the point there that it executes stuff to give you preview?
won't it choke on PHP?
it's a misuse
a partial solution could be something like this.
but hadn't tried myself
@rarst don't know if you recall I was/still am working on a code editor one idea was to have collab/chat but really could use someone to help with the chat side of things on Node.js - if anyone wants to help we'd have a solution that does just what you describe!
14:56
@anu that works
@userabuser I suck with JS :(
@userabuser can I see the code?
@anu hadn't we tried that already?..
anu
anu
koding should also be pretty much what's needed once it gets out of alpha
@rarst idk, maybe? php syntax highlighting, collab and chat - seems to tick boxes
@anu I think we did and it had bunch of issues with text getting borked between multiple people...
14:58
@Tomjnowell yeah I guess I can scrape it together, it's all a piece of inchorrent shite atm, written in coffee script, using code
anu
anu
@Rarst ah, well that would turn it from useful into piece of shit
Argh sorry code mirror
@anu collab part is damn hard :( stupid Google Wave died on us :(
Maybe they've fixed some stuff - here's a link if anyone want to try it collabedit.com/3xq2s
anu
anu
@Rarst i used to use subetha quite a bit. that was ok for multiple people working on same doc
14:59
just the array that @kaiser posted earlier
@userabuser coffee script? but why?!
why is the text so blurry on collabedit?
But the real time msging and notations per line are just feature based ideas could use help with
@anu mac only?..
anu
anu
@Rarst 'fraid so.
15:01
Tom, should I write the beast in raw JS? I'd be happy to rewrite with help, I have some existing apps we can use as a start I.e from github
@userabuser I'm mainly interested in the mechanics and design of your server implementation
It's all client side atm, I have my research notes that capture my thoughts on how to go about it.. I've been digging hard looking at various techs for this..
@toscho Isn't blured for me
@userabuser oh so you have an editor but no collaborative editing?
So, collabedit.com seems like it might be an option -- as long as people don't expect too much from it
anu
anu
15:07
or if you don't need syntax highlighting. then just fire up an etherpad instance
Yeah - hard to do without syntax highlighting when editing code
Seems like there's not really something good available
Tom yeah basically.. Making of an editor anyway, the collab side is important, but more than I can chew myself.
Gist is pretty solid, but not collaborative enough
anu
anu
15:11
@kaiser for free, anyway
I used brackets fir alot of inspiration which also uses code mirror but I was using code mirror before I knew they were Which reaffirmed my choice to use it over ACE
that's not english, mate :P
@userabuser A gift for you: .,!:-#?
Use it wisely ;)
»With great power there comes great responsibility.«
Just found this from search: squadedit.com
limited to 3 collaborators in the free plan - but would that really be a problem?
anu
anu
@rarst, @kaiser are you on koding.com?
15:15
@kaiser on mobile chat which is fked up badly jumping screen making it hard to type
@anu yes
anu
anu
@Rarst haven't tried that for collab editing, but would probably be fine for small ad-hoc code reviews, no?
forget squadedit -- requires ftp access to files to work
@kaiser thanks for present tho. Shows you care.
function get_key( $value, $array, $parent_key = NULL )
{
	foreach ( $array as $k => $v )
	{
		if ( $v === $value )
		{
			return NULL === $parent_key ? $k : $parent_key;
		}
		if ( is_array( $v ) and $test = get_key( $value, $v, $k ) )
		{
			return $test;
		}
	}

	return FALSE;
}

print get_key( 'B-2', $example );
anu
anu
15:18
actually, i'm assuming koding allows collab editing. which it might not
atm
can't share snippet in koding "coming soon"
Here's desktop client based collab editor - gobby.0x539.de/trac
Win & linux downloads - source to build mac
Probably not an option for most, just throwing it out there
Online is better, especially for discussions moved from comments to chat.
Cloud9 says it supports collab editing - was this discussed already?
@marfarma I think it was too "heavy" or something
@marfarma ah, I tried it and it worked crapyp slow - especially sync with gists and such
15:30
ok - makes sense
so, basically we just want jsfiddle to support code it can't execute
@marfarma and I think it needs off-site storage as well
@Rarst expects off site storage - not needs, it seems
but I get the 'too heavy' comment
@marfarma or gist several people can edit without forking
yeah. what would it take to build one?
It has to be a hard problem or we'd have it already
15:34
take collabedit - we don't like that it intermixes what people type
@toscho get right on that
@toscho yeaaaah... imagine someone hijacking WPSE. there would be no bodies to find. :)
anyway - what's the alternative -- I'm thinking highlighted lines like in a diff compare
@Rarst Scott B did that. :D
@toscho and had you useen him lately? :)
anu
anu
15:36
nope, that doesn't seem to work
@anu I can't edit?
@anu the second link is 404 for me, and the first link goes to a proxmox login
@Rarst No. hides the ax
I think me migrated Scott silently to SO.
@Marfarma there is one or two solutions online that already do the diff-style presentation of edits can't remember which though..
anu
anu
ugh - yeah, that looks broken - had it open in 2 separate browsers and was working, now it's dead
15:39
we could take Pears, stuff it with front end editor and expose revisions as diffs... but that's good chunk of work
@Rarst Pears?
anu
anu
what about this? stypi.com/kxtwsex7
@marfarma pea.rs
Heh, we’re talking about this for more than one hour and no one said I could do that with WordPress – what’s wrong with you guys?
@Rarst a good chunk of work - but it could be fun
15:42
@toscho I just did, you are half a minute late :)
@toscho um @Rarst just did
Grrr I have so many ideas for things I don't have the budget or team to accomplish
or at least if you weren't in burnout, @Rarst
needs more coffee
@PolluxKhafra ideas are nothing. everyone here has couple lifetime of ideas, they don't matter
anu
anu
15:43
@Rarst +1^100
@Rarst its all execution
anu
anu
jump on that stypi link - seems like it might work
@Pollux khafra there are easy ways to solve those kind of problems
@marfarma I have more important projects on my plate first... QueryPosts progress, Hybrid Wing theme that I need for all my sites, etc
@Rarst Everything starts with an idea though
@userabuser how?
15:44
@toscho I am on my second cup of tea... no, not quite right... second CUP of tea
Wait till I get back to desktop, on phone now, will explain what I've done myself that might help you just the same.
@Rarst it's all about your priorities -- anyone else want to play with Pears for this?
stypi seems not too bad actually
@marfarma Pears is definitely on my radar to play with, just not high up the list :)
I might get to it on my sabbatical
Seems like there's a lot of people who know how to do a lot of things but have no idea what to do with them.
@PolluxKhafra and?
15:48
@PolluxKhafra thank you, I know what to do with them just fine :) but it's not the same thing as doing everything at once just because I can
@Rarst if stypi is good we won't need a Pears solution
anu
anu
Ideas are mostly cheap. Execution is everything
@Rarst I'm pretty sure @PolluxKhafra wasn't referring to any of us
@anu yeah I realize a lot of people have repetitive tweaked version of other ideas that are a waste of time. I have ideas that are unique. Not trying to reinvent twitter.
anu
anu
15:51
@PolluxKhafra no you don't
@PolluxKhafra how do you know they are unique?
Cuz I can't find anything like them.
Maybe your search competence is unique?
ok +1 for stypi until it fails us, created account
15:54
Unique ideas don't have an existing market. They may be the 'Next Big Thing' but they're incredibly hard to get off the ground
Most people with revolutionary ideas can't make money from it
It's the people who come along afterwards who pick it up, polish it off, and leverage the work of the original inovator
look at QueryPosts :) boring like I don't know. older sites doing exactly same thing. yet it melts devs into happy puddle like nothing else I've done :)
who make the killing
It’s better to invent something not so unique that everybody needs. Like these guys with the scrollbar patent.
SquareFaceTwitch - next big thing!
Ok will you guys humor me and let me pitch an idea
15:56
beaks for your duck pout photos?
@PolluxKhafra to us? Why?
@marfarma Cuz I can't act on it.
Throw your best curveball
@PolluxKhafra We're all really busy - so we're unlikely to either
but hey - knock yourself out
16:01
Majority of all people will never act on any idea no matter how good it is because it requires something called 'action' which most people simply don't want to employ... For various reasons
@userabuser perhaps the rates are too high to employ them?
Yeah the rate to employ 'action' comes at a cost of effort which means you need to spend all your procrastination and fears of success. A price to high for most.
ok, I really need to clear last work ticket :)
@marfarma thx for those
16:16
If I wanted to fetch a list of posts in the Dashboard, from a plugin, what is an appropriate hook to use? It keeps returning a blank array.
@MichaelEcklund don't you mean to ask this in WPSE? With all appropriate details, like code snip, etc.?
Pollux, m.techcrunch.com/2012/06/03/… but I assume you can code
@marfarma I solved it myself.
16:33
@Mods Could we add a note, when asking a question to link to plugins in question? That's annoying.
@kaiser no such functionality...
sigh
random....
or in Russian:
anu
anu
16:47
Wow, I haven't blogged in over 3 years. I should do something about that one day
@anu ditto
@anu having just crossed the 1k mark I actually filled out my profile. But I left my blog off because my last post was June 2010
@anu tl;dr me too
hey guys, if i dont have a comments.php file where does wp gets the info for comments_template()?
@alme1304 comments_template() "The $file path is passed through a filter hook called, ‘comments_template’ which includes the TEMPLATEPATH and $file combined. Tries the $filtered path first and if it fails it will require the default comment template from the default theme."
the default theme being 2011? or the comments.php in wp-includes?
17:00
no idea
@anu I almost stopped blogging too. But recently I decided to try if I could change that. Have written one post almost every day since then. And ideas for new posts are flowing. :)
I am slow on blogging this year because run out of good stuff (for the topics my blog covers) and I don't feel like posting about crap
slowly gathering backlog of new good stuff and will start covering it
also - new theme :) tinkering with my blog's internals is what got me that deep in WP in first place...
17:17
Where does this asker come from?
@toscho might be deleted user
asked 28 mins ago
might be recently deleted user?
haha
Nobody deleted an user during the last hour. And self deletion after asking?
I have no other ideas...
17:22
I asked in TL.
17:45
WPSE off for maintainance...
no
Redshift adjusts the color temperature of your screen according to your surroundings.
@toscho And then they wrote it white on black - hate such sites. Makes my eyes hurt.
and DONE. out of job for a while - expect progress on my personal projects. or depression.
anu
anu
18:00
@toscho I use flux - can't imagine not using it now
@Rarst congratulations
 
2 hours later…
19:34
@Rarst Finally! Well done mate... Great opportunity to work on some of those ideas we chatted about previously. I'm guessing you quit? Or did they fire you?
I still having trouble with this question:
0
Q: Custom Blog Post Page

JohnMerlinoI found this example here of creating a custom blog post page: http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-homepage-in-wordpress/ 1) I created a blog page under Pages > Add New 2) Under Template, I select "Blog" 3) Note that I created a blog.php file in my custom theme that has t...

none of the solutions provided have worked
and i am out of ideas
@userabuser sabbatical... as for ideas - bug me (much) later... "not now. rest then personal projects then finding meaning of life then maybe :)"
@Rarst you have any suggestions? I waited a month for a response, but none of responses worked
i added the code to the index.php, both in my custom template and the one directly within wp-content, and neither have done anything
@JohnMerlino How about answering @Milo question... ?
@JohnMerlino by any chance does theme have front-page.php ?
19:41
no, there is no front-page.php
this is a theme i created using a tutorial
I already have a home.php that corresponds to a home page. I wanted my blog.php to be a page that just shows the posts for the site.
ah, wait you are trying to get it for blog, not front...
problem is currently blog.php just shows all the posts and theres no commenting or anything and it is unformatted
right
blog.php
won't work
basically Home doesn't support custom template, only Front does
ok because i was following a tutoriual that claimed it would work.
why can't you just put the contents of blog.php in the template that's being used on your homepage?
19:44
setup your Front with custom page (what you are trying to do for Home) and use home.php for home
oh I get it nm
this is more or less what answers say by the way
you mean to use home.php for the blog posts?
yes
and use front as my home page?
19:46
that doesn't quite make sense for terminology WP uses
the reason why i used home.php for my home page is because well it is a home page, not a blog
use the template branch for front page
so basically name the front page something other than home, that is, the default landing page that gives overview of site?
easiest case - just create front-page.php and home.php. former would be your site, latter blog
i see
i will try it
19:48
this part of WP is confusing like hell :)
just stare at template hierarchy chart for a long time and some understanding will shine
20:00
@toscho posts 2 posts...beautiful thing. thx for that tip
20:38
@Rarst No problemo mate, I was just meaning pursuing your ideas (as in you, yourself)... Sorry if that read wrong. BUT I did end up writing some notes (further extended ideas) towards that one related WP-centric project we talked about... saw some (what I think to be) very good potential... but as you said, something to chew much later ;)
@toscho A picture is worth a 1000 words, in this case probably 10,000 less. Funny stuff man lol ;)
From wp-login.php:
	do_action('retreive_password', $user_login);  // Misspelled and deprecated
	do_action('retrieve_password', $user_login);
lol
When you want to hook into that very early … :D
20:55
Before I ask this question, is it possible to grab post meta from the first post in a wp_query with jquery and is that a SE question?
with jquery?
Well I have a music player that's triggered with jquery and it needs a custom field value from the first post in a loop in my template.
Well if you want to select a specific value after the page has rendered, using jQuery - then yes, of course, but thats a jQuery question, not WPSE.
1
Q: Why activate_plugin is not working in register_activation_hook

Ünsal KorkmazI am trying to activate second plugin automatically while activating first plugin. register_activation_hook(__FILE__, 'example_activation' ); function example_activation() { include_once(ABSPATH .'/wp-admin/includes/plugin.php'); activate_plugin('hello.php'); } Its not working ...

good question, but that corner of the code is such a mess I don't feel like looking... :)
Easiest way to do this is to give the first post in your loop a unique class i.e. like "first" then you can select a child element class such as "my custom field" which might for instance be a <span class="mycustomfield">value here</span>
21:03
@userabuser Ok i get it thx!
21:19
@Rarst - is it just me or is queryposts down...?
@StephenHarris down, looking
back again
just very, very slow
should be back, rebooted VPS
I need New Relic installed on my stuff...
21:34
@Rarst You've done a good job with queryposts. I didn't realise how annoying it is not being able to use it...
yay! :)
imagine how nice will it be when I get classes and hooks up :)
do you have any plan for the hooks?
yeah, that's why I am taking PHP_Reflect apart
hm. Hooks are poorly documented in source code.
for now... but for starters list, search and calling functions will be nice
21:41
@Rarst I know :)
@toscho +1 that's a mess
 
1 hour later…
22:46
@kaiser ...a thought! Have you looked at using Util.php (brandonwamboldt.github.com/utilphp/#arrays) array functions to iterate over arrays? Handy pre-built functions for many of the usual tasks we perform.
23:20
@userabuser quote a few of those functions exist in WP already - at least the non-array ones...
Would be handy if WP added more generic, but useful functions. I'm already building up a collection of functions I'm using time and time again
@StephenHarris Perhaps we should share at some stage (same applies to all), I use a internal helper class to reduce a lot of keystrokes when debugging and the like and I also use an external helper class in some of my projects.. always interesting to see what others have conjured up..
I have a swiss army knife post meta class for WP... should put it on github, but i know some people shun such abstracting of the WP API :D
23:36
@userabuser sounds like a good idea. I put some of my functions up as gist. But gists are somewhat hidden...
... I've also made some very niche functions. Like converting a php date format to XDate (arshaw.com/xdate) format
And there's this which makes a lot of sense

« first day (685 days earlier)      last day (4558 days later) »