Which action/filter can i use for a Member Plugin [closed]

You could try this: function restricted_access() { if( ! is_user_logged_in() ) { global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( ‘wp’, ‘restricted_access’ ); By default, always, if the user is not logged in it will give them the 404 page. The following two functions will keep non-admins out of your Admin Panel and will also hide … Read more

How to display search query as formatted text?

You’ll probably want filter out some parameters, change the order they’re displayed, etc – but this should get you started: $s = “/?s=Search&property_city=las-vegas&property_location=Nevada&min_price=20000&max_price=500000&beds=2&baths=3&min_area=1000&max_area=1000000&property_type=apartment&s=Search&apor=Any&apvr=Any&post_type=property”; parse_str($s,$parts); foreach ($parts as $key => $value) { $name = ucwords(str_replace(“_”,” “,$key)); echo “$name: $value<br />\n”; } You can probably just use foreach ($_REQUEST as $key => $value) { unless there’s a … Read more

Can I use $query->set() (in a pre_get_posts() hook) with a custom taxonomy in WP 3?

For what it’s worth, I just gave up on the ‘__not_in’ approach and went with the following somewhat sneaky solution: //Create the exclusion rule $new_tax_query = array( array( ‘taxonomy’ => ‘x_category’, ‘field’ => ‘slug’, ‘terms’ => array(‘y-slug’), ‘operator’ => ‘NOT IN’, ) ); //If there is already a tax_query, ‘AND’ our new rule with the … Read more