This file contains hidden or 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_phone_exist( $phone ) { | |
| $args = array( | |
| 'fields' => 'ID', | |
| 'meta_query' => array( | |
| array( | |
| 'key' => 'billing_phone', //Change this with the meta key that holds the phone number in user meta data | |
| 'value' => $phone, | |
| 'compare' => '=' | |
| ) |
This file contains hidden or 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 Prefix_Disable_Posts { | |
| public function __construct() { | |
| global $pagenow; | |
| /* checks the request and redirects to the dashboard */ | |
| add_action( 'init', array( __CLASS__, 'disallow_post_type_post' ) ); | |
| /* removes Post Type `Post` related menus from the sidebar menu */ | |
| add_action( 'admin_menu', array( __CLASS__, 'remove_post_type_post' ) ); | |
| if ( ! is_admin() && ( $pagenow != 'wp-login.php' ) ) { |
This file contains hidden or 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
| <button type="submit" class="sms_submit" id="sms_submit" disabled> | |
| Submit | |
| <span id="count_down"></span> | |
| </button> | |
| <script> | |
| var btn = document.getElementById("sms_submit"); | |
| function startTimer(duration, display) { | |
| var timer = duration, minutes, seconds; |
This file contains hidden or 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 | |
| /** | |
| * Safe render a view and return html | |
| * In view will be accessible only passed variables | |
| * Use this function to not include files directly and to not give access to current context variables (like $this) | |
| * @param string $file_path | |
| * @param array $view_variables | |
| * @param bool $return In some cases, for memory saving reasons, you can disable the use of output buffering | |
| * @return string HTML | |
| */ |
This file contains hidden or 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 | |
| /** | |
| * Convert bytes to human readable format | |
| * | |
| * @param integer $bytes Size in bytes to convert | |
| * @param integer $precision | |
| * | |
| * @return string | |
| */ | |
| function prefix_human_bytes( $bytes, $precision = 2 ) { |
This file contains hidden or 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 currently is a Post Edit page display/submit | |
| * @return bool | |
| */ | |
| function is_post_edit_page() { | |
| static $result = null; | |
| if ( $result === null ) { | |
| $result = false; |
This file contains hidden or 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 images sizes register by add_image_size() merged with | |
| * WordPress default image sizes. | |
| * @link https://codex.wordpress.org/Function_Reference/get_intermediate_image_sizes | |
| * | |
| * @param string $size | |
| * | |
| * @return array|bool | |
| */ |
This file contains hidden or 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' ); |
This file contains hidden or 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 hidden or 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({ |