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
<?php | |
/** | |
* ITS Related Links | |
* | |
* The WordPress Widget Boilerplate is an organized, maintainable boilerplate for building widgets using WordPress best practices. | |
* | |
*/ | |
class ITS_Contact_Box extends WP_Widget { |
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
function wpsc_update_product_gallery_tab(obj){ | |
var output; | |
output = '<div id="wpsc_product_gallery">'; | |
output += '<ul>'; | |
for (var i = 0; i < obj.length; i++){ | |
output += '<li>'; | |
output += '<img src="' + obj[i].sizes.thumbnail.url + '">'; | |
output += '<input type="hidden" name="wpsc-product-gallery-imgs[]" value="' + obj[i].id + '">'; // new item to include hidden field with ID |
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
<?php | |
/** | |
* filter the query args in `wp_link_query` | |
* to only show specific post types | |
* | |
* @param array $query the default args | |
* @return array $query the args with our new post type array | |
*/ | |
function rkv_filter_link_types( $query ) { |
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
<?php | |
add_action ( 'admin_menu', 'rkv_edit_admin_page_link_default' ); | |
function rkv_edit_admin_page_link_default() { | |
// call global submenu item | |
global $submenu; | |
// edit main link for posts | |
$submenu['edit.php'][5][2] = 'edit.php?post_status=publish'; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?php | |
function rkv_bypass_auto_update_email( $send, $type, $core_update, $result ) { | |
// check our type and bail if successful | |
if ( ! empty( $type ) && $type == 'success' ) { | |
return false; | |
} | |
// return the send function | |
return true; |
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
<?php | |
function rkv_limit_users_delete( $query ) { | |
// first fetch the screen | |
$screen = get_current_screen(); | |
// bail if we aren't on our user screen | |
if ( ! is_object( $screen ) || empty( $screen->base ) || ! empty( $screen->base ) && $screen->base != 'users' ) { | |
return $query; | |
} |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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
// the idea being that the container div exists outside of the | |
// dynamic element, and the anchor link is loaded. | |
jQuery( 'div.container' ).on( 'click', 'a.dynamic-element' function (){ | |
// do your thing here | |
}); |