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
// WPCS: slow query ok. | |
Reference: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors |
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
@font-face { | |
font-family: 'MyWebFont'; | |
src: url('webfont.eot'); /* IE9 Compat Modes */ | |
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ | |
url('webfont.woff2') format('woff2'), /* Super Modern Browsers */ | |
url('webfont.woff') format('woff'), /* Pretty Modern Browsers */ | |
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */ | |
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */ | |
} |
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
For security on the other end of the spectrum, we have escaping. To escape is to take the data you may already have and help secure it prior to rendering it for the end user. WordPress thankfully has a few helper functions we can use for most of what we'll commonly need to do: | |
esc_html() we should use anytime our HTML element encloses a section of data we're outputting. | |
<h4><?php echo esc_html( $title ); ?></h4> | |
esc_url() should be used on all URLs, including those in the 'src' and 'href' attributes of an HTML element. | |
<img src="<?php echo esc_url( $great_user_picture_url ); ?>" /> | |
esc_js() is intended for inline Javascript. | |
<a href="#" onclick="<?php echo esc_js( $custom_js ); ?>">Click me</a> |
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
=IF(SEARCH("https://www.sc.com/en/about/",B2,1),"Page") |
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
/* | |
* Add title attribute to file links to indicate that it opens in a new window | |
*/ | |
var file_type = [ 'a[href$="pdf"]', 'a[href$="doc"]', 'a[href$="docx"]', 'a[href$="xls"]', 'a[href$="xlsx"]' ]; // File type options | |
var file_type_length = file_type.length; // File type on page? | |
for( var i = 0; i < file_type_length; i++ ) { // Loop through links on the page | |
$( file_type[ i ] ).each( function() { | |
var file_type_names = file_type[ i ]; // Identify file type |
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
$('a[href$=".mp3"]').addClass("mp3"); |
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
input[type=text], | |
input[type=text]:focus, | |
input[type=password], | |
select, | |
input[type=submit], | |
input[type=reset], | |
input[type=radio], | |
input[type=checkbox], | |
input[type=button], | |
input[type=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
// Connect to database - wp-2 | |
vagrant sequel | |
// Start virtual server | |
vagrant up | |
// Stop virtual server | |
vagrant halt | |
// Some kind of secure connection thingy |
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
git mergetool |
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
Apps -- | |
https://www.virtualbox.org/wiki/Downloads -- open-source hosted hypervisor for x86 computers | |
https://www.vagrantup.com/downloads.html -- open-source software product for building and maintaining portable virtual software development environments | |
https://www.sequelpro.com/ -- Mac database management application for working with MySQL databases | |
http://docs.chassis.io/en/latest/quickstart/ -- virtual server for WordPress, designed for simplicity and speed. | |
Local url -- http://scca.local/wp-admin/ |