Skip to content

Instantly share code, notes, and snippets.

View theukedge's full-sized avatar

Dave Clements theukedge

View GitHub Profile
<?php
function chain_select_shortcode( $atts ) {
extract( shortcode_atts( array( 'tax' => 'category', 'level' => 1, 'titles' => array( 'Please select…' ), 'labels' => '', 'btn_text' => 'Submit', 'exclude' => '', 'count' => 1 ), $atts ) );
}
add_shortcode( 'ajax_chain_select', 'chain_select_shortcode' );
[ajax_chain_select tax="competitor" level=2, titles="Select Manufacturer, Select Product" labels="Manufacturer, Product" count=0]
<?php
function chain_select_shortcode( $atts ) {
extract( shortcode_atts( array( 'tax' => 'category', 'level' => 1, 'titles' => array( 'Please select…' ), 'labels' => '', 'btn_text' => 'Submit', 'exclude' => '', 'count' => 1 ), $atts ) );
return chainselect_getcategories( $tax, $level, explode( ', ', $titles ), explode( ', ', $labels ), $btn_text, $exclude, $count );
}
add_shortcode( 'ajax_chain_select', 'chain_select_shortcode' );
<?php
// SOCIAL MEDIA WIDGET //
class diww_social_widget extends WP_Widget {
function __construct() {
parent::__construct(false, $name = 'Social icons', array( 'description' => 'Sidebar widget showing DIWW social icons.' ) );
}
#social-widget {
margin-bottom: 25px;
text-align: center;
}
#social-widget a#fbicon,
#social-widget a#twittericon,
#social-widget a#rssicon,
#social-widget a#emailicon,
#social-widget a#gplusicon {
https://www.theukedge.com/pay-my-invoice/?fn=John&amp;ln=Smith&amp;invoice=1000&amp;amount=500
[gravityform id="4" name="WordPress version poll" ajax="true"]
[gravityform id="4" name="WordPress version poll" ajax="true" action="polls"]
<?php
// DETERMINE IF NEW MEMBER INFO COMPLETE
function new_member_info_complete( $atts, $content = null ) {
global $current_user;
get_currentuserinfo();
$complete = esc_attr( $current_user->completed_new_member_info );
if( $complete !== "Yes" ) {
return do_shortcode( $content );
[new_member_info][symple_box color="red" text_align="left" width="100%" float="none"]Our records indicate that you have not yet completed the <a title="New Members Information Form" href="http://www.thewpbutler.com/new-member-information-form/">New Member Information Form</a>. Without this information, we cannot start servicing your site, so please complete this as soon as possible.[/symple_box][/new_member_info]