Giter Club home page Giter Club logo

wp-developer's Introduction

wp-developer

license

The Problem

Developing for WordPress is a complex task. You need to take care of many common problems in lots of different areas. Although there are many ready-made solutions and approaches to most of them, they're scattered across the internet.

This solution

This is (becoming) a curated list of such snippets, techniques & tools that can make WordPress development faster, more manageable & convenient task.


Useful general links


Sections


General techniques

Self-versioning styles and scripts

PHP function - filemtime - comes in quite handy when dealing with browser cache busting. It gets file modification time and returns it as a Unix timestamp.

int filemtime( string $filename )

Example:

$my_stylesheet_uri = get_template_directory_uri() . '/dist/style.min.css';

wp_enqueue_style( 
	'my-style',
	$my_stylesheet_uri, 
	array(), 
	filemtime( $my_stylesheet_uri ) 
);

outputs something like

<link rel='stylesheet' id='my-style-css' href='http://my-website.com/wp-content/themes/my-theme/dist/style.min.css?ver=1512143428' type='text/css' media='all' />

Notice the style.min.css?ver=1512143428 where 1512143428 is a Unix timestamp, which represents the last time you edited the file.

wp-developer's People

Contributors

selrond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.