2017 © Pedro Peláez
 

library theme-lib-environment-dev

Optimizations for a local WordPress theme development environment

image

mindkomm/theme-lib-environment-dev

Optimizations for a local WordPress theme development environment

  • Monday, June 25, 2018
  • by gchtr
  • Repository
  • 3 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 74 % Grown

The README.md

Development Environment

Optimizations for a local WordPress theme development environment., (*1)

Installation

You can install the package via Composer:, (*2)

composer require mindkomm/theme-lib-environment-dev

Usage

By default, the development environment:, (*3)

  • Disables heartbeat.
  • Adds a custom 🚀 favicon for development enviroments.

To activate the feature, use the following code:, (*4)

functions.php, (*5)

if ( is_dev() ) {
    $wpdev = new Theme\Environment\Development\WordPress();
    $wpdev->init();
}

Development Favicon

For the development favicon feature to work well, you’ll need to render your favicons through a render_theme_favicon() function. The development favicon feature will unhook your render_theme_favicon function from wp_head and add its own code., (*6)

functions.php, (*7)

/**
 * Add the theme favicon into theme head
 */
add_action( 'wp_head', 'render_theme_favicon' );

/**
 * Render favicons.
 *
 * This needs to be a separate function so that it can be unhooked.
 */
function render_theme_favicon() {
    Timber\Timber::render( 'favicons.twig', Timber\Timber::get_context() );
}

Redirect emails

Redirects all emails sent through wp_mail to a certain email address., (*8)

if ( is_dev() ) {
    $wpdev = new Theme\Environment\Development\WordPress();
    $wpdev->redirect_emails( 'info@example.org' );
}

WooCommerce

set_email_recipient

Filters the recipient email for WooCommerce emails., (*9)

functions, (*10)

if ( is_dev() ) {
    $woodev = Theme\Environment\Development\WooCommerce();
    $woodev->set_email_recipient( 'info@example.org' );
}

Support

This is a library that we use at MIND to develop WordPress themes. You’re free to use it, but currently, we don’t provide any support., (*11)

The Versions

25/06 2018

dev-master

9999999-dev

Optimizations for a local WordPress theme development environment

  Sources   Download

MIT

The Requires

 

25/06 2018

1.0.1

1.0.1.0

Optimizations for a local WordPress theme development environment

  Sources   Download

MIT

The Requires

 

13/02 2018

1.0.0

1.0.0.0

Optimizations for a local WordPress theme development environment

  Sources   Download

MIT

The Requires