Hello John
I did more search and here is what I have found
You are right the serach parametre works to find a title, but it does not work when it is used with a hyphen in front, so you cannot exclude title
Same things, with args[‘title’], it does not handle the hyphen in front, so no real solution with keyword search.
So I dig a little bit and found the solution here : https://wordpress.stackexchange.com/questions/18703/wp-query-with-post-title-like-something
It needs to use a filter
So I add one into the plugin
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Title Filter
//
// Source code ==> https://wordpress.stackexchange.com/questions/18703/wp-query-with-post-title-like-something
//
function title_filter($where, &$wp_query){
global $wpdb;
if($search_term = $wp_query->get( ‘title_filter’ )){
$search_term = $wpdb->esc_like($search_term); //instead of esc_sql()
$search_term = ‘ \’%’ . $search_term . ‘%\”;
$title_filter_relation = (strtoupper($wp_query->get( ‘title_filter_relation’))==’OR’ ? ‘OR’ : ‘AND’);
$title_filter_search_type = (strtoupper($wp_query->get( ‘title_filter_search_type’))==’LIKE’ ? ‘LIKE’ : ‘NOT LIKE’);
$where .= ‘ ‘.$title_filter_relation.’ ‘ . $wpdb->posts . ‘.post_title ‘.$title_filter_search_type.’ ‘.$search_term;
}
return $where;
}
And to use it, in the function aps_auto_post
if (!empty($aps_keyword_search)) {
$args[‘s’] = $aps_keyword_search;
//$args[‘exact’] = TRUE;
}
if (!empty($aps_title_search)) {
//$args[‘title’] = $aps_title_search;
add_filter(‘posts_where’,’title_filter’,10,2);
$args[‘title_filter’] = $aps_title_search;
$args[‘title_filter_relation’] = ‘AND’;
if ($aps_title_search_negate==TRUE) {
$args[‘title_filter_search_type’] = ‘NOT LIKE’;
} else {
$args[‘title_filter_search_type’] = ‘LIKE’;
}
}
$args = apply_filters(‘aps_eligible_query’, $args);
So I modified the plugin “Auto Post Scheduler” to a new version to add a new field for the title and a negate checkbox, and now it works, I have made a version 1.80.1 that you can download here to see if you agree to use is or not
I also by the way add the option to keep the original date in this version, you can if you decide ton incoporate it , in your plugin rename the option to whatever your prefer in order to not confuse user
if ( $aps_recycle_keep_original_date ) {
$update[‘post_date’] = get_the_date(‘Y-m-d H:i:s’);
}
else
{
$update[‘post_date_gmt’] = date(‘Y-m-d H:i:s’,current_time(“timestamp”,1));
$update[‘post_date’] = get_date_from_gmt($update[‘post_date_gmt’]);
}
Here is a link for download : http://www.laurentdufour.eu/auto-post-scheduler-1.80.1.zip
To answer to your question, to post to social network, I already use another plugin , it is called SNAP (Social Network Auto Poster), but to recycle I use your plugin, and the combination of both works like a charm.
Best Regards