Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Alexander Teshabaev bologer

Block or report user

Report or block bologer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bologer
bologer / functions.php
Created Feb 12, 2019
Remove WooCommerce tab from AnyComment
View functions.php
<?php
add_filter( 'woocommerce_product_tabs', 'sb_woo_remove_reviews_tab', 1000);
function sb_woo_remove_reviews_tab($tabs) {
unset($tabs['reviews']);
return $tabs;
}
@bologer
bologer / exclude_anycomment.php
Last active Jan 12, 2019
Exclude anycomment core js asset in j news
View exclude_anycomment.php
<?php
// Только без "<?php" выше
add_filter( 'minit-exclude-js', function($excludes) {
$excludes[] = 'anycomment-js-bundle';
return $excludes;
});
@bologer
bologer / gist:70e5513f35c9020a9961a768c1c56c14
Created Jan 7, 2019 — forked from saippuakauppias/gist:4714695
javascript vkontakte api wall post: постинг на стену к текущему пользователю на JS vk API. С помощью этого кода так же можно отправлять записи на стены групп, пользователей и публичных страниц (пабликов). Используется в iframe приложениях вконтакте.
View gist:70e5513f35c9020a9961a768c1c56c14
/*
* message - сообщение, которое будет опубликовано
* image - картинка для постинга
* user_id - id текущего пользователя (к нему будет осуществлён постинг)
*/
function wallPost(message, image, user_id) {
VK.api('photos.getWallUploadServer', {
uid: user_id
}, function (data) {
if (data.response) {
@bologer
bologer / functions.php
Created Nov 3, 2018
Hide admin bar from users who cannot manage options
View functions.php
<?php
/**
* Disable admin bar for users who cannot manage options.
*/
function anycomment_disable_admin_bar() {
if ( is_plugin_active( 'anycomment/anycomment.php' ) ) {
if ( ! current_user_can( 'manage_options' ) ) {
show_admin_bar( false );
}
@bologer
bologer / functions.php
Last active Nov 3, 2018
Add custom classes to #comments for AnyComment
View functions.php
<?php
function anycomment_custom_js() {
?>
jQuery(document).on('ready', function($) {
$('#comments').addClass('gridlove-comments gridlove-box box-inner-p-bigger');
});
<?php
}
add_action('wp_footer', 'anycomment_custom_js');
@bologer
bologer / converTablesToCollation.php
Created Sep 6, 2018
Convert tables to the required collation in Yii2
View converTablesToCollation.php
$wantedCollation = 'utf8_unicode_ci';
$command = Yii::$app->getDb()->createCommand('SHOW TABLE STATUS');
$tableCollations = $command->queryAll();
if (!empty($tableCollations)) {
foreach ($tableCollations as $tableCollation) {
$tableName = $tableCollation['Name'] ?? null;
@bologer
bologer / hidden-products.md
Last active Oct 19, 2017
Show hidden products
View hidden-products.md
  1. Open wp-content/themes/royal/woocommerce/content-product-gift.php and delete/comment the following lines:
//if ( ! $product || ! $product->is_visible() )
//	return;
  1. Open wp-content/themes/royal/page-profile-template.php

Change:

@bologer
bologer / content-single-product.md
Last active Oct 8, 2017
1 пункт, скрыть sidebar, цены
View content-single-product.md
  1. Открыть wp-content/themes/royal/functions.php
  2. Добавить функцию
/**
 * Check whether user is a cardholder or not.
 * @return bool
 */
function is_cardholder()
{
    if (!is_user_logged_in()) {
@bologer
bologer / cloudflare-challenge.js
Created Feb 27, 2017 — forked from antoligy/cloudflare-challenge.js
This is a project designed to get around sites using Cloudflare's "I'm under attack" mode. Using the PhantomJS headless browser, it queries a site given to it as the second parameter, waits six seconds and returns the cookies required to continue using this site. With this, it is possible to automate scrapers or spiders that would otherwise be t…
View cloudflare-challenge.js
/**
* This is a project designed to get around sites using Cloudflare's "I'm under attack" mode.
* Using the PhantomJS headless browser, it queries a site given to it as the second parameter,
* waits six seconds and returns the cookies required to continue using this site. With this,
* it is possible to automate scrapers or spiders that would otherwise be thwarted by Cloudflare's
* anti-bot protection.
*
* To run this: phantomjs cloudflare-challenge.js http://www.example.org/
*
* Copyright © 2015 by Alex Wilson <antoligy@antoligy.com>
You can’t perform that action at this time.