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 | |
public function __construct() | |
{ | |
add_action('print_footer_scripts', array($this,'print_script_addsdgsdgsd'), 99); | |
} | |
public function print_script_addsdgsdgsd() | |
{ | |
if( !empty($this->elements)){ |
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 | |
$int_value = ctype_digit($value) ? intval($value) : null; | |
if ($int_value === null) | |
{ | |
echo 'null'; | |
}else{ | |
echo '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
<?php | |
if(!is_admin()){ | |
add_action('print_footer_scripts', 'print_script_addsdgsdgsd', 99); | |
} | |
function print_script_addsdgsdgsd() | |
{ | |
if( !empty($_COOKIE['geo'])){ |
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 | |
$movies = new SimpleXMLElement(file_get_contents('http://www.cbr.ru/scripts/XML_daily.asp?date_req=03/12/2018')); | |
function get_xml_from_url($url){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); |
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 sendEmail($fromEmail,$fromEmailName,$toEmail,$toEmailName,$subject,$message,$extra='') { | |
$headers = 'MIME-Version: 1.0' . "\r\n"; | |
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; | |
$headers .= 'To: '.$toEmailName.' <'.$toEmail.'>' . "\r\n"; | |
$headers .= 'From: '.$fromEmailName.' <'.$fromEmail.'>' . "\r\n"; | |
if(wp_mail($toEmail,$subject,$message,$headers)) { | |
}else { |
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 | |
$data = [ | |
'attribute_names' => ['pa_article','pa_land'], | |
'attribute_values' => ['279','222'], | |
'attribute_position' => ['0','0'], | |
'attribute_visibility' => ['1','1'], | |
]; | |
$attributes = WC_Meta_Box_Product_Data::prepare_attributes( $data ); |
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 | |
require_once( ABSPATH . 'wp-admin/includes/image.php' ); | |
require_once( ABSPATH . 'wp-admin/includes/file.php' ); | |
require_once( ABSPATH . 'wp-admin/includes/media.php' ); | |
$file_array = []; | |
$tmp = download_url($this->infoProduct[0]['image_src'][0]); | |
preg_match('/[^\?]+\.(jpg|jpe|jpeg|gif|png)/i', $this->infoProduct[0]['image_src'][0], $matches ); | |
$file_array['name'] = basename($matches[0]); | |
$file_array['tmp_name'] = $tmp; |
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_add_option_field_to_general_admin_page(){ | |
$option_name = 'divie_company_location'; | |
register_setting( 'general', $option_name ); | |
add_settings_field( | |
'myprefix_setting-id', | |
'Локация компании', | |
'divie_setting_callback_location_gen_opt', | |
'general', |
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 | |
// show rating plagin | |
add_action( 'woocommerce_after_shop_loop_item', 'bbloomer_custom_action', 15 ); | |
function bbloomer_custom_action() { | |
if(function_exists('the_ratings')) { the_ratings(); } | |
} | |
// | |
add_action( 'comment_form_logged_in_after', 'extend_comment_custom_fields' ); |