« first day (1096 days earlier)      last day (4147 days later) » 

00:13
@kaiser someone has a case of the tuesdays hahaha. Cheer up mate, its another day out there tomorrow :)
 
9 hours later…
09:04
> @rarst and @toscho are both now working on developer.wordpress.org
laaate reaction! :)
 
3 hours later…
11:48
Just posted my second question ever on the site ... hope it isn't too stupid. :-)
@s1lv3r An explanation why you don’t just replace $wpdb or filter query would be useful.
@toscho I'm not sure I unterstand. You mean filtering the SQL with the posts_clauses_request filter?
well, that or filter 'query'.
12:05
@toscho I updated the question a bit, I hope it's now clearer. Thank's for your advice.
@s1lv3r query is the complete SQL query. You can do anything with it.
@toscho indeed, but wordpress needs to be able to handle what the query is giving back (if you don't plan to rewrite get_posts() ) ... :-(
indeed, WP_Query::get_posts() is a nightmare.
... first project on which I really needed to understand what is happening in there ... it's a hell to debug. :-|
Why do you need to overwrite it? Maybe it's a XY Problem.
12:17
@kaiser I did write it into the question why I wasn't able to achieve it with the filters in the original WP_Query ... only other way would be to totally do it outside of wp core ...
@s1lv3r In the posts_clauses or the later filters you can overwrite the complete query string.
@toscho ... it was even worse, when I first tried to filter the_posts to fetch and merge the other posts through calling another instance of WP_Query() ... - you can imagine what a kind of great idea that was. :-D
@kaiser yeah, I already was that far and builded a gigantic UNION query ... but I couldn't make get_posts() understand what was comming back from that query ...
So "Combining the result of multiple WP_Query-s" and "Let WP_Query set her internals based on a custom query" are the two questions you're actually having?
You're adding your custom query in the posts_clauses filter. Then $wp_query->found_posts, $wp_query->next_post, etc don't work anymore?
@kaiser nice link. :-P
12:33
@s1lv3r "(...) in the need of merging posts from different blogs in one query (...)" THAT won't end well.
Run a custom query and let go.
@kaiser Exactly! Not in one query.
Why the heck do you need to query from different blogs?
Only if I have a function which wraps the single queries and cares about merging them (i.e. solving ID conflicts etc.) that's what I'm using my extended class for.
@kaiser Project requierement .... actually this runs totally smooth. I just don't find a way to build it into the main query ...
You won't. Better do some queries and care about caching properly.
So you say I should forget about using the main_query and better build anything custom? Archive pages, post-search etc. ...
12:37
@s1lv3r You want a cross blog search?
Good luck :)
@StephenHarris I already have one, I just want to integrate it into the main_query ... :P
@StephenHarris ... it even allows advanced meta_query filters accross multiple blogs ... :-P
@s1lv3r yeah... multisite is like several independent sites. It doesn't work nice as 'sub-sites' of a parent site...
In short, you're better of starting from scratch :/
@StephenHarris That is no option anymore. :-)
So your boss said "WASTE ALL THE MONEEEY!" ? ;)
@kaiser na, my boss said just build it and didn't want to spend any time for conceptual phase. :-D
TBH it's 99% done ... and wordpress at all was a fail for it ... the customer doesn't care it looks and works nice and was done in time ... - but from a code viewpoint I just wouldn't do it with wp again. ;-)
But atleast I learned a lot of (basic) things ... for example I thought wordpress network sites have a seperate user base (somehow you read this alot), when I realized it doesn't I needed to spend a week to make it really have seperate user bases (like in different wp_users und wp_usermeta tables) ...
12:57
@s1lv3r You are aware you can set custom user tables depending on $_SERVER['HTTP_HOST']?
@toscho That's what I did in the end ... but it doesn't seem to be a really 'safe' feature, you still need to change all the backend functions to take this into account and it causes pretty strange issues with object caching ...
13:20
good morning
14:04
My talk for manchester interest group tonight
a little too much text (depends on how you will be displaying it), high on technical detail which depends on kind of people you have there :)
I had to go light on technical and hard on ecosystem for my WCEU talk
hmmm, text is mainly just demonstrative output
I thought I'd show them a most basic composer.json to identify a package
then introduce a dependency, then a theme, then a plugin
a lot of text is hard on projector :(
tho thirtythirteen is more intimidating
Otto had nice talk at WCEU but his slides were nearly useless on projector
14:11
did he wear a ballcap?
yes
14:25
i have a philosophical question (read: User Interface) and would like to throw an idea out there to see what others think...
I am preparing a site that will have filtering of Businesses by 2 taxonomy dropdowns: Community (city), and Activity (such as dining, museum, park, etc)
what i want is to have codependency between these two dropdowns such that either one may be used initially, but then the other updates. I know how to do this (i think), but not sure best way to do it so that the user understands what is happening.
oooh, throw out the dropdowns, use a different UI pattern instead
e.g. drilling down
typically in AJAX filtration you start with 1 dropdown and move linearly. For example: Choose Make => Ford; Choose Model => Focus; Choose Color => Red
Pick X then pick Y, where X and Y are one of your criteria in any order
ok so I am thinking Y is a dropdown still, and so is X. you choose X
I still think dropdowns are an awful way to go about it
14:28
interdependent dropdowns are confusing like hell
Back to my original example. I choose Community: Sycamore. Now the "Activity" dropdown shows: [choose an activity in sycamore] [ sports ] [ dining ]
or [sports (sycamore ) ] [ dining (sycamore) ]
so if not dropdowns, what?
I'd not depend them on each other. getting no results is less confusing than when dropdown sets change dynamically on you (and fail to change if anything happens to ajax request)
@GhostToast list of check boxes so the user can combine values with an OR clause
@Rarst i know. but client constantly asks for such thing
@toscho my only concern is aesthetically, this can become very cumbersome if there are many terms
you didn't expect us to validate your client's opinions, did you? :)
14:32
this isn't an amazon search result with sidebar necessarily. although i do like that option
it's a nightmare on freeagent when you pick from dropdown A, then pick from dropdown B, but dropdown B changes afte ryou've opened it and it's out of date, and nothing makes sense
@GhostToast ... make it wizzard style with AJAX?
unfortunately, i am being called into a meeting
client wants dropdown because client doesnt know any better and its all they can think of, they shouldn't be dictating your UX design
14:33
sorry guys. be back soon
If I want to play ping pong in Minas Morgul or Minas Tirith, I should be able to select both
and I have an interview at 4 so I'll be heading off in a few minutes
good luck
@TomJNowell Customers and clients atleast know what a dropdown is. Actually I have recently realized a lot of users don't get all the fancy javascript multi-select input elements ...
they never will, which is why I prefer drilling down through categories to picking them in a combo box or some over convoluted multiselect field
14:41
yeah, it's pretty bad when your ui elements look all fancy, but your users don't even realize it's supposed to be an input element at all ... (jqueryui.com/button/#checkbox for example) :-P
Looks like a bug. Even with a custom value for label 'not_found', I still see 'No items found.' instead of something like 'No subjects found.'
Anyone using custom taxonomies, could you please see if the same thing's happening to you?
(If you have a test site without any terms under the custom taxonomy, that is, or if you can delete them to check.)
nvm, looks like it's not what the label is for.
15:23
...
Does wordpress have a built-in function to convert normal numbers (1, 2, 3, ...) to ordinal numbers (1st, 2nd, 3rd... ) and words (first, second, third...)??
I want the number in custom field to be displayed as ordinal number/word
0
A: WPSE Scope: Minimum Competency Requirement

