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 ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
//forked from this repo: https://github.com/humanmade/hm-rewrite | |
/** | |
* Should we flush WP rewrite rules automatically? | |
*/ | |
//todo set this to false on production | |
defined( 'HM_REWRITE_AUTOFLUSH' ) or define( 'HM_REWRITE_AUTOFLUSH', true ); |
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 | |
/** | |
* Get post content by id | |
* @param $post_id | |
* | |
* @return mixed|string | |
*/ | |
function dw_get_content( $post_id ) { | |
$content_post = get_post( $post_id ); | |
$content = $content_post->post_content; |
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_action( 'phpmailer_init', 'dw_phpmailer_init' ); | |
function dw_phpmailer_init( PHPMailer $phpmailer ) { | |
$phpmailer->Host = 'mail.host'; | |
$phpmailer->Port = 2525; // could be different | |
$phpmailer->Username = 'username'; // if required | |
$phpmailer->Password = 'password'; // if required | |
$phpmailer->SMTPAuth = true; // if required | |
// $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value |
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 | |
//Return all Egyptian Governorates into Assoc array php | |
//by Bbioon.com | |
function dw_egypt_governorate() { | |
$arr = [ | |
'Alexandria', | |
'Aswan', | |
'Asyut', | |
'Beheira', | |
'Beni Suef', |
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 print_rr( $param ) { | |
?> | |
<style> | |
div.advanced_print_r { | |
direction: ltr; | |
max-height: 500px; | |
overflow-y: scroll; | |
background: #10192d; | |
margin: 50px 30px; |
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 phone_numbers_iso3166(){ | |
return array ( | |
0 => | |
array ( | |
'alpha2' => 'US', | |
'alpha3' => 'USA', | |
'country_code' => '1', | |
'country_name' => 'United States', |
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
{ | |
"page-1": [ | |
{ | |
"name": "\u0627\u0628\u062d\u0627\u062b \u0639\u0644\u0645\u064a\u0629 (34)", | |
"link": "https:\/\/www.yellowpages.com.eg\/ar\/condensed-category\/%D8%A7%D8%A8%D8%AD%D8%A7%D8%AB-%D8%B9%D9%84%D9%85%D9%8A%D8%A9" | |
}, | |
{ | |
"name": "\u0627\u0628\u0631\u0627\u062c \u062a\u0628\u0631\u064a\u062f \u0648\u062a\u0647\u0648\u064a\u0629 (39)", | |
"link": "https:\/\/www.yellowpages.com.eg\/ar\/condensed-category\/%D8%A7%D8%A8%D8%B1%D8%A7%D8%AC-%D8%AA%D8%A8%D8%B1%D9%8A%D8%AF-%D9%88%D8%AA%D9%87%D9%88%D9%8A%D8%A9" | |
}, |
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
const gulp = require('gulp'); | |
const uglifycss = require('gulp-uglifycss'); | |
const less = require('gulp-less'); | |
const rename = require('gulp-rename'); | |
const path = require('path'); | |
//convert less files to css file | |
gulp.task('less-to-css', function () { | |
return gulp.src('./*.less') | |
.pipe(less({ |
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 prefix_hex_is_light( $color ) { | |
if ( ! $color ) { | |
return false; | |
} | |
$hex = str_replace( '#', '', $color ); | |
$c_r = hexdec( substr( $hex, 0, 2 ) ); | |
$c_g = hexdec( substr( $hex, 2, 2 ) ); | |
$c_b = hexdec( substr( $hex, 4, 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
<?php | |
/** | |
* Enable the use of short codes in text widgets. | |
*/ | |
add_filter( 'widget_text', 'do_shortcode' ); | |
add_filter( 'manage_elementor_library_posts_columns', 'prefix_edit_elementor_library_posts_columns' ); | |
function prefix_edit_elementor_library_posts_columns( $columns ) { | |
$columns['prefix_shortcode_column'] = esc_html__( 'Shortcode', 'text_domain' ); |