View WP_WPML_Custom_Lang_Selector.php
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 (function_exists('icl_get_languages')) { | |
// Native Lang Name | |
function get_language_name($code=''){ | |
global $sitepress; | |
$details = $sitepress->get_language_details($code); | |
$language_name = $details['display_name']; //english_name //display_name | |
return $language_name; | |
} | |
// Custom Lang Selector |
View WP_Post_Pagination.php
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 | |
// Custom Post Pagination | |
function custom_wp_link_pages( $args = '' ) { | |
global $post; | |
// Get Post Type name | |
$post_type_name = ucfirst(get_post_type(get_the_ID())); | |
$defaults = array( |
View WP_PF_custom_classes.php
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_singular('slug-of-post-type')) : | |
global $post; | |
$p_type = get_post_type(get_the_ID()); | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
$( ".printfriendly a" ).click(function() { | |
$("#pf-core").load(function() { | |
setTimeout( function () { | |
//console.log( $('#pf-core').contents().find('iframe').contents().find('#pf-print-area') ); |
View WP_WC_auto-confirm-bookings.php
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 | |
add_action( 'woocommerce_order_status_completed', 'mark_confirm_bookings', 20, 1 ); | |
function mark_confirm_bookings( $order_id ) { | |
global $wpdb; | |
$order = new WC_Order( $order_id ); | |
$bookings = array(); | |
foreach ( $order->get_items() as $order_item_id => $item ) { |
View WP_is_plugin_active.php
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 // Check from theme if a plugin is active - Place in functions.php or similar | |
if(!function_exists('plugin_is_active')) { | |
function plugin_is_active($plugin_folder, $plugin_file) { | |
if(!isset($plugin_file) || $plugin_file == '') $plugin_file = $plugin_folder; | |
return in_array($plugin_folder.'/'.$plugin_file.'.php', apply_filters('active_plugins', get_option('active_plugins'))); | |
} | |
} | |
?> |
View WP_IDX_language_selector.php
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 | |
// Custom Lang Selector | |
if (function_exists('icl_get_languages')) { | |
// Get Native Lang Name | |
function get_language_name($code=''){ | |
global $sitepress; | |
$details = $sitepress->get_language_details($code); | |
$language_name = $details['display_name']; // options are: english_name / display_name | |
return $language_name; | |
} |
View WP_merge_multiple_queries.php
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 | |
// Check if values are cached, if not cache them | |
//delete_transient('home_slider_24h'); | |
if(get_transient('home_slider_24h') === false) { | |
// RM Blog (post) query | |
$rm_blog_args = array( | |
'posts_per_page' => 1, | |
'cat' => 10, |
View WP_query_repeater.php
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 | |
$i = 0; | |
$num = 30; | |
$offset = 30; | |
$cpt = 'rate-plan'; | |
$qty = '1,2,3,4,5,6,7,8,9,10,11,12'; | |
$times = explode(',', $qty); | |
foreach($times as $item) { | |
$i++; |
OlderNewer