Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vural
vural / megep.md
Last active March 20, 2024 09:20
Megep Dökümanları - 1. Liste
@borantula
borantula / get_oembed.php
Created June 17, 2014 09:22
WordPress Oembed Html from Url
<?php
function getOembedHtml($url,$width,$height)
{
require_once( ABSPATH . WPINC . '/class-oembed.php' );
$oembed = _wp_oembed_get_object();
$html = $oembed->get_html($url,array('width' => (int)$width,'height' => (int)$height) );
return $html;
@mustafauysal
mustafauysal / .htaccess
Last active June 29, 2018 09:28
uploads from production server
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^localsite\.test$
RewriteRule ^wp-content/uploads/(.*)$ https://example.com/wp-content/uploads/$1 [NC,L]
</IfModule>
@mustafauysal
mustafauysal / br.php
Created September 13, 2013 14:08
please don't break me!
<?php
add_filter('the_content', 'remove_br_tags');
function remove_br_tags($content) {
return preg_replace('/<br(\s+)?\/?>/i', "\n", $content);
}
@bainternet
bainternet / custom-cf7-tags.php
Created August 9, 2011 12:59
custom contact form 7 tags
<?php
//contact form 7 extras
//author email
wpcf7_add_shortcode('expert_email', 'wpcf7_expert_email_shortcode_handler', true);
function wpcf7_expert_email_shortcode_handler($tag) {
if (!is_array($tag)) return '';
$name = $tag['name'];
if (empty($name)) return '';