Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function isDuplicate(&$campaign, &$feed, &$item) {
- // Agregar variables para chequear duplicados solo de esta campaña o de cada feed ( grabados en post_meta) o por titulo y permalink
- global $wpdb, $wp_locale, $current_blog;
- $table_name = $wpdb->prefix . "posts";
- $blog_id = $current_blog->blog_id;
- $title = $item->get_title();// . $item->get_permalink();
- $query="SELECT post_title,post_name,id FROM $table_name
- WHERE post_name LIKE '".sanitize_title_with_dashes($title)."%'
- AND ((`post_status` = 'published') OR (`post_status` = 'publish' ) OR (`post_status` = 'draft' ) OR (`post_status` = 'private' ))";
- //GROUP BY post_title having count(*) > 1" ;
- $row = $wpdb->get_row($query);
- trigger_error(sprintf(__('Checking duplicated title \'%1s\'','wpematico'),$title).': '.((!! $row) ? __('Yes') : __('No')) ,E_USER_NOTICE);
- return !! $row;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement