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_action( 'woocommerce_ajax_added_to_cart', 'ac_add_product_custom_field' ); | |
/** | |
* | |
* @hook woocommerce_ajax_added_to_cart | |
*/ | |
function ac_add_product_custom_field($product_id) { | |
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_shortcode( 'table', 'ssl_table_shortcode' ); | |
/** | |
* Render ACF table shortcode given several parameters | |
*/ | |
function ssl_table_shortcode($atts) { | |
global $post; | |
// extract the necessary attributes |
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
(function($) { | |
"use strict"; | |
var Site = { | |
basePrice: 0, //$('.ginput_amount').val(), | |
gfield_original_title: "", | |
gformId: 22, | |
init: function() { | |
Site.selectChangeEvents(); |
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 | |
/** | |
* Generate the navigation for blog listing pages | |
* | |
* @global obj $wp_query | |
*/ | |
function bg_page_navi($query = null, $paged = null) { | |
?> | |
<ul class="page-navi"> | |
<?php |
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 | |
/** | |
* Validate data and send mail. | |
* | |
* @see http://codex.wordpress.org/Function_Reference/wp_mail | |
* @return {int} Status of message: | |
* -2 => Invalid data | |
* -1 => Failed to send | |
* 1 => OK |
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 | |
$output = ''; | |
if ( $related_posts->have_posts() ){ | |
$out .= '<h3> Related Posts</h3>'; | |
$out .= '<ul>'; | |
while ( $related_posts->have_posts() ){ | |
$related_posts->the_post(); | |
$out .= '<li><a href="'.the_permalink().'">'.get_the_title().'</a></li>'; |
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_shortcode( 'list-posts', 'smoney_list_posts' ); | |
function smoney_list_posts($atts, $content = null) { | |
extract( shortcode_atts( array( | |
'numb' => 5, | |
), $atts ) ); | |
if ( !is_page() ) { | |
$out = 'This shortcode can only be used on a 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
// sth above | |
<?php if ( $related_posts->have_posts() ): ?> | |
<h3> Related Posts</h3> | |
<ul> | |
<?php while ( $related_posts->have_posts() ): $related_posts->the_post(); ?> | |
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></li> | |
<?php endwhile; ?> | |
</ul> | |
<?php endif; ?> |
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 | |
function _foo_handle_ajax_request_for_db_data() { | |
$path = parse_url (site_url()); | |
if ( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) === $path['path'] . '/sth' ) { | |
status_header(200); | |
// do sth | |
exit ; |
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 | |
function update() { | |
global $wpdb; | |
// get the lead detail table name | |
$lead_details_table_name = RGFormsModel::get_lead_details_table_name(); | |
// as stored in the $lead_details_table_name * 10 |