Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probably tidier to use $wpdb->posts not {$wpdb->prefix}posts #2

Open
georgestephanis opened this issue Oct 1, 2020 · 1 comment
Open

Comments

@georgestephanis
Copy link

$sql = "SELECT SUM((LENGTH(post_content) - LENGTH(REPLACE(post_content, %s, ''))) DIV LENGTH(%s)) AS instances FROM {$wpdb->prefix}posts WHERE post_content LIKE %s and post_status IN ('publish', 'draft', 'future', 'pending')";

@andrewstaffell
Copy link

@georgestephanis hello George, thanks for the suggestions, we'll incorporate these ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants