« first day (876 days earlier)      last day (2351 days later) » 

12:01 AM
poking...
poked
 
thanks
Strange: I get two notifications for new mentions now, but there is nothing in my inbox.
 
@toscho @Shog9 says try now
 
@toscho heck, imagine the flame they would get if they complied with something that broad :)
 
12:53 AM
@Wyck it and many of its successors e.g. rpgmker 2003 2005 and some more came out, still in use today probably
 
1:06 AM
Great, I am locked out again.
 
 
2 hours later…
2:53 AM
^ good link
 
 
1 hour later…
4:25 AM
@Rarst Yep. I am purchasing PHP Storm.
 
 
1 hour later…
5:37 AM
Greetings. Would any of you fine developers be kind enough to tell me why this is not working?
0
Q: Filter Shortcodes when using get_page

AliyahI'm using the following line to show content from one page on another. This line outputs the content's raw text of a shortcode: <?php $id=3934; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content; ?> How can I add to or filter this snip...

 
 
2 hours later…
8:05 AM
@toscho I've noticed that you often use static classes. Are there any benefits in using static classes over constructed classes?
 
9:00 AM
How do I use is_feed() to target a category feed? Anyone?
 
@bungeshea in WP static classes are often used for code organization in kind of fake namespaces. it's not "real" OOP, just encapsulation from global scope
 
9:41 AM
@01100001 ask on main
 
@Rarst ok (I am searching as we speak so as to avoid a dupe. Don't think there are any, so I'll post the question.)
 
 
3 hours later…
12:34 PM
@01100001 The problem is that you aren't closing your while loop.
 
1:08 PM
Somehow stupid that we only have one search.php template and nothing contextual for CPTs, etc.
 
1:20 PM
@kaiser yep, late realization
 
@bungeshea classes can't be static. There're interfaces, abstract, normal and final classes. But if you were talking about static initializing, then the "only" benefit is, that you set the class itself inside the init function to a static (and therefore persistent) variable and question if it was already set. This saves you from running the init procedure multiple times.
14
A: Should all plugins be encapsulated in a Class?

hakre When developing a plugin should the functions be grouped together into a Class to avoid namespace conflicts? Yes, but that's only one of the minor arguments. In-fact that's not the "true" nature of a class in OOAD. Does using classes create performance overheads for PHP? No, not notabl...

 
2:16 PM
Can't ask this (code review-type) question on the main site, so if anyone can take a look, that would be great.
Here's the thing. I am modifying the loop of a custom taxonomy ('edition') to include posts not assigned to any specific term in the custom taxonomy to be shown under all these terms. Here's the function (in part i.e. code only for one term) I am using in my theme's functions.php.
The problem is, it redirects the custom taxonomy term's feed back to the term archive page. So, for instance, example.com/edition/usa/feed/ redirects back to example.com/edition/usa/. I've checked, there are no syntax error either. Does anyone know what I am doing wrong?
 
@01100001 you should read line #6 loud to yourself.
@userabuser @anu You here? Got a conceptual question and need some help.
 
2:30 PM
@kaiser Yes, I know something's wrong with that line. Don't know what. Here's what I think it represents: If page is custom taxonomy term archive OR feed of the custom taxonomy tag archive, do the following.
Am I wrong?
 
@01100001 yes, you're wrong. read that carefully. Replace || with OR and && with AND.
 
@kaiser Ah! It's based on this answer for the question I asked earlier today. Is the answer wrong?
 
@01100001 why did you mark it as solution if you don't know if it's the solution?
 
@kaiser Well, it worked. But I just realized the bug
 
well, you didn't take 1:1, so it's your bug :)
 
2:34 PM
I undid it
 
if ( $query->is_tax( 'edition', 6 ) || $query->is_feed() && $query->is_tax( 'edition', 6 ) && $query->is_main_query() )
Now re-read that loud
And type it in here in plain English words.
 
@kaiser OK. If I understand it right, this is the wrong part: $query->is_feed() && $query->is_tax( 'edition', 6 )
I am pretty sure of that
 
facepalm
33 secs ago, by kaiser
And type it in here in plain English words.
 
:P OK
 
Don't jump around and try to talk about some guess weather something is a problem or not. Please just do what I ask you. Trying to guide you towards something that works.
 
2:37 PM
yeah, yeah... I am typing
If the current page being queried is the archive of the term (id 6) of the custom taxonomy ('edition'), OR if the page being queried is a feed AND the archive of the term (id 6) of the custom taxonomy AND it's the main loop, then do the following.
@kaiser that's how I understand it. Let me guess, I am wrong.
:-/
 
> OR if the page
that's where you're mislead. There's no second IF in there. It's just OR. Now please retype while keeping that in mind.
 
:D
@kaiser But it's all inside one IF
Ok, I will retype
 
Yes. And that's why there is no second "if" in there.
And please use line breaks. [CTRL] + [ENTER]
 
**IF** the current page being queried is the archive of the term (id 6) of the custom taxonomy ('edition'), OR the page being queried is a feed AND the archive of the term (id 6) of the custom taxonomy AND it's the main loop, then do the following.
@kaiser Not working. I tried.
 
Now please use line breaks, so every condition is on it's own line. And please stop trying unless we're finished. :)
 
