This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].
-
[You Don't Know JS][3]
-
[Frontend Masters courses by Kyle Simpson][12]
-
[@mpjme][6]'s [YouTube videos][5]
class EDD_Paddle_Webhook_Handler extends EDD_Webhook_Handler { | |
function get_hook_id() { | |
return 'paddle'; | |
} | |
function get_hook_name() { | |
return 'Paddle'; | |
} | |
function get_endpoint_args() { |
prettier-eslint |
eslint-plugin-prettier |
eslint-config-prettier |
|
---|---|---|---|
What it is | A JavaScript module exporting a single function. | An ESLint plugin. | An ESLint configuration. |
What it does | Runs the code (string) through prettier then eslint --fix . The output is also a string. |
Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. | This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb . |
How to use it | Either calling the function in your code or via [prettier-eslint-cli ](https://github.co |
Using the REST API to upload a file to WordPress is
quite simple. All you need is to send the file in a
POST
-Request to the wp/v2/media
route.
There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:
<!-- Add this anywhere in the page. It assumes your content is inside an <article> tag. --> | |
<a class="floating-twitter-share-link" href="#" title="Share this" target="_blank"> | |
<i class="fa fa-twitter floating-twitter-share"></i> | |
</a> |
jQuery( document ).ready( function ( $ ) { | |
$( document ).on( 'click', '.simple-like-btn', function( e ) { | |
e.preventDefault(); | |
var like = { | |
'action' : $( this ).data( 'action' ), | |
'pid' : $( this ).data( 'pid' ) | |
} | |
var likebtn = this; | |
$.post( ajax_object.ajax_url, like ).done( function( response ) { | |
response = JSON.parse( response ); |
<?php | |
/** | |
* Functions for handling font enqueueing, registration, etc. This works with the | |
* Google Fonts API. | |
* | |
* Extending an idea from Jose Castaneda. This is a small script for loading Google fonts | |
* with an easy method for adding/removing/editing the fonts loaded via child theme. | |
* | |
* @link http://blog.josemcastaneda.com/2016/02/29/adding-removing-fonts-from-a-theme/ | |
*/ |
Kudos/Source: https://github.com/niklongstone/regular-expression-cheat-sheet
Anchor | Description | Example | Valid match | Invalid |
---|---|---|---|---|
^ | start of string or line | ^foam | foam | bath foam |
\A | start of string in any match mode | \Afoam | foam | bath foam |
$ | end of string or line | finish$ | finish | finnish |
\Z | end of string, or char before last new line in any match mode | finish\Z | finish | finnish |
<?php | |
/** | |
* Plugin Name: Deprecated admin_notices | |
* Description: Disable PHP Deprecated notices and display in admin_notices | |
* Author: Weston Ruter, XWP | |
*/ | |
call_user_func( function() { | |
error_reporting( error_reporting() ^ E_DEPRECATED ); |