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 --- wp_enqueue_media(); | |
jQuery(document).ready(function($) { | |
frame = wp.media({ | |
title: 'Select Image', | |
button: { | |
text: 'Select image', | |
}, |
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 | |
// $YoutubeCode = get_the_content(); | |
$YoutubeCode = 'https://youtu.be/COwlqqErDbY'; | |
$YoutubeCode = 'https://youtu.be/COwlqqErDbY'; | |
preg_match('#(\.be/|/embed/|/v/|/watch\?v=)([A-Za-z0-9_-]{5,11})#', $YoutubeCode, $matches); | |
if (isset($matches[2]) && $matches[2] != '') { | |
$YoutubeCode = $matches[2]; | |
} | |
echo '<img src="http://img.youtube.com/vi/' . $YoutubeCode . '/0.jpg" />'; |
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 | |
add_filter( 'pre_get_posts', 'how_many_posts_display_in_feed' ); | |
function how_many_posts_display_in_feed($query) { | |
if( ! $query->is_feed || ! $query->is_main_query() ) | |
return; | |
// этот вариант не работает | |
// $query->set( 'posts_per_page', 11 ); |
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 sort_nested_arrays( $array, $args = array('votes' => 'desc') ){ | |
usort( $array, function( $a, $b ) use ( $args ){ | |
$res = 0; | |
$a = (object) $a; | |
$b = (object) $b; | |
foreach( $args as $k => $v ){ |
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 divie_all_products_woo_edit(){ | |
$euro_rate = get_option('divie_euro_rate') ? get_option('divie_euro_rate') : ''; | |
$euro_rate = floatval($euro_rate); | |
if(!empty($euro_rate) && is_float($euro_rate) && $euro_rate > 0){ | |
$args = array( | |
'post_type' => array( 'product',), |
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
/////////////////////////////////////////////////////////////////////////////////////////// | |
/////// Show advanced search fields | |
/////////////////////////////////////////////////////////////////////////////////////////// |
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 | |
$eeee = wpestate_build_dropdown_adv('','categlist22','adv_cat','Все типы','all','advanced_search_sidebar','<li role="presentation" data-value="all">Все типы</li><li role="presentation" data-value="apartments">Apartments (11)</li><li role="presentation" data-value="condos">Condos (5)</li><li role="presentation" data-value="houses">Houses (4)</li><li role="presentation" data-value="offices">Offices (1)</li><li role="presentation" data-value="retail">Retail (1)</li><li role="presentation" data-value="villas">Villas (1)</li>'); | |
echo '<div class="search_wrapper agent_contanct_form double-class">'.$eeee.' </div>'; |
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 | |
add_action('add_meta_boxes', 'wpestate_add_property_metaboxes'); | |
if( !function_exists('wpestate_add_property_metaboxes') ): | |
function wpestate_add_property_metaboxes() { | |
add_meta_box('new_tabbed_interface', esc_html__('Property Details', 'wpresidence-core'), 'estate_tabbed_interface', 'estate_property', 'normal', 'default' ); | |
} | |
endif; // end wpestate_add_property_metaboxes | |
if( !function_exists('estate_tabbed_interface') ): |
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 | |
/////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
/// Manage property lists | |
/////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
add_filter( 'manage_edit-estate_property_columns', 'wpestate_my_columns' ); | |
if( !function_exists('wpestate_my_columns') ): | |
function wpestate_my_columns( $columns ) { | |
$slice=array_slice($columns,2,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
jQuery(window).scroll(function () { | |
"use strict"; | |
$ = jQuery; | |
var elems = ['.booking_wrapper']; | |
$.each( elems, function( i, elem ) { | |
$(elem+' li').on( 'click', function(event) { | |
event.preventDefault(); |