If you are going crazy with charecter issue due to oracle connection;
add this:
putenv ("NLS_LANG=AMERICAN_AMERICA.AL32UTF8");
before connection string.
Full list here
| jQuery(document).ready(function($){ | |
| var custom_uploader; | |
| $('#upload_image_button').click(function(e) { | |
| e.preventDefault(); | |
| //If the uploader object has already been created, reopen the dialog |
| <?php | |
| /** | |
| * Create a better name for file | |
| * @param mixed $context | |
| * @return type $new_text | |
| */ | |
| function rename_file($context) { | |
| $context = trim($context); | |
| $search = array('Ç','ç','Ğ','ğ','ı','İ','Ö','ö','Ş','ş','Ü','ü',' '); | |
| $replace = array('c','c','g','g','i','i','o','o','s','s','u','u','-'); |
| <?php | |
| /** | |
| * Created by JetBrains PhpStorm. | |
| * User: Yusuf Koç | |
| * Date: 07.09.2011 | |
| * Time: 14:23 | |
| */ | |
| class Validation |
| <?php | |
| function wp_smtp($phpmailer){ | |
| $phpmailer->Mailer = "smtp"; | |
| $phpmailer->From = "System"; | |
| $phpmailer->FromName = "System Name"; | |
| $phpmailer->Sender = "no_reply@example.com"; | |
| $phpmailer->AddReplyTo($phpmailer->From,$phpmailer->FromName); | |
| $phpmailer->Host = 'smtp.gmail.com'; |
| <?php | |
| if ( get_template() != WP_DEFAULT_THEME && !file_exists(get_template_directory() . '/index.php') ) { | |
| switch_theme( WP_DEFAULT_THEME ); | |
| return false; | |
| } |
| <?php | |
| add_filter('upload_mimes','external_mimes'); | |
| function external_mimes($mimes){ | |
| return array_merge($mimes,array ( | |
| 'rar'=> 'application/x-rar-compressed', // you can add more? | |
| )); | |
| } |
| <?php | |
| $url = "http://www.youtube.com/watch?v=hLQl3WQQoQ0"; | |
| preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $url, $matches); | |
| echo $matches[1]; | |
If you are going crazy with charecter issue due to oracle connection;
add this:
putenv ("NLS_LANG=AMERICAN_AMERICA.AL32UTF8");
before connection string.
Full list here
| <?php | |
| if ( isset( $_GET['page'] ) && $_GET['page'] == 'my_super_page_slug' ) { | |
| add_action( 'blah', 'call_back_blah' ); | |
| } | |
| <?php | |
| $sticky = get_option( 'sticky_posts' ); | |
| $args = array( | |
| 'posts_per_page' => 1, | |
| 'post__in' => $sticky, | |
| 'ignore_sticky_posts' => 1 | |
| ); | |
| query_posts( $args ); | |
| if ( have_posts() ) : | |
| while ( have_posts() ) : the_post(); |