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 add_comment_on_post_update( $post_id, $post_after, $post_before ) { | |
// If this is just a revision, don't send the email. | |
if ( wp_is_post_revision( $post_id ) ) | |
return; | |
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) | |
return; | |
if (isset($post_before->post_status) && 'auto-draft' == $post_before->post_status) { | |
return; | |
} |
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 | |
function removeRecursive($inputArray,$delKey){ | |
if(is_array($inputArray)){ | |
$moreKey = explode(",",$delKey); | |
foreach($moreKey as $nKey){ | |
unset($inputArray[$nKey]); | |
foreach($inputArray as $k=>$value) { | |
$inputArray[$k] = removeRecursive($value,$nKey); | |
} | |
} |
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
chmod -R a=r,u+w,a+X ./web |
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
$(document).ready(function() { | |
var yetVisited = localStorage['visited']; | |
if (!yetVisited) { | |
// open popup | |
localStorage['visited'] = "yes"; | |
} | |
}); |
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
header('Access-Control-Allow-Origin: *', 'Content-Type: application/json'); // Avoid cross origin block | |
$url1 = 'https://www.example.com/wp/v2/posts?per_page=100&page=1'; // path to your JSON file | |
$url2 = ''https://www.example.com/wp/v2/posts?per_page=100&page=2'; // path to your JSON file | |
$json1 = file_get_contents($url1); | |
$json2 = file_get_contents($url2); | |
$my_array1 = json_decode($json1, true); | |
$my_array2 = json_decode($json2, true); | |
$res = array_merge($my_array1, $my_array2); |
NewerOlder