Makes wp nav shortcuts work in multisites

This commit is contained in:
Jonathan Hodgson 2019-03-14 17:10:09 +00:00
parent a073005423
commit 8aa7aabfe3
2 changed files with 6 additions and 4 deletions

View file

@ -97,7 +97,8 @@ function ptheme() {
else
wpPath=$public_html;
fi
theme=$(dirname $(wp --path="$wpPath" theme path $(wp --path="$wpPath" theme list | grep "parent" | awk '{print $1}')))
domain="$(basename $(dirname $public_html ) ).local.jh"
theme=$(dirname $(wp --path="$wpPath" --url="$domain" theme path $(wp --path="$wpPath" --url="$domain" theme list 2> /dev/null | grep "parent" | awk '{print $1}') 2> /dev/null ))
if [ -d $theme ]; then
if [ -d "$theme" ]; then
cd $theme
@ -120,7 +121,8 @@ function get_theme() {
else
wpPath=$public_html;
fi
theme=$(dirname $(wp --path="$wpPath" theme path $(wp --path="$wpPath" theme list | grep "active" | grep -v "inactive" | awk '{print $1}')))
domain="$(basename $(dirname $public_html ) ).local.jh"
theme=$(dirname $(wp --path="$wpPath" --url="$domain" theme path $(wp --path="$wpPath" --url="$domain" theme list 2> /dev/null | grep "active" | grep -v "inactive" | awk '{print $1}') 2> /dev/null ))
if [ -d $theme ]; then
echo $theme
else