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 get_monthly_energy( $year_slug, $daymaster_slug ){ | |
$tengods_de = array( | |
array('F', 'Friend', '比肩'), // 0 | |
array('RW', 'Rob Wealth', '劫财'), // 1 | |
array('EG', 'Eating God', '食神'), // 2 | |
array('HO', 'Hurting Officer', '伤官'), // 3 | |
array('IW', 'Indirect Wealth', '偏财'), // 4 | |
array('DW', 'Direct Wealth', '正财'), // 5 | |
array('SK', '7 Killings', '七杀'), // 6 | |
array('DO', 'Direct Officer', '正官'), // 7 |
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 get_most_influential_energy( $year_slug, $daymaster_slug, $strength_slug ){ | |
$tengods_de = array( | |
array('F', 'Friend', '比肩'), // 0 | |
array('RW', 'Rob Wealth', '劫财'), // 1 | |
array('EG', 'Eating God', '食神'), // 2 | |
array('HO', 'Hurting Officer', '伤官'), // 3 | |
array('IW', 'Indirect Wealth', '偏财'), // 4 | |
array('DW', 'Direct Wealth', '正财'), // 5 | |
array('SK', '7 Killings', '七杀'), // 6 | |
array('DO', 'Direct Officer', '正官'), // 7 |
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 get_solar_term_date( $solar_term, $year = null){ | |
var_dump($year); | |
$solar_terms_date = null; | |
$year2018 = array( | |
array('py'=>'lichun', 'zh'=>'立春', 'date'=>'2018-02-04'), | |
array('py'=>'yushui', 'zh'=>'雨水', 'date'=>'2018-02-19'), | |
array('py'=>'jingzhe', 'zh'=>'惊蛰', 'date'=>'2018-03-05'), | |
array('py'=>'chunfen', 'zh'=>'春分', 'date'=>'2018-03-21'), | |
array('py'=>'chingming', 'zh'=>'清明', 'date'=>'2018-04-05'), |
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
afghanistan : Afghanistan | |
albania : Albania | |
algeria : Algeria | |
american_samoa : American Samoa | |
andorra : Andorra | |
angola : Angola | |
anguilla : Anguilla | |
antigua_and_barbuda : Antigua and Barbuda | |
argentina : Argentina | |
armenia : Armenia |
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
/^((?!<a ).)*$/g |
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
$args = array( | |
'posts_per_page' => 1, | |
'category_name' => 'travel-masters' | |
); | |
query_posts($args); | |
if (have_posts()) : | |
while (have_posts()) : the_post(); | |
/**Your action goes here*/ |
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
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin |
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
composer install --ignore-platform-reqs | |
-OR- | |
composer update --ignore-platform-reqs |
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
/** | |
* Add product attributes to Main/Parent product. | |
* | |
* Can add an array of attributes with an array of their respective values. | |
* Will check if product attribute exist. If so, will ensure attribute values are unique. | |
* | |
* @param int $post_id Parent Product ID. | |
* @param array $attr_names_values Array of product attributes with array of values. | |
*/ | |
public function add_product_attributes( $post_id, $attr_names_values ) |
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
/** | |
* Create variable product. | |
*/ | |
$post = array( | |
'post_title' => 'Product with attributes only PHP', | |
'post_content' => '', | |
'post_status' => 'publish', | |
'post_type' => "product" | |
); | |
$new_post_id = wp_insert_post( $post ); |
NewerOlder