2:42 PM
Ah!
IF
the current page being queried is the archive of the term (id 6) of the custom taxonomy ('edition')
OR
the page being queried is a feed
AND
the archive of the term (id 6) of the custom taxonomy
AND
it's the main loop
Then do the following
 
IF the current page being queried is...
    the archive of the term (id 6) of the custom taxonomy ('edition')
    OR the page being queried is a feed
    AND the archive of the term (id 6) of the custom taxonomy ('edition')
    AND it's the main loop
THEN...
 
@kaiser OH MY!
 
now let's re-order this...
IF the current page being queried is...
    the archive of the term (id 6) of the custom taxonomy ('edition')
    AND the archive of the term (id 6) of the custom taxonomy ('edition')
    OR the page being queried is a feed
    AND it's the main loop
THEN...
What do you see?
 
So, there's the grouping missing! Am I right?
 
nope. read it LOUD
so?
 
2:49 PM
;-(
Let me try...
 
Compare the first one I posted with the second one I posted and read the line in between...
 
typing...
Since the first two lines are just the same, it's as good as one. So, now that might translate to:
IF the current page being queried is
    the archive of the term (id 6) of the custom taxonomy ('edition')
    OR the page being queried is a feed
    AND it's the main loop
THEN...
 
check! ... you got it.
 
Tell me if I am wrong. So it says, "check if (it's either the archive for the term or a feed) AND (if it's the main loop) THEN...
If that's right, then it's NOT what I want to do.
 
Yeah, that's one problem. But let's do something else first.
And no, that's not right. You're missing the brackets in your code.
 
2:56 PM
hmm, yeah
 
First, you shouldn't define any conditions when to do something. You should better define conditions when to abort.
So if your conditions aren't met, just go and return $query.
 
ok
 
If one condition, let's say $query->is_main_loop() isn't met, then return immediately. Then go and check the next condition or condition set and so on.
 
...
ok
 
Right.
if ( ! $query->is_main_query() )
    return $query;
for example.
Just a note: I'm really not interested in your specific problem, so I didn't read your goal. I'm just trying to tell you a more sane and easier process: Do it step by step.
 
2:59 PM
ok
I think I can fix this now
 
Then there's a final note as I just read your code again.
You're writing one array() that is called/set to $args.
 
yes
 
And you're then assigning this array as the query_vars. Now the query_vars is a pretty large object. And you're basically overwriting the data in there and just adding your custom ones. This means that you 'unset' everything that is added per default.
 
oh!
@kaiser I wrote that based on this answer: wordpress.stackexchange.com/a/76573/10691
 
$wp_query is an object. This means it's a class. And this class has methods (as functions are called inside classes). So you can check a value inside the $query object with $query->get( 'some_key_name' ); and set it with $query->set( 'some_key_name', 'some_value' );.
 
3:03 PM
@kaiser I've got a better way. I will go with $query->set() then.
@kaiser Yeah, yeah
I will go with that
@kaiser thanks a lot for your time. I've now got the two things into my head, and will fix 'em right away!
 
Fine. Glad to hear that it was of some help.
 
:)
 
 
2 hours later…
5:15 PM
Q: How to get all taxonomies that are assigned to a specific post type?
array_keys( wp_list_filter( $GLOBALS['wp_taxonomies'], array(
	 '_builtin' => false
	,'object_type' => array( 'some_post_type' )
) ) )
wp_list_filter() really rocks hard.
 
5:39 PM
...aaaaand I just realized that I forgot about get_taxonomies(), which is a wrapper. head > desk
 
 
1 hour later…
6:49 PM
Got a gimme free private support email today. In Comic Sans. Of course.
 
 
2 hours later…
8:22 PM
forgot how to use svn or remembering how much it sucks..
 
 
3 hours later…
10:56 PM
@kaiser I'm back, how you doing...?
 
@userabuser fine, thanks. already beyond the problem :)
@userabuser how you?
 
I'm well my friend... long weekend here, catching up on some work...
@kaiser curiously, what was your problem... (always interested in your adventures:) :D
 
11:12 PM
@userabuser Explained it to @toscho earlier (who - of course - brought me to a solution).
 
cool...
 
I got a custom post type that has several custom taxonomies attached. The taxonomy-{$taxonomy}.php archive template has a search form.
 
toscho - brings good questions to solution and bad to tears
 
@kaiser I have project that has similar structure now, trying to work out best way to handle search and advanced queries efficiently...
 
but the real fun is fixing bad questions with good answers.
 
11:14 PM
lol
 
And this search form features a drop down for each non hierarchical taxonomy. It also got a hidden input field that has the post type as value to exclude other post types. Now I fired that form and the query was mislead and thought it was as well a post type archive. This set $wp_query->is_post_type_archive to TRUE and shot the wp_title() function in my header.php file. Question was how to get the custom post type in without intercepting the post type archive boolean.
 
...drum roll for answer
 
kaiser learned typing in drama class.
 
@userabuser Pluign @Pastebin.
 
sweet
 
11:54 PM
query_posts() by hakre :)
Hm. Now I moved in hierarchical taxonomies and run into the next problem.
How would I set the ID/name in a way, that I get the tax_query string set right. Currently I use $taxonomy_name[ $term_slug ], which produces an array of terms assigned to the $wp_query. The query itself expects it as string. Either comma delimited or separated through +es. Example: term_a+term_b+... or term_a,term_b,term_c,....
 

« first day (876 days earlier)      last day (2351 days later) »