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('current_screen', 'autozone_admin_db_ajax'); | |
function autozone_admin_db_ajax(){ | |
if('settings_page_keypage99' === get_current_screen()->base){ | |
add_action('admin_print_footer_scripts', 'autozone_delete_key_js', 99); | |
add_action( 'admin_enqueue_scripts', 'autozone_ajax_delete_key'); | |
} | |
} |
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 | |
//****************admin********************* | |
//страница настроек | |
add_action('admin_menu', 'compare_cars_wc_submenu_page_url', 999); | |
function compare_cars_wc_submenu_page_url() { | |
add_submenu_page( 'edit.php?post_type=pixad-autos', __('Compare page', 'compare_cars'), _x('Compare page', 'menu', 'compare_cars'), 'manage_options', 'compare-cars', 'compare_cars_submenu_page' ); | |
} | |
function compare_cars_submenu_page(){ |
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 | |
//отправка письма sendEmail(get_bloginfo("admin_email"),get_bloginfo('name'),esc_html($posted['user_mail']),esc_html($get_user_by_mail->data->display_name),__("Сбросить пароль","vbegy"),$last_message_email); | |
//*** убрать форму стандартную регистрации пользавателя | |
// jQuery("html,body").animate({scrollTop:0},500); | |
// jQuery("body").prepend("<div class='wrap-pop'></div>"); | |
// wrap_pop(); | |
}); | |
</script> |
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( 'template_include', 'echo_cur_tplfile', 99 ); | |
function echo_cur_tplfile( $template ){ | |
echo '<span style="color:red">'. wp_basename( $template ) .'</span>'; | |
return $template; | |
} |
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 devise_number_displayed_posts($query) { | |
if (is_admin() || !$query->is_main_query()) { | |
return; | |
} | |
if (is_tax('category-catalogs')) { | |
$query->set('posts_per_page', 16); |
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 | |
$product->get_id() | |
$product->get_type() | |
wc_get_product_tag_list($product->get_id(), ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' ) ============ | |
$product->get_tags( ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' ) | |
wc_get_product_category_list($product->get_id(), ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', $cat_count, 'woocommerce' ) . ' ', '.</span>' ) ================ $product->get_categories( ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', $cat_count, 'woocommerce' ) . ' ', '.</span>' ) | |
$product->get_gallery_image_ids() ===== $product->get_gallery_attachment_ids(); |
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 | |
private static $bearer = "2MDaDp4eFyFqMkj33grHC1wDuSYZ8mso"; | |
static function getPurchaseData( $code ) { | |
//setting the header for the rest of the api | |
$bearer = 'bearer ' . self::$bearer; | |
$header = array(); |
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 | |
class Asc_ch_WP_Nav_Menu_Widget extends WP_Widget { | |
public function __construct() { | |
$widget_ops = array( | |
'classname' => 'col masonry-col', //задать клаасс CSS | |
'description' => __( 'Add a custom menu to your sidebar +' ), | |
'customize_selective_refresh' => true, | |
); | |
parent::__construct( 'ask_widget_nav_menu', __('Меню +'), $widget_ops ); |
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 | |
$cur_queried_object = get_queried_object(); | |
/*======================================================== | |
* получить родительскую по названию и родительской term_id | |
========================================================*/ | |
$terms = get_terms( array( | |
'taxonomy' => array( 'category', ), // название таксономии с WP 4.5 | |
'child_of' => $department_term->term_id, | |
'name__like' => $cat_lvl2->subdivision, | |
) ); |