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
/** | |
* Добаление новой колонки | |
* | |
* @param $columns | |
* | |
* @return string[] | |
* | |
* @author Artem Abramovich | |
* @verphp 7.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
/** | |
* Возвращает примерное время чтение поста, в зависимости от количества знаков | |
* | |
* @param int $post_id ID поств, для которого надо расчитать время | |
* | |
* @return string | |
* | |
* @author Artem Abramovich | |
* @verphp 7.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
/** | |
* Замена стандартных текстов на страницах | |
* | |
* @param $translated_text | |
* @param $text | |
* @param $domain | |
* | |
* @return mixed|string | |
*/ | |
function art_shop_strings( $translated_text, $text, $domain ) { |
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
/** | |
* Разрешаем загрузку всех нужных форматов файлов | |
* | |
* @param $mime_types | |
* | |
* @return mixed | |
* | |
* @see https://wp-kama.ru/hook/upload_mimes | |
*/ | |
function add_all_type( $mime_types ) { |
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( | |
'woocommerce_shortcode_products_query', | |
function ( $args ) { | |
$standard_array = [ 'menu_order', 'title', 'date', 'rand', 'id' ]; | |
if ( isset( $args['orderby'] ) && ! in_array( $args['orderby'], $standard_array, true ) ) { | |
$args['orderby'] = 'post__in'; | |
} |
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 | |
* | |
* @testedwith WooCommerce 5.5 | |
* @verphp 7.0 | |
* @author Artem Abramovich | |
*/ | |
function art_connection_css_js_only_woocommerce_pages() { | |
if ( is_woocommerce() || is_cart() || is_checkout() || is_account_page() ) { |
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
/** | |
* Удаляет виджеты из Консоли WordPress. | |
* | |
* @return void | |
* | |
* @author campusboy | |
* @verphp 7.0 | |
*/ | |
function remove_widgets_dashboard(): void { |
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 JS events. Страница оформления заказа | |
$( document.body ).trigger( 'init_checkout' ); | |
$( document.body ).trigger( 'payment_method_selected' ); | |
$( document.body ).trigger( 'update_checkout' ); | |
$( document.body ).trigger( 'updated_checkout' ); | |
$( document.body ).trigger( 'checkout_error' ); | |
//Woocommerce JS events. Страница корзины | |
$( document.body ).trigger( 'wc_cart_emptied' ); | |
$( document.body ).trigger( 'update_checkout' ); |
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
/** | |
* Прогресс бар при скроле страницы | |
* | |
* @author Artem Abramovich | |
* @verphp 7.0 | |
*/ | |
function art_progress_bar() { | |
?> | |
<style> |
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
/** | |
* Сортировка товаров на каталоге по остаткам | |
* | |
* @param array $args Массив аргументов для WC_Query | |
* | |
* @return array | |
* | |
* @testedwith WooCommerce 5.5 | |
* @verphp 7.0 | |
* @author Artem Abramovich |