This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Account menu items. | |
* | |
* @param arr $items | |
* | |
* @return arr | |
*/ | |
function swd_account_menu_items($items) | |
{ | |
$items['profile'] = 'Profile'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Negative lookahead based rule: | |
RewriteRule ^products/(?!certain-category).*$ http://shop.newurl.co.uk/ [NC,L,R=301] | |
(?!certain-category) is a negative lookahead that will fail the match if certain-category comes right after /products/ in URL. | |
RedirectMatch 301 /products(.*) http://shop.sunwise.co.uk/ | |
Redirect 301 /shop http://shop.sunwise.co.uk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adding Custom Images Sizes to the WordPress Media Library | |
* | |
* @access public | |
* @param array $sizes | |
* @return array | |
*/ | |
function shgist_add_image_sizes($sizes) { | |
$addsizes = array( | |
"new-size" => __( "New Size") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Modify the WordPress post object | |
* | |
* @param obj $post_object | |
* @return obj | |
*/ | |
function shgist_my_the_post_action( $post_object ) { | |
// modify post object here | |
} | |
add_action( 'the_post', 'shgist_my_the_post_action' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get child pages | |
* | |
* @access public | |
* @return array | |
*/ | |
function shgist_get_child_pages() { | |
global $post; | |
$args = array( |