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 Shortcode sc_schedule_content - Post content partial schedule | |
function sc_schedule_content( $atts , $content = null ) { | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'time' => '', | |
'date' => '', | |
), |
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
AddDefaultCharset utf-8 | |
RewriteEngine on | |
<FilesMatch "\.(jpg|png|css|js|gif|html|htm|gz|xml|ttf|woff|woff2|svg|eot)$"> | |
<ifModule mod_headers.c> | |
RequestHeader unset Set-Cookie | |
Header unset Set-Cookie | |
Header set X-CDN "WebStorm.co.il-CDN" | |
</ifModule> | |
</FilesMatch> |
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 | |
$it = new RecursiveDirectoryIterator("."); | |
$extAllow = Array ( 'jpeg', 'jpg' ); | |
foreach( new RecursiveIteratorIterator($it) as $img ){ | |
$ext = explode( '.', $img ); | |
$ext = array_pop( $ext ); | |
if (! in_array( strtolower( $ext ), $extAllow ) ){ | |
continue; |
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 | |
function array2select( $name, $array, $assoc = false, $selected = null, $addArray = null ) { | |
if( isset( $addArray ) && is_array( $addArray ) ) { | |
$array = $addArray + $array; | |
} | |
if( ! $assoc ) { | |
$select = '<select name="' . $name . '"><option>' . implode( '</option><option>', $array ) . '</option></select>'; |
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 | |
function procMvc( $view, $vars = null ) { | |
$vars = empty( $vars ) ? $GLOBALS : $vars; | |
/* | |
* Replace $view | |
* only var like varname or array value like arrname.varname | |
* short if like varname==8?hhhh output be hhhh if varname eq to 8 | |
*/ |
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( ! empty( $_GET[ 'done' ] ) ) { | |
if( unlink( __FILE__ ) ) { | |
die( 'הקובץ נמחק והאתר שלך מוכן עם הכתובת החדשה!' ); | |
} else { | |
die( 'עקב בעיית הרשאות לא ניתן למחוק את הקובץ אוטומטית, אנא מחק את הקובץ ידנית.' ); | |
} | |
} |
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 | |
class Email_reader { | |
// imap server connection | |
private $conn; | |
// inbox storage and inbox message count | |
public $inbox; | |
public $msg_cnt; |
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 target attribute to all links in post ***/ | |
function gt_add_target_attr( $match ){ | |
if( strpos( $match[0], 'target=' ) === false ){ | |
return preg_replace( '#>$#', ' target="_blank">', $match[0] ); | |
} else { | |
return $match[0]; | |
} | |
} |
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 Polylang is active, hook function on the admin pages | |
if ( function_exists( 'pll_register_string' ) ) add_action( 'admin_init', 'pll_tc_strings_setup' ); | |
function pll_tc_strings_setup() { | |
// Add text to Polylang's string translation panel | |
pll_register_string( 'fl-topbar-col1-text', 'Contact_Data', 'wipi', true ); | |
pll_register_string( 'fl-arrow-breadcrumbs', 'arrow_mulilang', 'wipi', true ); | |
} | |
function polylanguage_shortcode( $atts ) { |
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 | |
// Code start form here: | |
// Wipi (beaver) builder support for Contact Form 7 DB plugin | |
function webstorm_wipi_support_cf7db(){ | |
// Save temp unnecessary post fields and remove untail save to db | |
$tempPost = $_POST; | |
unset( $_POST['fields'] ); | |
unset( $_POST['action'] ); | |
unset( $_POST['node_id'] ); |
OlderNewer