First let's install Homebrew.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
| <?php | |
| // $ composer require lcobucci/jwt | |
| require __DIR__ . '/vendor/autoload.php'; | |
| use Lcobucci\JWT\Configuration; | |
| use Lcobucci\JWT\Signer\Key\InMemory; | |
| use Lcobucci\JWT\Signer\Hmac\Sha256; |
| <?php | |
| add_action( 'acf/init', 'set_acf_pro_license' ); | |
| function set_acf_pro_license() { | |
| global $acf_instances; | |
| if ( isset( $acf_instances['ACF_Admin_Updates'] ) && ! get_option( 'acf_pro_license' ) ) { | |
| /** | |
| * @var ACF_Admin_Updates $acf |
| <?php | |
| add_action( 'init', 'mysqlfix', -1 ); | |
| function mysqlfix() { | |
| global $wpdb; | |
| # Removed ONLY_FULL_GROUP_BY | |
| $wpdb->set_sql_mode(['TRADITIONAL']); | |
| } |
| <?php | |
| /** | |
| * Plugin Name: Mihdan: Image Placeholder | |
| */ | |
| namespace Mihdan_Image_Placeholder; | |
| $images = array( | |
| // Обычные | |
| 'https://placeimg.com/640/480/animals', |
| /** | |
| * Check if Gutenberg is active. | |
| * Must be used not earlier than plugins_loaded action fired. | |
| * | |
| * @return bool | |
| */ | |
| private function is_gutenberg_active() { | |
| $gutenberg = false; | |
| $block_editor = false; |
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| <?php | |
| /** | |
| * Counts words in a text string. | |
| * | |
| * Uses code from wp_trim_words(). | |
| * | |
| * @param string $text Given text. | |
| */ | |
| function my_get_word_count( $text = '' ) { | |
| $translations = get_translations_for_domain( 'default' ); |
| #!/bin/bash | |
| usage() { | |
| printf "%s\n" "Usage: $0 [-m] [-e] [-o] [-c] [-d]" | |
| printf "\t%s\n\t%s\n\t%s\n\t%s\n" \ | |
| "-m MySQL only" "-e English only" "-o Output file" \ | |
| "-c CSS file to download" "-d Auto-delete time (minutes)" | |
| exit 1 | |
| } |