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 | |
/** | |
* Customize caps to edit Privacy Page | |
*/ | |
add_action('map_meta_cap', function ($caps, $cap, $user_id, $args) { | |
$user_meta = get_userdata($user_id); | |
if ($user_meta) { | |
if (array_intersect(['shop_manager', 'administrator'], $user_meta->roles)) { | |
if ('manage_privacy_options' === $cap) { | |
$manage_name = is_multisite() ? 'manage_network' : 'manage_options'; |
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 | |
clear | |
PATH_TO_WORDPRESS="/var/www/public_html" | |
for URL in = $(wp site list --field=url --deleted=0 --archived=0 --path="$PATH_TO_WORDPRESS") | |
do | |
if [[ $URL == "http"* ]]; then | |
wp cron event run --all --due-now --url="$URL" --path="$PATH_TO_WORDPRESS" | |
fi |
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 brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install composer | |
brew install homebrew/php/composer | |
### PHPCS | |
composer global require "squizlabs/php_codesniffer=*" | |
# Add to your .bash_profile |
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 | |
function get_default_language_posts($query) | |
{ | |
if ($query->is_main_query() && is_home() && function_exists('pll_languages_list') && !is_admin()) { | |
$languages = pll_languages_list(array('hide_empty' => 1)); | |
$terms = get_terms('post_translations'); | |
$lang_default = pll_default_language(); | |
$lang_current = pll_current_language(); | |
$post_ids = array(); |