Modify and add to wp nav shortcuts

Jonathan Hodgson 6 years ago
parent 31bd3654e0
commit 60cb1ea46c
  1. 3
      shells/aliases
  2. 45
      shells/functions

@ -76,7 +76,8 @@ alias home="cd ~/"
alias ~="cd ~/"
#Goes up to the public_html folder
alias ph='cd ${PWD%/public_html*}/public_html'
alias ph='cd ${${PWD%/public_html*}%/wiki*}/public_html'
alias wiki='cd ${${PWD%/public_html*}%/wiki*}/wiki'
#Edit wp-config.php using $EDITOR
alias conf='$EDITOR ${PWD%/public_html*}/public_html/wp-config.php'

@ -90,7 +90,7 @@ function createFPLreport(){
#Takes you to the parent theme
function ptheme() {
public_html=${PWD%/public_html*}/public_html
public_html=${${PWD%/public_html*}%/wiki*}/public_html
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
@ -113,7 +113,7 @@ function ptheme() {
}
function get_theme() {
public_html=${PWD%/public_html*}/public_html
public_html=${${PWD%/public_html*}%/wiki*}/public_html
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
@ -157,7 +157,7 @@ function css() {
#Takes you to the plugin directory
function plugins() {
public_html=${PWD%/public_html*}/public_html
public_html=${${PWD%/public_html*}%/wiki*}/public_html
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
@ -170,6 +170,36 @@ function plugins() {
fi
}
#Takes you to the woocommece plugin directory
function woo() {
public_html=${${PWD%/public_html*}%/wiki*}/public_html
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
else
wpPath=$public_html;
fi
cd $(dirname $(wp --path="$wpPath" plugin path woocommerce))
else
echo " Can't find public_html folder."
fi
}
#Takes you to the woocommerce templates plugin directory
function wooTemplates() {
public_html=${${PWD%/public_html*}%/wiki*}/public_html
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
else
wpPath=$public_html;
fi
cd $(dirname $(wp --path="$wpPath" plugin path woocommerce))/templates
else
echo " Can't find public_html folder."
fi
}
#Copies a woo tepmplate file to the theme
function woocp() {
public_html=${PWD%/public_html*}/public_html
@ -206,7 +236,7 @@ function woocp() {
#Takes you to the theme directory
function themes() {
public_html=${PWD%/public_html*}/public_html
public_html=${${PWD%/public_html*}%/wiki*}/public_html
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
@ -219,6 +249,13 @@ function themes() {
fi
}
function todo() {
wikidir=${${PWD%/public_html*}%/wiki*}/wiki
if [ -d "$wikidir" ]; then
$EDITOR "$wikidir/ToDo.md"
fi
}
#This function toggles debug in wp-config
function debugToggle(){
public_html=${PWD%/public_html*}/public_html

Loading…
Cancel
Save