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 | |
/** | |
* Plugin Name: Perf Test | |
* Text Domain: perf-test | |
* Domain Path: /languages | |
* Version: 0.1.0 | |
* | |
* @package Perf_Test | |
*/ |
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
UPDATE wp_options SET option_value = replace( option_value, '//old-address.com', '//new-address.com' ); | |
UPDATE wp_posts SET post_content = replace( post_content, '//old-address.com', '//new-address.com' ); | |
UPDATE wp_postmeta SET meta_value = replace( meta_value, '//old-address.com', '//new-address.com' ); |
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 ml_is_child_of( $parent_id, $post_id = null, $post_type = 'page' ) | |
{ | |
if ( !is_page() ) | |
return false; | |
$post_id = ( $post_id ) ? $post_id : get_the_ID(); | |
$ancestors = get_ancestors( $post_id, $post_type ); | |
return in_array( $parent_id, $ancestors ); |