Get options from database using php class

If you have registered your option without setting the fourth parameter $autoload to no your calls to get_option will not trigger any extra database call because all aotoload options are stored in the cache when the site is loaded. To test it add … define( ‘WP_DEBUG’, TRUE ); define( ‘SAVEQUERIES’, TRUE ); … to your … Read more

Custom menu: Link names

You can add other classes to individual menu items manually. Within the Appearance->Menus page, click Screen Options in the top right corner. You will see a menu that looks like this: Check off CSS Classes and it will give you an extra form field per page item. Adding a custom class will allow you to … Read more

altering search terms

You can use parse_query: function wpa64292_parse_query( $query ) { if( isset( $query->query_vars[‘s’] ) && !empty( $query->query_vars[‘s’] ) ) $query->set( ‘s’, prepSearchStr( $query->query_vars[‘s’] ) ); } add_action( ‘parse_query’, ‘wpa64292_parse_query’ ); Note that it won’t alter the query string you see in the browser, but if you echo get_query_var(‘s’) in your template you’ll see it’s been altered.