Created
November 8, 2019 12:55
-
-
Save nikitasinelnikov/3381353adfb7701624ffb41ebeeced1d to your computer and use it in GitHub Desktop.
If you need to find posts' IDs where you have links with old member directories search you may use this snippet
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
/** | |
* Find pages that contain old link to the Members page. Search by "um_search=1" | |
* @global wpdb $wpdb | |
* @return array An array of posts IDs | |
*/ | |
function um_find_pages_with_old_static_link_to_the_members_page() { | |
global $wpdb; | |
$pages = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%um_search=1%' AND post_status = 'publish'" ); | |
return $pages; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment