Skip to content

Instantly share code, notes, and snippets.

View taricco's full-sized avatar

taricco

  • Seattle, WA
View GitHub Profile
@taricco
taricco / 0_reuse_code.js
Created November 1, 2016 17:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
CSS
@media (max-width:992px) {
.fl-sticky-on-mobile {
position: fixed !important;
width: 100% !important;
left: 0 !important;
top: 0 !important;
z-index: 9999 !important;
border-top: 0 !important;
@media(min-width:768px) {
#wpadminbar {
opacity: 0;
transition: all 0.5s ease;
}
#wpadminbar:hover {
opacity: 1;
}
body.admin-bar {
.fl-row-full-height .fl-row-content-wrap {
min-height: calc(100vh - 282px);
}
function replace_text_wsv($text){
$replace = array(
// 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS'
'Find This' => 'Replace With This',
'Find This' => 'Replace With This',
'Find This' => 'Replace With This'
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
function wsv_filter_query($query, $error = true)
{
if ( is_search() ) {
$query->is_search = false;
$query->query_vars[s] = false;
$query->query[s] = false;
if ( $error == true )
$query->is_404 = true;
}
}
add_filter( 'wp_handle_upload_prefilter', function ( $file ) {
$uploads = wp_upload_dir();
$use_yearmonth = get_option( 'uploads_use_yearmonth_folders' );
if ( boolval( $use_yearmonth ) ) {
// if upload to year month based folders is enabled check current target
$year = date( 'Y' );
$month = date( 'm' );
$target = $uploads['path'] . DIRECTORY_SEPARATOR . $year . DIRECTORY_SEPARATOR . $month . DIRECTORY_SEPARATOR . $file['name'];
} else {
// uploads dir
04-11-20
a.button {
background-color: transparent;
}
.woocommerce a.button {
background-color: transparent;
color: #FF984F;
border: 1px solid #FF984F;
border-radius: 10px;
add_action('wp_logout','auto_redirect_after_logout');
function auto_redirect_after_logout(){
wp_redirect( home_url() );
exit();
}