can be adjusted allows you to open up certain criteria for user selection. This file should ONLY populate the CCTM::$post_selector array, and the valid keys should be valid arguments to the GetPostsQuery::get_posts() function: CCTM::$post_selector['post_type'] = 'attachment'; CCTM::$post_selector['post_mime_type'] = 'image'; // ... etc... See http://code.google.com/p/wordpress-summarize-posts/wiki/get_posts e.g. DO NOT OVERWRITE THIS FILE DIRECTLY! Instead, create a copy of this file inside wp-content/uploads/cctm/post_selector/ -- this ensures that your custom modications are preserved in a place that will not be overwritten by the WordPress update process. ------------------------------------------------------------------------------*/ CCTM::$post_selector['search_columns'] = array('post_title', 'post_content'); CCTM::$post_selector['post_status'] = array('publish', 'inherit'); CCTM::$post_selector['orderby'] = 'ID'; CCTM::$post_selector['order'] = 'DESC'; CCTM::$post_selector['limit'] = 10; CCTM::$post_selector['paginate'] = 1; CCTM::$search_by = array(); CCTM::$search_by[] = 'post_type'; CCTM::$search_by[] = 'post_status'; CCTM::$search_by[] = 'taxonomy'; CCTM::$search_by[] = 'taxonomy_term'; CCTM::$search_by[] = 'post_parent'; CCTM::$search_by[] = 'meta_key'; CCTM::$search_by[] = 'meta_value'; /*EOF*/
} elseif (empty($def)) { print '<p>' . sprintf(__('Invalid fieldname: %s', CCTM_TXTDOMAIN), '<em>' . htmlspecialchars($fieldname) . '</em>') . '</p>'; return; } // Set up search boundaries (i.e. the parameters used when nothing else is specified). // Load up the config... $possible_configs = array(); $possible_configs[] = '/config/post_selector/' . $fieldname . '.php'; // e.g. my_field.php $possible_configs[] = '/config/post_selector/_' . $def['type'] . '.php'; // e.g. _image.php $possible_configs[] = '/config/post_selector/_relation.php'; // default //print '<pre>'.print_r($possible_configs,true).'</pre>'; exit; CCTM::$post_selector = array(); CCTM::$search_by = true; // all options available if the tpl passes them if (!CCTM::load_file($possible_configs)) { print '<p>' . __('Post Selector configuration file not found.', CCTM_TXTDOMAIN) . '</p>'; } // This gets subsequent search data that gets passed when the user refines the search. $args = array(); // Do not set defaults here! It causes any values set in the config/post_selector/ files // to be ignored. See https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=537 //$args['orderby'] = 'ID'; //$args['order'] = 'ASC'; if (isset($_POST['search_parameters'])) { // e.g. fieldname=movie_clip&fieldtype=media&page_number=0&orderby=ID&order=ASC parse_str($_POST['search_parameters'], $args); //print '<pre>'.print_r($args,true).'</pre>'; exit; // Pass the "view" parameters to the view