This file contains 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 | |
add_action( 'restrict_manage_posts', function () { | |
global $wp_filter; | |
$action = 'restrict_manage_posts'; | |
$priority = 11; | |
$method = 'add_seo_filters'; | |
if ( empty( $wp_filter[ $action ]->callbacks[ $priority ] ) ) { |
This file contains 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 | |
/** | |
* Plugin Name: Rank Math SEO plugin cleanup | |
* Description: A cached translation override for WordPress. | |
* Author: Artem Abramovich | |
* Plugin URI: https://gist.github.com/artikus11/0d7a52273bd8bdc85f0d3010f156cd5f | |
* | |
* @link https://rankmath.com/kb/filters-hooks-api-developer/ | |
* | |
* @see https://gist.github.com/timbowen/c5c00667c4c48f8ec3f5706b686d6f00 |
This file contains 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
const path = require( 'path' ); | |
const glob = require( 'glob' ); | |
const defaultConfig = require( "@wordpress/scripts/config/webpack.config" ); | |
const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' ); | |
const CssMinimizerPlugin = require( "css-minimizer-webpack-plugin" ); | |
const { hasBabelConfig } = require( '@wordpress/scripts/utils' ); | |
const TerserPlugin = require( 'terser-webpack-plugin' ); | |
const SpriteLoaderPlugin = require( 'svg-sprite-loader/plugin' ); | |
const UnminifiedWebpackPlugin = require( 'unminified-webpack-plugin' ); | |
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries'); |
This file contains 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
const path = require( 'path' ); | |
const defaultConfig = require( "@wordpress/scripts/config/webpack.config" ); | |
const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' ); | |
const CssMinimizerPlugin = require( "css-minimizer-webpack-plugin" ); | |
const { hasBabelConfig } = require( '@wordpress/scripts/utils' ); | |
const TerserPlugin = require( 'terser-webpack-plugin' ); | |
const UnminifiedWebpackPlugin = require( 'unminified-webpack-plugin' ); | |
const FixStyleOnlyEntriesPlugin = require( 'webpack-fix-style-only-entries' ); | |
const isProduction = process.env.NODE_ENV === 'production'; |
This file contains 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
$( 'form.checkout' ).on( 'change', 'input.qty', function( e ) { | |
let maxQtyData = {}; | |
let inputs = $( this ).closest( '.woocommerce-checkout-review-order-list' ).find( 'input.qty' ); | |
inputs.each( function( index, element ) { | |
maxQtyData[$( element ).attr( 'name' )] = $( this ).attr( 'max' ); | |
} ); | |
var data = { |
This file contains 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
jQuery( document ).ready( function( $ ) { | |
$( document ).on( 'click', '.plus, .minus', function() { | |
// Get values | |
var $qty = $( this ).closest( '.quantity' ).find( '.qty' ), | |
currentVal = parseFloat( $qty.val() ), | |
max = parseFloat( $qty.attr( 'max' ) ), | |
min = parseFloat( $qty.attr( 'min' ) ), | |
step = $qty.attr( 'step' ); |
This file contains 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_action( 'after_setup_theme', 'art_remove_wc_lightbox_zoom', 100 ); | |
function art_remove_wc_lightbox_zoom() { | |
remove_theme_support( 'wc-product-gallery-lightbox' ); | |
remove_theme_support( 'wc-product-gallery-zoom' ); | |
} |
This file contains 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
.product-content--meta--list { | |
margin: 0; | |
padding: 0; | |
} | |
.product-content--meta--list tbody { | |
display: grid; | |
gap: 12px; | |
} |
This file contains 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
/** | |
* Вывод избранных атрибутов в карточке товара | |
* | |
* @param $product | |
* | |
* @return array | |
*/ | |
public function get_attributes_to_product( $product ) { | |
$product_attributes = []; |
This file contains 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
#!/bin/bash | |
while true; do | |
POSTS=$(wp db query 'SELECT ID FROM wp_posts WHERE post_type="attachment" AND post_date < "2022-06-05" LIMIT 10000;' --skip-column-names | paste -s -d ' ' -) | |
if ! [ -z "$POSTS" ]; then | |
wp post delete $POSTS --force | |
else | |
exit 0 | |
fi | |
done |
NewerOlder