Skip to content

Instantly share code, notes, and snippets.

@caraya
Last active February 20, 2019 20:50
Show Gist options
  • Save caraya/a72855622ee87372d108decfb88c5b58 to your computer and use it in GitHub Desktop.
Save caraya/a72855622ee87372d108decfb88c5b58 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
file_to_read=`cat $1`
wp @production post create \
--post_content=file_to_read \
--post_title=$2\
#!/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\
#!/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