kaiserProposal: Meta Tags As I've seen that there're help tags used on SO (constantly pushed in their PHP chat), I could imagine that we use something similar, but a bit reworked: A list of new meta-tags, that have a tag wiki, explaining what's wrong. needs-info Please provide additional informatio...

ok i'm back
so if dropdowns are the devil, what is the better method?
@its_me i doubt wordpress does, but PHP probably does
@GhostToast I could find neither. :/
actually i found a funciton like that once. lemme see if i canf ind it
15:33
@kaiser thanks did not realize this existed
@GhostToast keep in mind that the only way to get good answers over there is to use a mock up/screenshot.
@its_me this wasn't that hard to find: stackoverflow.com/questions/3109978/…
PHP's native solution should probably work too if you are php 5.3+
@GhostToast Guess the difference was the search term you used :P
@GhostToast I'll give it a shot, thank you very much!
@its_me no problem. googling is a real skill lol. i searched for "apply st nth rd php numbers"
15:40
:)
16:22
@ChipBennett About your answer (wordpress.stackexchange.com/a/16111) on checking if a custom field is defined... can't we use metadata_exists instead?
I mean, is it any better?
@its_me well that's an old question/answer...
Context?
@ChipBennett Checking if a custom field has a value defined
@ChipBennett Yes, just wanted to know if metadata_exists better for the if/else checking
or it doesn't matter?
Given that metadata_exists() is a brand new function in WP 3.7-beta...
It appears to be fine to use :)
@ChipBennett Oops! :P Thought it was introduced in 3.3.x. stackoverflow.com/a/13816155
probably got delayed
oops... I need more coffee
What I'm reading says source not since derp
nobody bothered to add it to the Codex function reference
16:32
@ChipBennett Hmm... so considering that it exists, is if( metadata_exists( ... ) ) {...} better for the purpose than if( ! empty( get_post_meta( ... ) ) ) { ... }
define "better"...?
I meant, does it matter what I choose to go with? (e.g. "No, don't do it this way; performance sucks.")
so, "better" = performance?
yes
in this instance
I'm not seeing much performance difference at first glance. They're both relying on get_post_meta() for post post-type
but performance at that level is not really my area of expertise
16:36
@ChipBennett ok. I really only wanted to be sure that I wasn't taking the "No! No!" route. Thanks! :)
WordPress usually has lots of ways to do the same thing; it's not always the case that one way is demonstrably preferable to another
usually, as long as you're avoiding functions intended to be used internally, you're probably okay
 
1 hour later…
17:45
0.2.0 out now @kaiser (same features, but 35 files instead of 1, 1900 lines instead of 1000) still refactoring... github.com/Giuseppe-Mazzapica/CleverRules
@G.M. nice!
ya that does look nice^
Does it work when you drop in into the plugins folder, @G.M. ?
@kaiser it seems
:)
Cool! :)
Notes:
1. Add defined( 'ABSPATH' ) or exit to the head of your files. Prevents direct access
2. No need to define a plugin path constant. You can simply use plugin_dir_path( __FILE__, 'your/path' ); everywhere
3. If you need to load all files from a folder: foreach( glob( 'path' ) as $file ) include $file;
17:51
no, not everywhere, in file 'inside' folder plugin_dir_path( FILE, 'your/path' ) refers to file folder
Try it
@G.M. var $replacements; is PHP 4. Please use public $replacements;. :)
i've used var? really? where? :)
lolz... everyone jumping in with suggestions to make it better :)
17:53
Anyway, it really looks great!
@G.M. Url
@toscho @kaiser was night and 3 chars semmes better than 6 :P joking, it's a bad habit...
@kaiser, thanks
Another thing:
public function foo()
{ #<-- !!!
    // bar
}
No, really, it looks great. Very readable!
Having problems with #WordPress and rewrite rules? Meet #CleverRules https://github.com/Giuseppe-Mazzapica/CleverRules for a sane approach.
I know it's the right way, but i don't like braces in that way. I can't read my code fluently if I use braces on new line
UAU @kaiser, thanks!
@G.M. No auto-loader?
@toscho. I'm always afraid of autoloader in WordPress. 2 autoloaders (if another plugin has one) doesn't conflict?
17:59
no
Use composer autoloader
Composer is perfect. In laravel is life saving. but I think is too early for that in WP. Maybe I'm wrong
2018
@G.M. not too early for you in WP. just stop limiting yourself to lowest WP baseline experience :)
@G.M. Posted it to poststat.us as well.
@G.M. listen to @Rarst . We're already at the point where we must let go all the old bad habbits and PHP versions.
18:06
@Rarst have you notice system if anyone type 'composer' in this site? :P Joking. Maybe is time for composer... way to version 1.0 is still long...
way to version 1.0?
now 0.2, version 1 for me is when I remove the 'beta' from title @kaiser
Car manufacturers make it the same. Alpha = Beta = RC -> push to client, see what happens :D
this week I want to make it more clean in some parts. Then I'll use for my pourpose .. I will change something for sure while using. When I'm happy with it, I remove beta. I hope in that moment I'll not the only one who has tested it :D
18:46
@G.M. Im about to give a composer talk =]
T MINUS 10 MINUTES
@TomJNowell Good luck!
@TomJNowell where?
MWUG
this is Mike little land
19:12
Presented without comment:
There is no code yet. I need to query the author custom post type that has the same name as the book's taxonomy. Suggestions are welcome. — Troy Templeman 4 mins ago
19:24
@toscho you are on Windows right? I wrote that in issue/rant in GitHub then it hit me I don't clearly recall that :) I don't clearly recall a lot of WCEU :)
yes
ok, hadn't embarassed myself with memory hole, winning
Sometimes, I think a single close would be enough: Your question sucks.
@ALL What was the online service to check if some site is online
although I often skip that step and go straight for redbot.org and extra info
19:35
thanks
19:53
hadn't used that one before @Rarst, i've always used downforeveryoneorjustme.com but they look pretty much the same
yeah, there are plenty like that around :)
i use terminal
though i guess that could fall under the "or just me" context
Point is that you want to know if it doesn't work elsewhere too
Or ask on Twitter :)
..or fly a plane to another location and test
where's Tom speaking?
20:02
@GhostToast I also use terminal
Lynx that is:)
Is this an okay way of writing a function? (functions.php)
function aahank_book_edition_format() {
	global $post;
	if ( $post->post_type == 'aahank_book' ) {
		$edition_number = get_post_meta( $post->ID, 'test_edition', true );
		$number_format = numfmt_create( 'en_US', NumberFormatter::ORDINAL );
		return numfmt_format( $number_format, $edition_number );
	}
}
I mean, should I change it so that there's a return; for else, or something like that, or is it fine the way it is?
@its_me First, test if $post is actually a post object
What if get_post_meta() returns an empty string?
Second, return early when the guard ($post->post_type == 'aahank_book') fails
@ChipBennett it won't. it's a personal blog :D (I intentionally avoided it as it's required to be filled in my case.)
20:15
I'd still protect against that
@its_me always write portable code
@ChipBennett and @toscho Got it! I'll add it up then :)
@toscho I was wondering how...
function aahank_book_edition_format()
{
	global $post;

	if ( ! is_a( $post, 'WP_Post' ) )
		return '';

	if ( $post->post_type !== 'aahank_book' )
		return '';

	$edition_number = get_post_meta( $post->ID, 'test_edition', true );

	if ( ! $edition_number )
		return '';

	$number_format = numfmt_create( 'en_US', NumberFormatter::ORDINAL );

	return numfmt_format( $number_format, $edition_number );
}
@toscho Thank you very much! Learnt some stuff. :)
Also: if ( 'aahank_book' !== $post->post_type )
20:22
@ChipBennett ? It's there in the fixed code that toscho provided above.
You want it to be the other way around?
indeed, the variable should stay on the right side
yoda conditions
oh! ok
Not much of a risk when the comparator is not-equal; but good practice to get into anyway
Reads like an episode of CSI. Everyone saying the obvious and repeating each other :D
20:23
done!
20:38
@toscho When you said, *"test if $post is actually a post object" did you mean to check if it's within the loop? In that case how about I do something like this?
if ( ! is_a( $post, 'WP_Post' ) )
	$post = get_post( $post );
@its_me other code can overwrite or unset the $post object, because it is a global variable. So your get_post() wouldn’t change anything.
Oh :P
@toscho Last question (please take your own time). Does "return early" apply everywhere? For example, isn't this:
add_filter( 'option_default_post_format', 'aahank_bookmark_post_format' );
function aahank_bookmark_post_format( $format ) {
    global $post_type;

    if( $post_type == 'aahank_bookmark' ) {
        $format = 'link';
    }

    return $format;
}
simpler than something like this:
add_filter( 'option_default_post_format', 'aahank_bookmark_post_format' );
function aahank_bookmark_post_format( $format ) {
    global $post_type;

    if ( 'aahank_bookmark' !== $post->post_type )
        return $format;

    $format = 'link';
    return $format;
}
the last two lines in the second code are too long: return 'link'; would be enough
plus, the second code is broken, and I have no idea where $post_type comes from
@toscho It's a filter. And here I thought a highly upvoted answer would be correct :-/ wordpress.stackexchange.com/a/72030/10691
I can do this though:
$post_type = get_post_type_object( $post->post_type );
After the check that tests if "$post is a post object" (from the code you gave earlier)
20:56
@its_me risky. if the option is called in any other page than wp-admin/options-writing.php, the global variable $post_type is probably empty.
@toscho Hey, that's function is for wp-admin
see the filter I am using: add_filter( 'option_default_post_format', 'aahank_bookmark_post_format' );
anyway, I have to stop now, can't type anymore
no problem, thank you.
problem: i have plugin that needs early hooks (wp_loaded, wp_enqueue_scripts) but would prefer to only load it on certain pages...
i dont think plugin can know what $post->ID is...
enqueue is not early
21:08
global $post; var_dump($post) returns NULL
look at query, $post is crap
@toscho Worked on it for a bit and ended up with this. (To make it easy for you -- please type 'G' for good, or 'N' to say you suck!)
add_filter( 'option_default_post_format', 'aahank_bookmark_post_format' );
function aahank_bookmark_post_format( $format ) {
	global $post;

	if ( ! is_a( $post, 'WP_Post' ) )
		return '';

	$post_type = get_post_type_object( $post->post_type );

	if ( !is_object( $post_type ) || 'aahank_bookmark' !== $post->post_type )
		return $format;

	return 'link';
}
@Rarst queried_object_id points to nothing
how may i know what page i am viewing?
is_page()
@Rarst my page check is much happier in the wp_enqueue_scripts hook than wp_loaded
derp
21:42
22:05
Rarst and Toscho aren't here, gif time!
5
lol
not at the gif itself, but at the ability to gif now that they're not here
something i put together with assets from the android game: pixel dungeon
peace out
wow you make your own /clap
When they come back, it will look like Christmas: blink and shine! Or like the games-SE chat room.
22:09
Be prepared when Andrey comes back
lol
wpse experience
haha
Can't say it often enough: When Andrey comes back, be prepared.
I'm so close to opening chat on cellphone just to see it crash
we can snare him inside The Loop
CALLBACK HELL!
22:16
using query_posts
ok ill stop:)
When Andrey comes back...
@Wyck I'm so tweeting you
@userabuser psst! you're missing the paaaaarty!
retweet loop!
Btw, have you all seen TOSCHOs new site?
nice to see he is into java
currently he is into bed
oooooh
22:30
@kaiser, @wyck what happens if you know who comes home and sees you doing this?!
I haven't thought about that before...
you will have to join us and find out
No, I've already been told off for posting this:
oops.
haha
anarchy!
when "they" get back
@kaiser You're getting your gif on without me!!!!!
22:41
oh oh another soldier in the gif army
Someone got a movie recommendation?
22:57
I just watched hot rod, few years old but I thought it was funny

« first day (1096 days earlier)      last day (4147 days later) »