Skip to content

Instantly share code, notes, and snippets.

View johanoloflindberg's full-sized avatar
💭
Ready to work 😃

WEBBAB johanoloflindberg

💭
Ready to work 😃
View GitHub Profile
@johanoloflindberg
johanoloflindberg / wp-cli_tools
Created July 8, 2017 03:12 — forked from charleslouis/wp-cli_tools
#WP-CLI, #Wordpress, #shell, #Alias, #batch, aliases, helpers and shortcuts for wp-cli,
##########################################
# WP-cli
##########################################
ALIASES
##########################################
alias wpcdl=wp_core_download
@johanoloflindberg
johanoloflindberg / wp-new.sh
Created July 8, 2017 03:12 — forked from jsonUK/wp-new.sh
Script to create new WordPress setup, using WP-CLI
#!/bin/bash
#
# USE FOR LOCAL DEVELOPMENT ONLY!!!
#
EMAIL='[email protected]'
MYSQL=`which mysql`
echo -n "DB user/name for project (lowercase) [ENTER]:"
read DB
@johanoloflindberg
johanoloflindberg / wp.fish
Created July 8, 2017 03:12 — forked from sou-lab/wp.fish
wp-cli fish completion
# wp-cli
complete -c wp -l cache --description 'Manage the object cache.'
complete -c wp -l cap --description 'Manage user capabilities.'
complete -c wp -l cli --description 'Get information about WP-CLI itself.'
complete -c wp -l comment --description 'Manage comments.'
complete -c wp -l core --description 'Download, install, update and otherwise manage WordPress proper.'
complete -c wp -l cron --description 'Manage WP-Cron events and schedules.'
complete -c wp -l db --description 'Perform basic database operations.'
complete -c wp -l eval --description 'Execute arbitrary PHP code.'
complete -c wp -l eval-file --description 'Load and execute a PHP file.'
@johanoloflindberg
johanoloflindberg / wp_install.bat
Created July 8, 2017 03:03 — forked from leandroribeiro/wp_install.bat
Automatic WordPress installation powered by wp-cli
@echo off
:: Source: https://indigotree.co.uk/automated-wordpress-installation-cmd/
:: STEPS:
:: 1. Install wp-cli
:: 2. Install composer
:: 3. Install MySQL
:: 4. Configure wp-cli at System PATH
:: 5. Configure composer at System PATH
@johanoloflindberg
johanoloflindberg / functions.php
Created July 8, 2017 03:00 — forked from jmslbam/functions.php
Change WooCommerce ordernumber prefix
add_filter( 'woocommerce_order_number', 'jm_woocommerce_order_number', 1, 2 );
/**
* Remove # prefix from WooCommerce Order Number
* Could also be done with gettext: https://github.com/woothemes/woocommerce/blob/master/includes/abstracts/abstract-wc-order.php#L537
*
*/
function jm_woocommerce_order_number( $oldnumber, $order ) {
return str_replace('#', '', $order->id);
}
@johanoloflindberg
johanoloflindberg / README.md
Created July 8, 2017 02:59 — forked from hdknr/README.md
Wordpress Plugin with WP-CLI

Wordpress Development Environment

  • vim wp-cli.yml
  • ./scaffold.bash
  • sudo $(phpenv prefix)/sbin/php-fpm -y conf/php-fpm.conf
  • sudo ln -s $PWD/conf/nginx.conf /etc/nginx/sites-enabled/your_wp_cname.conf
  • sudo /etc/init.d/nginx start
@johanoloflindberg
johanoloflindberg / wp-simple-cli.txt
Created July 8, 2017 02:56 — forked from sitebuilderone/wp-simple-cli.txt
WordPress CLI Simple Commands
// Download WordPress within folder:
wp core download
// Create database via Terminal
// login local with root
mysql -u root -p
// create database
@johanoloflindberg
johanoloflindberg / Add Admin to WP via phpMyAdmin
Created July 8, 2017 02:56 — forked from sitebuilderone/Add Admin to WP via phpMyAdmin
Add an admin to WordPress via SQL query - phpMyAdmin or other
INSERT INTO `wp-db-here`.`wp_users`
(`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `display_name`)
VALUES
('1000', 'tempadmin', MD5('!YourPassword5150'), 'tempuser', '[email protected]', '0', 'Temp Admin');
INSERT INTO `wp-db-here`.`wp_usermeta`
(`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES
(NULL, '1000', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');