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 | |
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
<?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 | |
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 | |
// $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 --- 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 | |
add_action( 'wp_enqueue_scripts', 'my_styles_method35325235' ); | |
add_action('wp_print_footer_scripts', 'autozone_print_footer_color', 99 ); | |
function autozone_print_footer_color() { | |
global $autozone_opt_val; | |
?> | |
<style scoped> |
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 | |
//добавить для мобилы вывод продуктов | |
array( "name" => esc_html__( "Number of Products displayed on WooCommerce archive pages", $themename ), | |
"id" => $shortname . "_woocommerce_archive_num_posts", | |
"std" => "9", | |
"type" => "text", | |
"desc" => esc_html__( "Here you can designate how many WooCommerce products are displayed on the archive page. This option works independently from the Settings > Reading options in wp-admin.", $themename), | |
"validation_type" => "number" | |
), |
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
object(stdClass)#234 (6) { ["item_name"]=> string(32) "Autozone - Automotive Car Dealer" ["item_id"]=> string(8) "15911085" ["created_at"]=> string(30) "Mon May 28 05:45:35 +1000 2018" ["buyer"]=> string(11) "RSGDynamics" ["licence"]=> string(15) "Regular License" ["supported_until"]=> string(30) "Mon Nov 26 21:45:35 +1100 2018" } |
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 | |
// create table | |
if( !$wpdb->query( $wpdb->prepare("SHOW TABLES LIKE '%s'", $AUTO_license['table_name'] ) ) ){ | |
create_table_key_activate(); | |
} | |
$table_name = $wpdb->get_blog_prefix() . 'test_table331234'; | |
if($wpdb->query("SHOW TABLES LIKE '$table_name'")){ |