Skip to content

Instantly share code, notes, and snippets.

View m-e-h's full-sized avatar
😐
...

Marty Helmick m-e-h

😐
...
View GitHub Profile
@m-e-h
m-e-h / after_header_widget.php
Created November 27, 2013 15:14
Register the After Header widget area in Hybrid-Core
add_action( 'hybrid_after_header', 'hook_widgets_after_header', 9 );
register_sidebar( array(
'name' => __('Hook: After Header', 'hook_widgets'),
'id' => 'hook-after-header',
'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">',
'after_widget' => '</div></div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>' ) );
/**
* Output the After Header widget area.
@m-e-h
m-e-h / UserToPost.php
Created June 4, 2014 14:12
bidirectional with user and post -pods
add_action( 'pods_api_post_save_pod_item', 'slug_user_fix', 10, 3); // Needed to add the params number
function slug_user_fix( $pieces, $is_new_item, $id ) {
if ( isset( $pieces[ 'fields' ][ 'FIELD_REALTED_TO_USERS' ][ 'value' ] ) ) {
$uIDs = explode(",", $pieces[ 'fields' ][ 'FIELD_RELATED_TO_USERS' ][ 'value' ]);
// Check that we have some uIDs to work with.
if (false === empty($uIDs)) {
// Loop through, converting to integers and verifying the conversion
foreach($uIDs as $uID) {
$uID = (int)$uID;
@m-e-h
m-e-h / CSSsectionHeader
Created June 18, 2014 21:34
CSS section Header - type "section" then hit tab.
<snippet>
<content><![CDATA[
/* ==========================================================================
${Header:} ${defaults}
========================================================================== */
]]></content>
<tabTrigger>section</tabTrigger>
</snippet>
@m-e-h
m-e-h / hybrid-filter.php
Last active August 29, 2015 14:03
filter the hybrid_attr()
add_filter( 'hybrid_attr_header', 'flexy_attr_header' );
function flexy_attr_header( $attr ) {
$attr['class'] .= ' app-bar';
return $attr;
}
<?php
add_action( 'customize_controls_init', 'abraham_customize_css' );
add_action( 'admin_print_styles', 'abraham_admin_styles' );
/**
* Adds visual selectors for the layout option in the Theme Customizer.
*/
function abraham_customize_css() { ?>
@m-e-h
m-e-h / svg-quote.php
Created May 23, 2015 15:16
quote icon
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path class="t-fill__3--dark" d="M21.75 8.25C13.056 8.25 6 15.306 6 24v15.188c0 .337.225.562.563.562h14.625c.337 0 .562-.225.562-.563V24.563c0-.338-.225-.563-.563-.563h-9.562c0-5.706 4.42-10.125 10.125-10.125V8.25zm20.25 0c-8.694 0-15.75 7.056-15.75 15.75v15.188c0 .337.225.562.563.562h14.625c.337 0 .562-.225.562-.563V24.563c0-.338-.225-.563-.563-.563h-9.562c0-5.706 4.42-10.125 10.125-10.125V8.25z"/></svg>
function pw_remove_emojicons()
{
// Remove from comment feed and RSS
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
// Remove from emails
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
// Remove from head tag
@m-e-h
m-e-h / functions.php
Last active August 29, 2015 14:27 — forked from wpscholar/functions.php
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
function enqueue_my_styles() {
global $wp_styles;
// Load the main stylesheet
wp_enqueue_style( 'my-theme', get_stylesheet_uri() );
@m-e-h
m-e-h / multiple-roles-per-user.php
Last active August 27, 2015 20:15 — forked from jemoreto/multiple-roles-per-user.php
Multiple roles per user WordPress plugin. Working when creating a new user and editing an user. Thanks to nikolov-tmw (https://goo.gl/Xv563d) and evankennedy (https://goo.gl/sh2sX6).
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*
Copyright 2013 Nikola Nikolov (email: [email protected])