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
if( ! function_exists( 'goorin_resize_image' ) ) : | |
/** | |
* Generate image dynamically | |
* | |
* @param $post_id | |
* @param $attachment_id | |
* @param $filename_suffix | |
* @param null $width | |
* @param null $height |
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
/** | |
* Custom tabindex for gravity form | |
*/ | |
add_filter( 'gform_tabindex', function( $tabindex, $form ) { | |
$starting_index = 50; | |
return GFCommon::$tab_index >= $starting_index ? GFCommon::$tab_index : $starting_index; | |
}, 999, 2 ); |
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
/** | |
* | |
* @param Array $list | |
* @param int $p | |
* @return multitype:multitype: | |
* @link http://www.php.net/manual/en/function.array-chunk.php#75022 | |
*/ | |
function partition(Array $list, $p) { | |
$listlen = count($list); | |
$partlen = floor($listlen / $p); |
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information by | |
* visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* |
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
add_action( 'wp_footer', 'ravs_test' ); | |
function ravs_test(){ | |
$included_files = get_included_files(); | |
$stylesheet_dir = str_replace( '\\', '/', get_stylesheet_directory() ); | |
$template_dir = str_replace( '\\', '/', get_template_directory() ); | |
foreach ( $included_files as $key => $path ) { | |
$path = str_replace( '\\', '/', $path ); |
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
if ( ! class_exists( 'Video_Handler' ) ) : | |
/** | |
* This is using for show in video from online video sevices like youtube, wistia, vimeo. | |
*/ | |
class Video_Handler { | |
/** | |
* Get iframe from youtube video url | |
* |
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
INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('5', 'anattadesign', MD5('Secure2015!'), 'Anatta Design', 'nirav@anattadesign.com', 'http://www.anattadesign.com/', '2015-06-07 00:00:00', '', '0', 'Anatta Design'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_user_level', '10'); |
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
add_action( 'wp_footer', 'get_shortcode_list' ); | |
function get_shortcode_list(){ | |
set_time_limit(0); | |
global $wpdb; | |
$post_ids = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_type != 'attachment'", ARRAY_N ); | |
$ids = array(); | |
foreach( $post_ids as $post_id ){ | |
$ids[] = $post_id[0]; | |
} |