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( 'is_amp_endpoint' ) && is_amp_endpoint() ) { | |
return $content; | |
} |
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 | |
header ("Last-Modified: " . date("D, d M Y H:i:s", time()) . " GMT"); | |
echo 'Last Modified Check'; |
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 | |
// https://gist.github.com/mikejolley/1622323 | |
add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby'); | |
function am_woocommerce_catalog_orderby( $args ) { | |
$args['meta_key'] = '_price'; | |
$args['orderby'] = 'meta_value_num'; | |
$args['order'] = 'desc'; | |
return $args; |
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
// http://wordpress.stackexchange.com/questions/137501/how-to-add-product-in-woocommerce-with-php-code | |
$post = array( | |
'post_author' => $user_id, | |
'post_content' => '', | |
'post_status' => "publish", | |
'post_title' => $product->part_num, | |
'post_parent' => '', | |
'post_type' => "product", | |
); |
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 | |
// In a class constructor | |
$this->size_tax = wc_attribute_taxonomy_name( 'Size' ); | |
$this->color_tax = wc_attribute_taxonomy_name( 'Color' ); | |
// Insert the main product first | |
// It will be used as a parent for other variations (think of it as a container) | |
$product_id = wp_insert_post( 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
.DS_Store | |
.idea/ | |
/cgi-bin/ | |
/search-replace/ | |
# core part | |
/wp-includes/ | |
/wp-admin/ | |
/wp-content/languages/ |
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 | |
// https://generatewp.com/developing-plugins-for-startups-treato-case-study/ | |
class Treato extends WP_Widget { | |
public function __construct() { | |
parent::__construct( | |
'treato', |
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 | |
// https://generatewp.com/introducing-dashboard-widgets-generator/ | |
class Hello_World_Dashboard_Widget { | |
public function __construct() { | |
add_action( 'wp_dashboard_setup', array( $this, 'add_dashboard_widget' ) ); |
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 | |
// https://generatewp.com/the-meta-box-generator/ | |
class Car_Price_Meta_Box { | |
public function __construct() { | |
if ( is_admin() ) { | |
add_action( 'load-post.php', array( $this, 'init_metabox' ) ); |
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
<p>Это тестовая запись. Её можно удалить. Возвышенное, в первом приближении, диссонирует комплекс агрессивности. Иносказательность образа дает сокращенный символизм. Весьма существенно следующее: аполлоновское начало гармонично.</p> | |
<p>Флегматик монотонно трансформирует статус художника. Диониссийское начало, следовательно, продолжает неизменный мимезис. Героическое начинает незначительный феномер «психической мутации».</p> | |
<ul> | |
<li>Притча диссонирует незначительный хтонический миф</li> | |
<li>Герменевтика монотонно дает комплекс априорной бисексуальности</li> | |
<li>Синхронический подход неустойчив. Выразительное относительно</li> | |
<li>Иными словами, компенсаторная функция изящно продолжает текст</li> | |
</ul> | |
<p>Притча диссонирует <a href="#">незначительный хтонический миф</a>. Герменевтика монотонно дает комплекс априорной бисексуальности. Синхронический подход неустойчив. Выразительное относительно. Иными словами, компенсаторная функция изящно продолжает текст. Возрождение готично диссонирует элитарный |
NewerOlder