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 | |
/** | |
* WP Admin Settings Page | |
* | |
* before use: | |
* download requires | |
* change MY_PAGE_SLUG constant | |
* change render functions | |
* | |
*/ |
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 | |
/** | |
* Custom Excerpt Meta Box | |
*/ | |
define('MY_CUSTOM_POST_TYPE', 'page'); | |
add_action( 'add_meta_boxes' , 'remove_postexcerpt_box', 99 ); | |
add_action( 'add_meta_boxes', 'excerpt_box_action' ); |
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
/** | |
* Register new status | |
* Tutorial: http://www.sellwithwp.com/woocommerce-custom-order-status-2/ | |
**/ | |
function register_awaiting_shipment_order_status() { | |
register_post_status( 'wc-awaiting-shipment', array( | |
'label' => 'Awaiting shipment', | |
'public' => true, | |
'exclude_from_search' => false, | |
'show_in_admin_all_list' => true, |
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 | |
/** | |
* Add the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; |
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
var Countdown = function (clock, endtime, args){ | |
function parseCdString(endtime){ | |
var index, parse, result = 0; | |
index = endtime.indexOf('day'); | |
if( index >= 0 ){ | |
result+= parseInt(endtime.slice( parse, index - 1 ).replace( /^\D+/g, '')) * 24 * 60 * 60 * 1000; | |
parse = index; | |
} |
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
/** | |
* INSTALLATION: this code should be pasted into your theme's functions.php file. | |
* | |
* To Use: Install 'Easy Fancybox'. Leave the URL blank on an image slide in Meta Slider. | |
* The slide will automatically be linked to it's full image in a lightbox | |
* | |
* @tested on WP - 4.4.11; Meta Slider - 3.5.1 | |
*/ | |
function metaslider_easy_fancybox($attributes, $slide, $slider_id) { | |
if (!strlen($attributes['href'])) { |
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
// Images | |
.full { max-width: auto !important; } | |
.cyrcle { border-radius: 50% !important; } | |
.rounded { border-radius: 4px !important; } | |
.scale { | |
position: relative; | |
overflow: hidden; | |
text-align: center; | |
vertical-align: middle; | |
> img, > a, > span, > div { |
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 | |
// Константы назначены ТОЛЬКО для показательного примера. | |
// jquery заменить на свой handle скрипта (если такой имеется) | |
define('AJAX_ACTION_NAME', 'my_action_name'); | |
define('AJAX_VAR', 'my_ajax_var'); | |
define('MY_SECRET_STRING', 'any_secret_string'); | |
add_action( 'wp_enqueue_scripts', 'add_ajax_data', 99 ); |
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
<? | |
$res = \Bitrix\Sale\Location\LocationTable::getList(array( | |
'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID, 'TYPE_CODE' => array("VILLAGE", "CITY"), 'NAME_RU' => array($_POST["city"], $_POST["city"]." %")), | |
'select' => array('*', 'NAME_RU' => 'NAME.NAME', 'TYPE_CODE' => 'TYPE.CODE'), | |
'limit' => 10 | |
)); | |
while($item = $res->fetch()) | |
{ | |
$loc[$item["ID"]] = $item; | |
$ids[] = $item["PARENT_ID"]; |
OlderNewer