This file contains 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
<script> | |
//контроль цели отправки формы | |
(function ($) { | |
$('.menu-item-34927 a').click(function(){ | |
yaCounter27903495.reachGoal('help_click'); | |
}); | |
}(jQuery)); | |
</script> | |
This file contains 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 | |
$key_oer = '???'; // тут указываем ключ API | |
$url_api_oer = 'https://openexchangerates.org/api/latest.json?app_id=' . $key_oer; | |
$response = wp_remote_get($url_api_oer); | |
$data_exchange = json_decode( wp_remote_retrieve_body( $response ) ); | |
var_dump($data_exchange); // вернет объект с данными, которые можно далее использовать в коде |
This file contains 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 save_data_to_file(){ | |
// output headers so that the file is downloaded rather than displayed | |
header('Content-Type: text/csv; charset=utf-8'); | |
header('Content-Disposition: attachment; filename=data.csv'); | |
$output = fopen('php://output', 'w'); | |
$data = array( |
This file contains 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 ( ! function_exists( 'acl_filter_posts_where' ) ) : | |
function acl_filter_posts_where($where){ | |
global $wpdb; | |
$current_user_id = get_current_user_id(); |
This file contains 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
'.text.html': | |
'Plugin': | |
'prefix': 'plugin-wp' | |
'body': '<?php\n/*\nPlugin Name: $1\nVersion: ${2:0.1}\nPlugin URI: ${TM_PLUGIN_BASE}$3\nDescription: $4\nAuthor: ${TM_NAME}\nAuthor URI: ${TM_HOMEPAGE}\n*/\n\n$5\n\n\n?>\n' | |
'Readme.txt': | |
'prefix': 'readme-wp-plugin' | |
'body': '=== ${1:Plugin Name} ===\nContributors: ${TM_WP_LOGIN}\nDonate link: ${TM_HOMEPAGE}\nTags: ${2:tag, tag}\nRequires at least: ${3:2.5}\nTested up to: ${4:2.8}\nStable tag: ${5:0.1}\n\n${6:Short description}\n\n== Description ==\n\n${7:Short description}\n\n== Installation ==\n\n1. Upload the \\`${8:plugin}\\` folder to the \\`/wp-content/plugins/\\` directory\n1. Activate the plugin through the \'Plugins\' menu in WordPress\n1. $9\n\n== Changelog ==\n\n= $5 =\n* Initial release.' |
This file contains 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 wpc37174_special_nav_class($classes, $item){ | |
if( is_single() && $item->title == "Blog"){ | |
$classes[] = "special-class"; | |
} | |
return $classes; |
This file contains 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 wpcraft_zip_gzip_mime_types ( $mimes ) { | |
$existing_mimes['zip'] = 'application/zip'; | |
$existing_mimes['gz'] = 'application/x-gzip'; | |
return $mimes; | |
} | |
add_filter('upload_mimes', 'wpcraft_zip_gzip_mime_types'); | |
?> |
This file contains 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
private function wooms_nonce_check($nonce = ''){ | |
if(empty($nonce)){ | |
return false; | |
} | |
if($nonce == get_transient('wooms_nonce')){ | |
delete_transient('wooms_nonce'); | |
return true; | |
} else { | |
return false; |
This file contains 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 | |
/** | |
* Use HTTPS for some sites of network | |
*/ | |
function rsssl_check_protocol_multisite($url, $scheme, $orig_scheme){ | |
if(get_current_blog_id() == 23){ | |
$url = str_replace("http://", "https://", $url); |
This file contains 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 isset cookie - clear value and redirect to url | |
*/ | |
function redirect_after_signin(){ | |
if(is_user_logged_in()){ | |
if( ! empty($_COOKIE["redirect_url_sso"])){ | |
$url = $_COOKIE["redirect_url_sso"]; | |
setcookie("redirect_url_sso", "", time() - 3600); |