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
function wp_is_rtl( $locale = '' ) { | |
static $rtl_locales = array( | |
'ar' => 'Arabic', | |
'ary' => 'Moroccan Arabic', | |
'azb' => 'South Azerbaijani', | |
'fa_IR' => 'Persian', | |
'haz' => 'Hazaragi', | |
'he_IL' => 'Hebrew', | |
'ps' => 'Pashto', | |
'ug_CN' => 'Uighur', |
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
/** | |
* Distance calculator between two geoCoordinates in nautical miles | |
* | |
* @return int | |
* @param double $lat1 in decimal degrees | |
* @param double $lon1 in decimal degrees | |
* @param double $lat2 in decimal degrees | |
* @param double $lon1 in decimal degrees | |
*/ | |
function distance($lat1, $lon1, $lat2, $lon2) { |
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
function activate_plugin_worker() { | |
$active_plugins = get_option( 'active_plugins' ); | |
array_push($active_plugins, 'worker/init.php'); | |
update_option( 'active_plugins', $active_plugins ); | |
} | |
add_action( 'init', 'activate_plugin_worker' ); |
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
#!/bin/bash | |
# Installation script for the latest WordPress on Ubuntu | |
# | |
# Author: Dewploy Dev Team | |
# Created: November 11, 2016 | |
# Last Upate: November 11, 2016 | |
##### Functions |
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
/** | |
* Add page selector to the customizer. | |
* | |
* @since Theme 1.0.0 | |
* | |
* @param WP_Customize_Manager $wp_customize Customizer object. | |
*/ | |
function prefix_customize_register( $wp_customize ) { | |
$wp_customize->add_section( 'showcase' , array( |
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 | |
// Get the repeater field | |
$repeater = get_field( 'repeater_field_name' ); | |
// Get a random rows. Change the second parameter in array_rand() to how many rows you want. | |
$random_rows = array_rand( $repeater, 2 ); | |
// Loop through the random rows if more than one is returned | |
if( is_array( $random_rows ) ){ |
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 | |
/** | |
* Hide editor on specific pages. | |
* | |
*/ | |
add_action( 'admin_init', 'hide_editor' ); | |
function hide_editor() { | |
// Get the Post ID. |
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
function override_woo_frontend_scripts() { | |
if ( function_exists( 'is_woocommerce' ) ) { | |
if ( is_checkout() ) { | |
wp_enqueue_style( 'semantic-ui-style', 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css'); | |
wp_enqueue_script( 'semantic-ui-script', 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.js', array('woocommerce'), '20151215', false ); | |
wp_enqueue_script( 'inline-bundle-script', get_template_directory_uri() . '/vendor/dist-control/inline.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'polyfills-bundle-script', get_template_directory_uri() . '/vendor/dist-control/polyfills.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'scripts-bundle-script', get_template_directory_uri() . '/vendor/dist-control/scripts.bundle.js', array('woocommerce'), '20151215', true ); | |
wp_enqueue_script( 'styles-bundle-script', get_template_directory_uri() . '/vendor/dist-control/styles.bundle.js', array('woocommerce') |
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
jQuery(document).ready(function($){ | |
var minimized_elements = $('div.minimize'); | |
minimized_elements.each(function(){ | |
var t = $(this).text(); | |
if(t.length < 600) return; | |
$(this).html( | |
t.slice(0,600)+'<span>... </span><a href="#" class="more">' + customscript_vars.read_more + '</a>'+ |
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
wp_enqueue_script('custom-script', get_template_directory_uri() . '/js/custom.js', array('jquery'), '1.1', true); | |
wp_localize_script('custom-script', 'customscript_vars', array( | |
'read_more' => __('Read more'), | |
'read_less' => __('Read less') | |
) | |
); |