This Gist acompanies my post: WP-CLI: Remote WP Management
Last active
February 20, 2019 20:50
-
-
Save caraya/a72855622ee87372d108decfb88c5b58 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
file_to_read=`cat $1` | |
wp @production post create \ | |
--post_content=file_to_read \ | |
--post_title=$2\ |
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
#!/usr/bin/env zsh | |
# Create post with content from given file | |
# $1 is the file we want to publish | |
# $2 is the title of the post. | |
wp @production post create \ | |
--post_content="$(cat $1)" \ | |
--post_title=$2\ |
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
#!/usr/bin/env zsh | |
# Create post with content from given file | |
# Date it in the future and set the status as a future post | |
# | |
# Positional parameters: | |
# $1 Name of the file | |
# $2 Title | |
# $3 Date for the post. Format 2019-02-07 | |
# $4 Time for post. Format 07:00:00 | |
wp @production post create \ | |
--post_content="$(cat $1)" \ | |
--post_title=$2\ | |
--post_status=future \ | |
--post_date="$3 $4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment