Changeset 1507717
- Timestamp:
- 10/03/2016 08:56:39 PM (9 years ago)
- Location:
- searchcloak/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
searchcloak.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
searchcloak/trunk/readme.txt
r1398542 r1507717 4 4 Tags: search, admin, google, cse 5 5 Requires at least: 3.2.1 6 Tested up to: 4. 57 Stable tag: 1.3.26 Tested up to: 4.6.1 7 Stable tag: 2.0.0 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 68 68 69 69 = Does SearchCloak work with custom post types? = 70 Not at this time. Plugins that create custom post types probably already include mechanisms for controlling visibility. 71 If you'd like this plugin to work with custom post types, please leave a comment on the support thread. 70 Yes! As of version 2.0.0, SearchCloak lets you specify which Custom Post Types should get the SearchCloak checkboxes. 72 71 73 72 == Screenshots == 74 73 1. The SearchCloak box in Page editing. 75 74 2. The SearchCloak dashboard settings page. 76 75 77 76 == Changelog == 77 = 2.0.0 = 78 Add support for custom post types 79 78 80 = 1.3.2 = 79 81 Update testing information in documentation. … … 97 99 == Upgrade Notice == 98 100 99 Version 1.1 added the ability to cloak regular Posts. Please upgrade.101 Version 2.0.0 adds the ability to cloak Custom Post Types. -
searchcloak/trunk/searchcloak.php
r1398539 r1507717 2 2 /** 3 3 * @package searchcloak 4 * @version 1.3.24 * @version 2.0.0 5 5 */ 6 6 /* … … 8 8 Description: Allows Pages to be omitted from search results and search engine indexes 9 9 Author: Lon Koenig and Firebrand LLC 10 Version: 1.3.210 Version: 2.0.0 11 11 Author URI: http://firebrand.net/ 12 12 … … 35 35 'page' => 'edit_page', 36 36 // 'mycustomposttype' => 'edit_post' 37 ) 37 ), 38 'admin_page' => 'searchcloak', //'searchCloakPage', 39 'op_name' => 'searchcloak_settings' 38 40 ); 39 41 … … 51 53 global $searchcloak_settings; 52 54 $post_permissions = $searchcloak_settings['post_permissions']; 55 // tack in the custom post types: 56 $options = get_option( $searchcloak_settings['op_name'] ); 57 foreach($options as $k=>$v){ if ('on' == $v){$post_permissions[$k] = 'edit_post';}} 58 53 59 // step through all our supported post types and add a meta box 54 60 foreach (array_keys($post_permissions) as $post_type){ … … 106 112 if (!empty($names) ) { $selected_option = $names[0]->slug; } // if there is a selection, use it 107 113 foreach ($tax_terms as $this_tax) { 114 // maybe replace the following test with 115 // 1) fetch post type info with get_post_types() 116 // 2) check 'hierarchical' 108 117 if ( ('post' != $post->post_type) or (('post' == $post->post_type) and ('hidechildren' != $this_tax->slug) )){ // skip children option on 'post' pages 109 118 echo '<option class="searchcloak-option" value="' . $this_tax->slug . '"'; … … 141 150 142 151 global $searchcloak_settings; 152 153 143 154 $post_permissions = $searchcloak_settings['post_permissions']; 155 // tack in the custom post types: 156 $options = get_option( $searchcloak_settings['op_name'] ); 157 foreach($options as $k=>$v){ if ('on' == $v){$post_permissions[$k] = 'edit_post';}} 158 144 159 $retVal = $post_id; // return value for not allowed 145 160 if (array_key_exists('post_type', $_POST)){ … … 329 344 330 345 add_action('wp_head', 'searchcloak_noindex'); 346 include_once('searchcloak_admin.php');
Note: See TracChangeset
for help on using the changeset viewer.