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 addMetaId2Relations($post_type, $meta_from, $meta_to){ | |
$arr = [ | |
'post_type' => $post_type, | |
'posts_per_page' => -1, | |
'fields' => 'ids' | |
]; | |
$q = new WP_Query($arr); | |
echo 'poluted:<br><br>'; | |
foreach ($q->posts as $id) { |
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
{ | |
"name": "roots/bedrock", | |
"type": "project", | |
"license": "MIT", | |
"description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure", | |
"homepage": "https://roots.io/bedrock/", | |
"authors": [ | |
{ | |
"name": "Scott Walkinshaw", | |
"email": "[email protected]", |
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
{{ fn('wpcf7_contact_form_tag_func', {'id':view.cform7_id, 'html_class':view.css_class}, null, 'contact-form-7') }} |
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
.delayer(@i) when (@i > 0) { | |
@t: ~":nth-child(@{i})"; | |
li@{t} { | |
a{ | |
transition: transform .6s ease-out @menu_speed+(@i * @menu_speed), opacity .6s ease-out @menu_speed + (@i * @menu_speed); | |
} | |
} | |
.delayer(@i - 1); | |
} |
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 get_POI_token($POI_URL_BASE, $POI_URL_TOKEN, $POI_PASS, $POI_USER, $POI_ID, $POI_SECRET){ | |
// do your houseworks.. | |
$url = $POI_URL_BASE.$POI_URL_TOKEN; | |
$username = $POI_USER; | |
$password = $POI_PASS; | |
$client_id = $POI_ID; | |
$client_secret = $POI_SECRET; | |
// some wanted url encoded | |
$args = 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
for POST in $(wp post list --post_type=locations --post_parent=0 --format=ids); do wp post create --post_type=locations --post_parent=$POST --from-post=17717 --post_status=publish; done |
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 | |
// 1, 2, asc | |
usort($mix, function ($item1, $item2) { | |
return $item1->post_date <=> $item2->post_date; | |
}); |
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 | |
$args = array( | |
'status' => 'approve', | |
'number' => 30, | |
'order' => 'DESC' | |
); | |
$comments = get_comments($args); | |
$post_ids = array_map(function($key, $value) { | |
return $value->comment_post_ID; | |
}, array_keys($comments), $comments); |
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
{{ constant('Twig_Environment::VERSION') }} |
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 | |
// field id must be the ACF ID | |
function post_images_to_ACF_gallery($post_type, $field_id){ | |
$args = array( | |
'post_status' => 'publish', | |
'post_type' => $post_type, | |
'posts_per_page' => -1, | |
'fields' => 'ids' | |
); | |
$the_query = new WP_Query( $args ); |