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 example_measure_execution_time(){ | |
$start = microtime(true); | |
// Here your script | |
$duration = microtime(true) - $start; // in seconds | |
echo 'the script take '. $duration.' to be executed'; | |
} |
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 bo_print_nice_array($array) | |
{ | |
echo '$array='; | |
bo_print_nice_array_content($array, 1); | |
echo ';'; | |
} | |
function bo_print_nice_array_content($array, $deep = 1) |
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 | |
// attach a post type to pictifly regeneration | |
add_filter('pf_post_type_regenerate', 'prefix_pf_post_type_regenerate', 1, 1); | |
function prefix_pf_post_type_regenerate($post_types){ | |
$post_types=['custom_type']; | |
return $post_types; | |
} | |
// Create custom method to regenerate image | |
add_action('pf_post_images_regenerate', 'prefix_pf_post_images_regenerate',10, 2); |
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 fish_greeting | |
echo ' '(set_color F00)' | |
'(set_color c01232)' _______ _______ _________ _______ _______ _______ | |
'(set_color af1132)'( ___ )( ____ \\__ __/( ____ )( ____ \( ____ \ | |
'(set_color 9c1133)'| ( ) || ( \/ ) ( | ( )|| ( \/| ( \/ | |
'(set_color 880f34)'| | | || | | | | (____)|| (__ | (__ | |
'(set_color 770e33)'| | | || | | | | __)| __) | __) | |
'(set_color 6d0e34)'| | | || | | | | (\ ( | ( | ( | |
'(set_color 550d34)'| (___) || (____/\ | | | ) \ \__| (____/\| (____/\ | |
'(set_color 550d34)'(_______)(_______/ )_( |/ \__/(_______/(_______/ '(set_color 46092a)' |
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("option_arg-mc-options", "myprefix_filter_arg_plugin_options"); | |
function myprefix_filter_arg_plugin_options( $option ){ | |
$option = array ( | |
'btn_next_text' => 'Next Step', | |
'btn_prev_text' => 'Previous', | |
'btn_submit_text' => 'Place Order', | |
'btn_skip_login_text' => 'Skip Login', | |
'error_required_text' => 'This field is required', | |
'error_required_checkbox' => 'You must accept the terms and conditions', |
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 to grab last 11 instagram posts into an array | |
* @args string $username : your username on instagram (instagram.com/username) | |
* @args float $cache_duration : Cache duration in hours, you can use integer or float eg: 0.5 (30 minutes) | |
* @require allow_url_fopen=1 | |
*/ | |
function zk_get_instagram_feed($username, $cache_duration=1){ | |
$wp_upload=wp_upload_dir(); | |
$upload_path=$wp_upload['basedir'].'/instagram-cache'; |
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 to check starting char of a string | |
function zk_starts_with($haystack, $needle){ | |
return $needle === '' || strpos($haystack, $needle) === 0; | |
} | |
// Custom function to display the Billing Address form to registration page | |
function zk_add_billing_form_to_registration(){ |
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 new custom font to Font Family selection in icon box module | |
function zeckart_add_new_icon_set_to_iconbox( ) { | |
$param = WPBMap::getParam( 'vc_icon', 'type' ); | |
$param['value'][__( 'IcoMoon', 'total' )] = 'icomoon'; | |
vc_update_shortcode_param( 'vc_icon', $param ); | |
} | |
add_filter( 'init', 'zeckart_add_new_icon_set_to_iconbox', 40 ); |
NewerOlder