This file contains hidden or 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 | |
/** | |
* Loop Add to Cart -- with quantity and AJAX | |
* requires associated JavaScript file qty-add-to-cart.js | |
* | |
* @link http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/ | |
* @link https://gist.github.com/mikejolley/2793710/ | |
*/ | |
// add this file to folder "woocommerce/loop" inside theme |
This file contains hidden or 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 | |
/** | |
* Check if user is logged in and is post author | |
* Setup functions for front end post editing | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/front-end-post-editing-with-acf-pro/ | |
* @uses Advanced Custom Fields Pro | |
* @uses Sidr | |
*/ |
This file contains hidden or 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 | |
/** | |
* Helper function to check if a user is the author of a specific post | |
* | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/front-end-post-editing-with-caldera-forms/ | |
* @param int $post_id Post ID | |
* @return bool | |
*/ |
This file contains hidden or 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 // only copy this line if needed | |
/** | |
* Renders a notice and prevents checkout if the cart | |
* only contains products in a specific category | |
*/ | |
function sv_wc_prevent_checkout_for_category() { | |
// set the slug of the category for which we disallow checkout | |
$category = 'clothing'; |
This file contains hidden or 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
// This is the initial GravityForms binding, it will be lost upon a page change with next/previous | |
// Thus we make a bind on gform_page_loaded event also | |
if( jQuery('.custom-form').length > 0 ) { | |
jQuery('.gfield_radio input[type=radio]').bind("click", function() { | |
//console.log('Clicked: ' + jQuery( this ).closest('.gform_page').find('.gform_page_footer .gform_next_button.button') ); | |
jQuery(this).closest('.gform_page').find('.gform_page_footer .gform_next_button.button').click(); | |
}); | |
} | |
jQuery(document).bind('gform_page_loaded', function(event, form_id, current_page){ |
This file contains hidden or 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
<html> | |
<head> | |
<title>API Example</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var accessToken = "<your agent's client access token>"; | |
var baseUrl = "https://api.api.ai/v1/"; |
This file contains hidden or 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 | |
add_filter('retrieve_password_message', 'yanco_custom_password_reset', 99, 4); | |
function yanco_custom_password_reset($message, $key, $user_login, $user_data ) { | |
$message = __('Someone has requested a password reset for the following account:') . "<br><br>"; | |
$message .= network_home_url( '/' ) . "<br><br>"; | |
$message .= sprintf(__('%s'), $user_data->user_email) . "<br><br>"; | |
$message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "<br><br>"; | |
$message .= __('To reset your password use the link below:') . "<br><br>"; |
This file contains hidden or 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 | |
/* | |
* Remove Zoom from WooCommerce Galleries | |
*/ | |
add_action( 'after_setup_theme', 'yanco_after_setup_theme', 100 ); | |
function yanco_after_setup_theme() { | |
remove_theme_support( 'wc-product-gallery-zoom' ); | |
} |
This file contains hidden or 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 | |
/** | |
* Remove the h4 to h6 tag from the WordPress editor. | |
* | |
* @param array $settings The array of editor settings | |
* @return array The modified edit settings | |
*/ | |
function remove_headings_from_editor( $settings ) { | |
// Default as example | |
// $settings['block_formats'] = 'Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;'; |
This file contains hidden or 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 | |
/* | |
* Create a column. And maybe remove some of the default ones | |
* @param array $columns Array of all user table columns {column ID} => {column Name} | |
*/ | |
add_filter( 'manage_users_columns', 'yanco_modify_user_table' ); | |
function yanco_modify_user_table( $columns ) { | |
// unset( $columns['posts'] ); // maybe you would like to remove default columns | |
$columns['registration_date'] = 'Registreret'; // add new |
OlderNewer