This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds styles from customizer to head of TinyMCE iframe. | |
* These styles are added before all other TinyMCE stylesheets. | |
* h/t Otto. | |
*/ | |
function kwh_add_editor_style( $mceInit ) { | |
// This example works with Twenty Sixteen. | |
$background_color = get_theme_mod( 'background_color' ); | |
$styles = '.mce-content-body { background-color: #' . $background_color . '; }'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* @wordpress-plugin | |
* Plugin Name: Attachment custom fields | |
* Plugin URI: http://uditrawat.com | |
* Description: Custom fields for Attachments | |
* Version: 10.3 | |
* Author: Udit Rawat | |
* Author URI: http://uditrawat.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' /> | |
<link href='site.css' rel='stylesheet' /> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174): | |
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it. | |
Using git config core.autocrlf true can help, but not on a multi-developpers project. | |
This command has to be the same on each developper machine, and that's not always the case. | |
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root) | |
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require( 'path' ); | |
const webpack = require( 'webpack' ); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
module.exports = ( env, options ) => { | |
return { | |
entry: './src/block.js', | |
output: { | |
path: path.resolve( __dirname, 'build' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Custom scroll animator w/ easing support & requestAnimationFrame, who needs jQuery ^ ^ | |
//Supports window (use 'window') and element (use document.querySelector(...)[0]) scrolling | |
//Want features? Use jQuery. | |
//properties: | |
// - Element: [required] The element you want the scroll to apply to. Use 'window' for window | |
// - To: [required] the offset (in px) to scroll to. Note that it will add this to the current position | |
// - Duration: [required] the duration (in ms) for the scrolling animation | |
// - Direction: [optional] (default: 'horizontal') The direction for the scrolling animation (horizontal | vertical) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Range Control Class | |
*/ | |
class WP_Customize_Range_Control extends WP_Customize_Control { | |
/** | |
* @access public | |
* @var string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*******************************************************Podcast Meta-boxes *******************/ | |
//Add Metabox | |
//Source: http://wordpress.stackexchange.com/questions/139841/add-metabox-with-media-uploader-in-a-custom-post-type | |
add_action( 'add_meta_boxes', 'add_upload_file_metaboxes' ); | |
function add_upload_file_metaboxes() { | |
add_meta_box( 'swp_file_upload', 'File Upload', 'swp_file_upload', 'videos', 'normal', 'default' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scrollTo(Y, duration, easingFunction, callback) { | |
var start = Date.now(), | |
elem = document.documentElement.scrollTop?document.documentElement:document.body, | |
from = elem.scrollTop; | |
if(from === Y) { | |
callback(); | |
return; /* Prevent scrolling to the Y point if already there */ | |
} |