Skip to content

Instantly share code, notes, and snippets.

View hellofromtonya's full-sized avatar

Tonya Mork hellofromtonya

View GitHub Profile
@hellofromtonya
hellofromtonya / gutenberg-amp-img.txt
Created July 24, 2018 00:04
Post Content -> Wide Image Alignments with Gutenberg Image Blocks
<!-- wp:paragraph -->
<p>Welcome to image alignment! The best way to demonstrate the ebb and flow of the various image positioning options is to nestle them snuggly among an ocean of words. Grab a paddle and let's get started.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>On the topic of alignment, it should be noted that users can choose from the options of <em>None</em>, <em>Left</em>, <em>Right, </em>and <em>Center</em>. In addition, they also get the options of <em>Thumbnail</em>, <em>Medium</em>, <em>Large</em> &amp; <em>Fullsize</em>.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>The image below happens to be a full sized, <em><strong>centered</strong></em><strong> Gutenberg Image Block.</strong></p>
@hellofromtonya
hellofromtonya / classic-amp-img.html
Last active July 24, 2018 14:10
<amp-img> Wide Image HTML Comparison - classic image vs. Gutenberg image block
<figure class="aligncenter amp-wp-b50f343">
<amp-img src="https://amp-wp.test/wp-content/uploads/2013/03/image-alignment-580x300.jpg" alt="Image Alignment 580x300" width="580" height="300" class="size-full wp-image-967 amp-wp-enforced-sizes amp-wp-c5a25c2 i-amphtml-element i-amphtml-layout-intrinsic i-amphtml-layout-size-defined i-amphtml-layout" srcset="https://amp-wp.test/wp-content/uploads/2013/03/image-alignment-580x300.jpg 580w, https://amp-wp.test/wp-content/uploads/2013/03/image-alignment-580x300-300x155.jpg 300w" sizes="(max-width: 580px) 100vw, 580px" layout="intrinsic" style="width: 580px;">
<i-amphtml-sizer class="i-amphtml-sizer">
<img class="i-amphtml-intrinsic-sizer" src="data:image/svg+xml;charset=utf-8,&lt;svg height=&quot;300px&quot; width=&quot;580px&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;/&gt;">
</i-amphtml-sizer>
<img decoding="async" alt="Image Alignment 580x300" srcset="https://amp-wp.test/wp-content/uploads/2013/03/image-alignment-5
@hellofromtonya
hellofromtonya / class-wp-offline-page.php
Last active July 15, 2018 18:28
Remove Page Attributes from Specific Page.
<?php
class WP_Offline_Page {
/**
* Initializes the instance.
*/
public function init() {
add_action( 'current_screen', array( $this, 'remove_page_attributes' ) );
// other code removed.
@hellofromtonya
hellofromtonya / metaboxes.php
Created June 26, 2018 22:22
Beans Beta Testing.
<?php
/**
* You can add this to your child theme either in the functions.php file or in a separate file.
* Make sure that
add_action( 'admin_init', 'beans_child_test_fields' );
/**
* Test the Fields API for post meta.
*
@hellofromtonya
hellofromtonya / remove-admin-menus.php
Created June 19, 2018 16:21
Removes target menu items from the admin menus.
add_action( 'admin_menu', 'remove_breakable_links_from_admin', 9999 );
/**
* Remove the "breakable" links from the admin menus. These are the links deemed to break the site unless you know
* what you're doing.
*
* @since 1.0.0
*
* @return void
*/
function remove_breakable_links_from_admin() {
@hellofromtonya
hellofromtonya / .gitconfig
Last active December 27, 2019 13:59
Git Productive - Global .gitconfig aliases
[alias]
# Opens the Atom editor.
atom = ! atom
# ===================================
# Viewing history
# ===================================
# Shows a graphical log.
logone = log --oneline --decorate --all --graph
# ===================
# Aliases
# ===================
alias sites="cd ~/Sites/"
alias beans="cd ~/Sites/beansdev/app/public/wp-content/themes/tm-beans/"
alias ~="cd ~"
alias ..="cd .."
alias ...="cd ../.."
@hellofromtonya
hellofromtonya / plugin\bootstrap.php
Created March 7, 2018 01:07
Example plugin bootstrap's File Header.
<?php
/**
* Brief description of the Plugin
*
* @package CompanyName\PluginName
* @author your name or company name
* @license GPL-2.0+
* @link https://example.com
*
* @wordpress-plugin
@hellofromtonya
hellofromtonya / knowthecode.icls
Last active April 6, 2018 14:59
Know the Code's PhpStorm Color Theme
<scheme name="KnowTheCode" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2018-04-06T09:57:53</property>
<property name="ide">PhpStorm</property>
<property name="ideVersion">2017.3.5.0.0</property>
<property name="modified">2018-04-06T09:58:04</property>
<property name="originalScheme">KnowTheCode</property>
</metaInfo>
<option name="LINE_SPACING" value="1.5" />
@hellofromtonya
hellofromtonya / .bash_profile
Created February 28, 2018 02:21
Example of a starter bash_profile with navigation shortcuts and WordPress environment variables
# ===================
# Aliases
# ===================
alias sites="cd ~/Sites/"
alias beans="cd ~/Sites/beansdev/app/public/wp-content/themes/tm-beans/"
alias ~="cd ~"
alias ..="cd .."
alias ...="cd ../.."