This file contains hidden or 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
| wp post generate --format=ids --post_type=listing --count=100 | sed -e "s/ /\n/g" | xargs -n1 -I % sh -c 'echo "Adding fields for %"; wp post meta add % _address "531 east 2";wp post meta add % _country "United States"; wp post meta add % _zip "10000"; wp post meta add % _state "NY";wp post meta add % _house 35'; |
This file contains hidden or 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
| POSTIDLIST=($(wp post list --post_type=booking --format=ids)); | |
| for POSTID in ${POSTIDLIST[@]}; do | |
| wp post meta set $POSTID _field_name field_value | |
| done |
This file contains hidden or 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
| function urlExists(url, text ){ | |
| jQuery.get(url, function (response, status, xhr) { | |
| if (xhr.getResponseHeader("content-type").indexOf("text") > -1){ | |
| //console.log( text + ' --> ' + url+ ' --> NOT PDF' ); | |
| } else { | |
| //console.log(xhr.getResponseHeader("content-type")); | |
| if( xhr.getResponseHeader("Content-Length") == null){ | |
| console.log(xhr.getResponseHeader("Content-Length")); | |
| console.log( text + ' --> ' + url+ ' --> IS PDF' ); |
This file contains hidden or 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
| $get = wp_remote_get( $fileurl ); | |
| $mirror = wp_upload_bits( basename( $fileurl ), '', wp_remote_retrieve_body( $get ) ); | |
| $attachment = [ | |
| 'post_status' => 'inherit', | |
| 'post_mime_type' => $mirror['type'], | |
| 'parent_id' => $this_post_id, | |
| 'post_title' => $file_title | |
| ]; | |
| wp_insert_attachment( $attachment, $mirror['file'], $this_post_id ); |
This file contains hidden or 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
| #turn workspace server on ( "RUN" button), paste this into c9 terminal, and hit "enter" | |
| SETUP_PATH="setup.sh" | |
| cat >$SETUP_PATH <<'EOF' | |
| #!/bin/bash | |
| curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
| chmod +x wp-cli.phar | |
| sudo mv wp-cli.phar /usr/local/bin/wp | |
| wp core install --url=https://$C9_HOSTNAME --title=QuickWP --admin_user=admin --admin_password=123456 --admin_email=$C9_EMAIL | |
| wp option update my_option '{"site_url": "bar"}' --format=json | |
| wp theme install twentyseventeen |
This file contains hidden or 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
| curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
| chmod +x wp-cli.phar | |
| sudo mv wp-cli.phar /usr/local/bin/wp | |
| siteurl=$(hostname) | |
| siteurl="${siteurl%-*}" | |
| echo $siteurl | |
| echo "${siteurl%-*}" | |
| wp core install --url=example.com --title=QuickWP --admin_user=admin --admin_password=123456 [email protected] | |
| wp scaffold child-theme twentyseventeen-child --parent_theme=twentyseventeen |
This file contains hidden or 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
| # Recives hostname : batz-bar-taxi-coupons-4241432 | |
| # returns: batz-bar-taxi-coupons | |
| IFS='-' read -r -a host_name_array <<< "$(hostname)" | |
| unset 'host_name_array[${#host_name_array[@]}-1]' | |
| IFS=$'-'; echo "${host_name_array[*]}" ; |
This file contains hidden or 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
| curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
| chmod +x wp-cli.phar | |
| sudo mv wp-cli.phar /usr/local/bin/wp | |
| wp core install --url=example.com --title=QuickWP --admin_user=admin --admin_password=123456 [email protected] | |
| wp scaffold child-theme twentysixteen-child --parent_theme=twentysixteen | |
| wp plugin install woocommerce --activate |
This file contains hidden or 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
| curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
| chmod +x wp-cli.phar | |
| sudo mv wp-cli.phar /usr/local/bin/wp | |
| wp core install --url=example.com --title=QuickWP --admin_user=admin --admin_password=123456 [email protected] | |
| wp scaffold child-theme twentysixteen-child --parent_theme=twentysixteen | |
| npm install -g bower | |
| cd wp-content/themes/twentysixteen-child/ | |
| bower install --save datatables.net | |
| bower install --save datatables.net-dt | |
| wp core update |
This file contains hidden or 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 save_postdata( $post_id, $post, $update ) | |
| { | |
| $meta_keys = array( | |
| "location" => "text", | |
| ); | |
| foreach( $meta_keys as $meta_key => $type ) | |
| { | |
| if( isset( $_POST[ $meta_key ] ) ) |