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 / functions.php
Created July 8, 2017 03:20 — forked from ekandreas/functions.php
Block external WordPress API request
/**
* Block external WordPress API request
*/
function wp_api_block_request($pre, $args, $url)
{
if (strpos($url, 'api.wordpress.org')) {
return true;
} else {
return $pre;
}
@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