Skip to content

Instantly share code, notes, and snippets.

<?php
$product_id = 111;
wp_remove_object_terms( $product_id, 'simple', 'product_type' );
wp_set_object_terms( $product_id, 'variable', 'product_type', true );
@Musilda
Musilda / gist:d79e49ae84839fa17d8689aa24951b96
Created October 11, 2023 03:25
gitignore-for-wordpress.txt
### WordPress Core ###
wp-includes/*
wp-admin/*
wp-content/uploads/*
wp-content/languages/*
wp-content/blogs.dir/
wp-content/upgrade/
wp-content/backup-db/
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
var actionUrl = 'action=tls_send_data&value1=value;
var request = new XMLHttpRequest();
request.open('POST', 'http://www.mysite.com/wp-admin/admin-ajax.php', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
request.onload = function () {
if (this.status >= 200 && this.status < 400) {
console.log( this.response );
// If successful
var value = JSON.parse( this.response );
<?php
$password = 'xxxxxxx';
$wsdlUrl = 'https://xxxxxx:xxxx/xxxx/CardServiceWs?WSDL';
$pemFilePath = PATHDIR . 'client.pem';
$pemPassword = 'xxxxxxxxxxxxx';
$contextOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
<ol>
<li>mu_plugin_loaded</li>
<li>muplugins_loaded</li>
<li>registered_taxonomy</li>
<li>registered_post_type</li>
<li>plugin_loaded</li>
<li>load_textdomain</li>
<li>elementor/loaded</li>
<li>woocommerce_helper_loaded</li>
<li>wpseo_loaded</li>
<?php echo wc_get_checkout_url(); ?>
<?php
add_action( 'pre_get_posts', 'apply_akce_query_filter' );
function apply_akce_query_filter ( $query )
{
if ( is_admin() ) {
return $query;
}
if ( is_single() ) {
<?php
add_shortcode( 'tatum_minted_address', 'tatum_get_minted_address' );
function tatum_get_minted_address() {
$html = '';
if ( !empty( $_GET['order'] ) ) {
$order_id = (int)$_GET['order'];
$order = wc_get_order( $order_id ) {
if ( is_object( $order ) ) {
//Orders
wc_get_account_endpoint_url( get_option( 'woocommerce_myaccount_orders_endpoint', 'orders' ) );
//Downloads
wc_get_account_endpoint_url( get_option( 'woocommerce_myaccount_downloads_endpoint', 'downloads' ) );
//Edit Address
wc_get_account_endpoint_url( get_option( 'woocommerce_myaccount_edit_address_endpoint', 'edit-address' ) );
//Payment Methods
<?php
add_filter( 'manage_shop_order_posts_columns', 'musilda_custom_order_column', 11 );
function musilda_custom_order_column( $columns ) {
$expanded_columns = [];
foreach ( $columns as $key => $value ) {
$expanded_columns[$key] = $value;
if ( $key == 'name' ) {