Skip to content

u/milomilo

In this archive from Jun 2010 to Aug 2012

0
posts
1.6k
comments
0
media
3.1k
score

Top comments

a few of these are good for reducing server load, the parent/start/adjacent stuff will eliminate some queries.

removing the l10n script will break internationalization / translatable strings, and wp_localize_script to pass data from php to js scripts, which I use in just about every theme I build, so that to me is bad advice.

some of it is just pointless security through obscurity, people looking to exploit WordPress core or plugin vulnerabilities don't go around the web looking at page source to find WordPress installs.

12 points

if the only reason you're doing this whole convoluted query is to enable all post types, here's a much simpler way using the default query:

function category_set_post_types( $query ){
	if( $query->is_category ):
		$query->set( 'post_type', 'any' );
	endif;
	return $query;
}

add_action( 'pre_get_posts', 'category_set_post_types' );

you can get rid of the whole WP_Query stuff and just use the regular loop. you're also not wasting db resources this way by discarding the default query.

10 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.