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 | |
/** | |
* Adminpanel environment color for WordPress. | |
* It helps to highlight environments in color. Developers, Content Managers, | |
* and others will never confuse the environment where they work. | |
* | |
* Author: Andrei Pisarevskii | |
* Author Email: renakdup@gmail.com | |
* Author Site: https://wp-yoda.com/en/ | |
* |
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
<?xml version="1.0"?> | |
<ruleset name="WordPress Coding Standards"> | |
<description>A custom set of code standard rules to check for WordPress plugins.</description> | |
<config name="testVersion" value="7.3"/> | |
<!-- How to scan --> | |
<!-- Show sniff and progress --> | |
<arg value="sp"/> | |
<!-- Strip the file paths down to the relevant bit --> | |
<arg name="basepath" value="./"/> |
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
for ($i=0; $i<100; $i++) { | |
echo "\r"; # The main character for console. | |
echo "$i/100"; | |
} |
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
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
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 | |
// Register Custom Post Type | |
function product_post_type() { | |
$labels = array( | |
'name' => _x( 'Каталог мебели', 'Post Type General Name', 'text_domain' ), | |
'singular_name' => _x( 'Товар', 'Post Type Singular Name', 'text_domain' ), | |
'menu_name' => __( 'Товары', 'text_domain' ), | |
'parent_item_colon' => __( '!!!', 'text_domain' ), |
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 | |
// Wordpress Disable Comments (add to function.php) | |
add_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_url()); |
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
// Detect swipe event. Detect touch swipe event. | |
// Example | |
detectSwipeEvent(document.getElementsByClassName('js-mobile-nav__background')[0], function (orientation) { | |
console.log(orientation) | |
}); | |
/** | |
* @param element js element | |
* @param callback Your callback invoke on swipe event. Attribute "swipe orientation" transfer to callback. | |
*/ |