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
<div class="card"> | |
<?php if ($args['link']) : ?> | |
<a href="<?php echo esc_url($args['link']); ?>" class="global-link"> | |
</a> | |
<?php endif; ?> | |
<div class="card-image"> | |
<?php wp_get_attachment_image($args['image']); ?> | |
</div> |
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 | |
if ( ! defined( 'WP_CLI' ) ) { | |
print "Run with wp eval-file wp_collate.php\n"; | |
exit; | |
} | |
global $wpdb, $table_prefix; | |
$wp_config_path = \WP_CLI\Utils\locate_wp_config(); |
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
SET @site_id = 1; | |
SELECT user_id | |
FROM wp_usermeta | |
WHERE meta_key = CONCAT('wp_', @site_id, '_capabilities') | |
AND meta_value LIKE 'a:1:{s%' | |
HAVING user_id NOT IN ( | |
SELECT user_id | |
FROM wp_usermeta | |
WHERE meta_key LIKE CONCAT('wp_', @site_id, '_capabilities') |
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
setuzi | |
golaci | |
cobisy | |
ruzajy | |
dubevi | |
gikicy | |
gisuxy | |
sotypi | |
loxela | |
kugaxa |
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
/* Delete usermeta that nas no related user in users */ | |
DELETE FROM wp_usermeta WHERE wp_usermeta.user_id NOT IN (SELECT ID FROM wp_users); |
Flywheel Local has XDebug installed by default if you choose “Custom” instead of “Preferred” when setting up a new local environment. If you don’t know which your current site is running, you can detect it by going to ”Site Setup” tab. If you can change the PHP version there, you have the “Custom” environment running. If not, just export your site, import it back and choose “Custom”.
Now that we have the right environment, remember what PHP version you are running, open the right PHP settings file (for example /Local Sites/my_site/conf/php/7.0.3/php.ini
) and add these lines in the [Xdebug]
section:
xdebug.remote_enable=1
xdebug.remote_autostart=1
Save the php.ini and restart your site container in Flywheel to apply new settings.
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
add_filter( 'gettext', 'debug_translations', 30, 3 ); | |
function debug_translations( $translated_text, $text, $domain ) { | |
if ( $translated_text ) { | |
$output = $translated_text; | |
$output .= '<span style="font-size: 18px; color: white; line-height: 1; background-color: red; width: 24px; padding: 3px; border-radius: 18px;" title="text-domain: '; | |
$output .= $domain; | |
$output .= '">�</span>'; | |
} | |
return $output; | |
} |
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
/** | |
* Add support for correct UTF8 orderby for post_title (äöå) | |
* | |
* @param string $orderby ordering clause for query | |
* | |
* @return string ordering clause for query | |
*/ | |
add_filter('posts_orderby', function($orderby) use ($wpdb) { | |
if(strstr($orderby, 'post_title')) { |
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
/*-------------------------------------- | |
Woocommerce - Allow Guest Checkout on Certain products | |
----------------------------------------*/ | |
// Display Guest Checkout Field | |
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
function woo_add_custom_general_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; |
NewerOlder