This file contains hidden or 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 | |
// on favorite | |
add_user_meta( get_current_user_id(), 'tca_favorites', get_the_ID() ); | |
// retrieve | |
$faves = get_user_meta( get_current_user_id(), 'tca_favorites', false ); | |
$faves = array_unique( $faves ); |
This file contains hidden or 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 get_header(); ?> | |
<article id="post-<?php echo get_the_ID(); ?>"> | |
<h1><?php the_title(); ?></h1> | |
<div class="entry"> | |
<?php the_content(); ?> | |
This file contains hidden or 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 | |
// replace the foreach loop on line 132 with this version: | |
foreach ( $this->get_children() as $child_id ) { | |
if ( ! is_int( $child_id ) ) { | |
continue; | |
} | |
$sale_price = get_post_meta( $child_id, '_sale_price', true ); | |
if ( $sale_price !== "" && $sale_price >= 0 ) { |
This file contains hidden or 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
INSERT INTO wp_usermeta | |
( user_id, meta_key, meta_value ) | |
SELECT | |
u.ID as user_id, | |
'szbl_favorites' as meta_key, | |
pm.post_id as meta_value | |
FROM | |
wp_postmeta pm, wp_users u | |
WHERE | |
pm.meta_key = 'start_email' |
This file contains hidden or 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
INSERT INTO | |
wp_usermeta ( user_id, meta_key, meta_value ) | |
SELECT | |
u.ID as user_id, 'szbl_favorites' as meta_key, pm.post_id as meta_value | |
FROM wp_users u, wp_postmeta pm | |
WHERE CONCAT( '_stcr@_', u.user_email ) = pm.meta_key | |
ORDER BY user_email |
This file contains hidden or 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
-- Run this on the cloned staging database (to become production) | |
UPDATE wp_options | |
SET option_value = REPLACE( option_value, 'http://stage.stuncreative.com', 'http://www.stuncreative.com' ) | |
WHERE option_value LIKE 'http://%'; | |
UPDATE wp_posts | |
SET post_content = REPLACE( post_content, 'http://stage.stuncreative.com', 'http://www.stuncreative.com' ); | |
UPDATE wp_postmeta |
This file contains hidden or 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 szbl_ssl_srcset_fix( $src_list ) | |
{ | |
foreach ( $src_list as $k => $src ) { | |
$src_list[ $k ]['url'] = set_url_scheme( $src['url'], 'https' ); | |
} | |
return $src_list; | |
} | |
add_filter( 'wp_calculate_image_srcset', 'szbl_ssl_srcset_fix' ); |
This file contains hidden or 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
{ | |
"total_count": 3, | |
"incomplete_results" : false, | |
"items" : [ | |
{ | |
"value" : 123, | |
"label" : "<strong>Person Name</strong><br>Phone: 410.444.1234<br>Fax: 410.555.1234<br>Email: [email protected]" | |
}, | |
{ | |
"value" : 456, |
This file contains hidden or 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
$( 'select.multiline' ).each(function($){ | |
var ajax_url = false, minInputLength = 3; | |
if ( $( this ).data( 'min-input' ) ) | |
{ | |
minInputLength = $( this ).data( 'min-input' ); | |
} | |
ajax_url = $( this ).data( 'source' ); ?> |
This file contains hidden or 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
-- | |
-- Update site options (URL redirect/permalinks) | |
-- | |
UPDATE wp_options | |
SET option_value = REPLACE( option_value, 'http://www.apexcovantage.com', 'http://www.apexengineering.com' ) | |
WHERE option_value LIKE 'http://%'; | |
-- | |
-- Update page/post content | |
-- |