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
| $jsonUrl = "https://api.instagram.com/v1/users/self/media/recent/?access_token=3934716848.1677ed0.b59c86f3247e4705b227cf7a3aa18629"; | |
| $json = file_get_contents($jsonUrl); | |
| $obj = json_decode($json); | |
| echo '<pre>'; | |
| print_r($obj); | |
| echo '</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
| <div class="fb-customerchat" | |
| page_id="2237699536499425" | |
| minimized="true"> | |
| </div> | |
| <script> | |
| window.fbAsyncInit = function() { | |
| FB.init({ | |
| appId : '2057654290955252', | |
| autoLogAppEvents : true, | |
| xfbml : true, |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset='utf-8' /> | |
| <title>Animate a point along a route</title> | |
| <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
| <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js'></script> | |
| <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css' rel='stylesheet' /> | |
| <style> | |
| body { margin:0; padding:0; } |
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
| $featured_query = array( | |
| 'post_type' => 'product', | |
| 'order' => 'ASC', | |
| 'posts_per_page'=>3, | |
| 'tax_query' => array( | |
| array( | |
| 'taxonomy' => 'product_visibility', | |
| 'field' => 'name', | |
| 'terms' => 'featured', | |
| ), |
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 wpse66093_no_admin_access() | |
| { | |
| $redirect = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : home_url( '/your-profile' ); | |
| if ( | |
| current_user_can( 'volunteer' ) | |
| OR current_user_can( 'matrimony' ) | |
| OR current_user_can( 'student' ) | |
| ) | |
| exit( wp_redirect( $redirect ) ); | |
| } |
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
| add_filter( 'woocommerce_loop_add_to_cart_link', 'replacing_add_to_cart_button', 10, 2 ); | |
| function replacing_add_to_cart_button( $button, $product ) { | |
| $button_text = __("View product", "woocommerce"); | |
| $button = '<a class="button" href="' . $product->get_permalink() . '">' . $button_text . '</a>'; | |
| return $button; | |
| } |
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
| wp_filter_nohtml_kses() |
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 weekOfMonth($date) { | |
| $ddate = $date; | |
| $duedt = explode("-", $ddate); | |
| $date = mktime(0, 0, 0, $duedt[1], $duedt[2], $duedt[0]); | |
| $week = (int)date('W', $date); | |
| $Y = (int)date('Y', $date); | |
| return array($week,$Y); | |
| } | |
| function getStartAndEndDate($week, $year) | |
| { |
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 is_in_array($array, $key, $key_value){ | |
| $within_array = 'no'; | |
| foreach( $array as $k=>$v ){ | |
| if( is_array($v) ){ | |
| $within_array = is_in_array($v, $key, $key_value); | |
| if( $within_array == 'yes' ){ | |
| break; | |
| } | |
| } else { | |
| if( $v == $key_value && $k == $key ){ |
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
| add_action( 'wp_ajax_get_comments_new', 'get_comments_new' ); | |
| add_action( 'wp_ajax_nopriv_get_comments_new', 'get_comments_new' ); | |
| function get_comments_new(){ | |
| $args = array('post_type' => 'course_unit'); | |
| $post_obj = new WP_Query($args); | |
| while($post_obj->have_posts() ) : $post_obj->the_post(); | |
| //display comments | |
| global $wpdb; |
NewerOlder