# Make sure you are using arm64 executable
> file `which php`
/opt/homebrew/bin/php: Mach-O 64-bit executable arm64
# Install
> arch -arm64 pecl install xdebug
<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> |
import ytPlayer from './ytplayer.js'; | |
// Find players from DOM and load if found | |
const players = document.querySelectorAll('.youtube-player'); | |
players.forEach(player => new ytPlayer(player, { | |
height: player.dataset.height ? player.dataset.height : 1280, | |
width: player.dataset.width ? player.dataset.width : 780, | |
autoplay: player.dataset.autoplay ? player.dataset.autoplay : false, | |
videoId: player.dataset.videoId ? player.dataset.videoId : false, | |
})); |
<?php | |
// This requires the WP Smart Crop plugin | |
// Get the thumbnail ID | |
$thumbnail_id = get_post_thumbnail_id( get_the_ID() ); | |
// Check if the crop is enabled on the thumbnail and get the dimensions | |
$crop_dimensions = get_post_meta( $thumbnail_id, '_wpsmartcrop_enabled', true ) ? get_post_meta( $thumbnail_id, '_wpsmartcrop_image_focus', true ) : []; | |
// Add percentage to dimensions and reverse array (top comes first in array) |
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.
{"lastUpload":"2021-09-27T08:49:19.837Z","extensionVersion":"v3.4.3"} |
Use WP CLI to reinstall everything when there's a possibility that the site is hacked and could include some malicious code. Also be sure that you download/deploy fresh copies of plugins and themes that aren't hosted in the WordPress repositories
Use --skip-content
to not download default themes/plugins.
Dont do this if wp installation is any way customised, bedrock etc
wp core download --force --skip-content
Katselmus on tehty WP/Woofi -facebookryhmässä silmiin osuneesta koodista alkup. tekijän luvalla.
Tulee kokoajan tilauksia, joita perutaan paljon koska ei pystytä pitämään kiinni toimitusajoista. yli 9000 tuotetta ei pystytä oikein manuaalisesti päivittämään käsin joten tein pienenpienen (36 riviä) function joka selkeyttää Woocommercen stock statusta huomattavasti.
Jos saldo on:
< 0
= Tilaustuote alla lukee Nkpl jälkitoimituksessa
<?php | |
/** | |
* Echo stock amounts for a product depending on the local and wholesale stock | |
* quantities and possibly add wholesale information. | |
* | |
* @param int $product_id Product ID (optional) | |
*/ | |
function show_stock( $product_id = 0 ) { | |
$product_id = $product_id ? $product_id : get_the_ID(); |