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_1_9").change(function() { | |
if ($(this).val() == "" ) { | |
$("#input_1_16").val("Other (Non-US)"); | |
} else { | |
$("#input_1_16").val($(this).val()); | |
} | |
}); |
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
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
$(document).ready(function() { | |
$("div.equal").setAllToMaxHeight(); | |
}); |
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 | |
if ( is_user_logged_in() ) { | |
$user = new WP_User( $user_ID ); | |
if ( !empty( $user->roles ) && is_array( $user->roles ) ) { | |
foreach ( $user->roles as $role ) | |
echo $role; | |
} | |
} | |
?> |
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
$(document).ready(function(){ | |
var topdivPos = $(".table-top").position(); | |
$(".table-bottom").css("position","absolute").css("top",topdivPos.top).css("left",topdivPos.left).show(); | |
$(".table-top").scroll(function(){ | |
$(".table-bottom").scrollTop($(".table-top").scrollTop()); | |
}); | |
}); |
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
switch($post->post_type): | |
case "glossary": | |
$type_value = 1; | |
break; | |
case "page": | |
$type_value = 2; | |
break; | |
case "book_section": | |
$type_value = 3; | |
break; |
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
class User < ActiveRecord::Base | |
has_many :subscriptions | |
has_many :threads, :through => :subscriptions | |
has_many :threads | |
end | |
class Thread < ActiveRecord::Base | |
has_many :subscriptions | |
has_many :users, :through => :subscriptions | |
belongs_to :user |
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
class User < ActiveRecord::Base | |
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :profile_image, :first_name, :last_name | |
has_many :publications | |
has_many :threads, :through => :publications | |
end | |
class Publication < ActiveRecord::Base | |
attr_accessible :thread_id, :user_id | |
belongs_to :thread | |
belongs_to :user |
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
#### User Model #### | |
class User < ActiveRecord::Base | |
devise :database_authenticatable, :registerable, :confirmable, | |
:recoverable, :rememberable, :trackable, :validatable | |
attr_accessible :email, :password, :password_confirmation, | |
:remember_me, :username, :profile_image, | |
:first_name, :last_name |
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
# Creates 'x' categorizations with null category_id's | |
def create | |
@user = current_user | |
@post = @user.posts.create(params[:post]) | |
@categories = @user.categories.all | |
@post.categorizations.build(:category_id => params[:categorization_ids]) | |
params[:categorization_ids].each do |categorization| | |
@post.categorizations.build(params[:categorization_id]) | |
end | |
end |
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 tax exempt fields to checkout | |
**/ | |
add_action('woocommerce_before_order_notes', 'taxexempt_before_order_notes'); | |
function taxexempt_before_order_notes( $checkout ) { | |
woocommerce_form_field( 'tax_exempt_checkbox', array( | |
'type' => 'checkbox', | |
'class' => array('tiri taxexempt'),array( 'form-row-wide', 'address-field' ), |
OlderNewer