Changeset 3001601
- Timestamp:
- 11/25/2023 03:19:28 PM (2 years ago)
- Location:
- mi13-access-by-link/trunk
- Files:
-
- 2 edited
-
mi13-access-by-link.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mi13-access-by-link/trunk/mi13-access-by-link.php
r3001558 r3001601 4 4 Plugin URI: https://wordpress.org/plugins/mi13-access-by-link/ 5 5 Description: Access to your posts (pending) by link. 6 Version: 1 6 Version: 1.1 7 7 Author: mi13 8 8 … … 118 118 119 119 function mi13_access_by_link_menu() { 120 $page = add_options_page('mi13 _access_by_link', 'mi13 access by link', 'manage_options', 'mi13_access_by_link', 'mi13_access_by_link_page');120 $page = add_options_page('mi13 access by link', 'mi13 access by link', 'manage_options', 'mi13_access_by_link', 'mi13_access_by_link_page'); 121 121 } 122 122 add_action('admin_menu', 'mi13_access_by_link_menu'); … … 146 146 $settings['filters' ] = strip_tags($settings['filters']); 147 147 $settings['html' ] = isset($settings['html']) ? force_balance_tags( $settings['html'] ) : $html; 148 $settings['key' ] = isset($settings['key']) ? intval($settings['key']) : '';148 $settings['key' ] = isset($settings['key']) ? intval($settings['key']) : 0; 149 149 $settings['publish'] = isset($settings['publish']) ? intval($settings['publish']) : 0; 150 150 return $settings; … … 223 223 <th style="padding-left:8px" scope="row">html:</th> 224 224 <td><textarea name="mi13_access_by_link[html]" rows="10" cols="50"><?php echo $settings['html']; ?></textarea> 225 <p class="description"><?php _e('Note: Please use constants $title, $content, $cat , $thumbnail and $meta[your meta name].','mi13-access-by-link'); ?></p></td>225 <p class="description"><?php _e('Note: Please use constants $title, $content, $cat and $thumbnail.','mi13-access-by-link'); ?></p></td> 226 226 </tr> 227 227 <tr> … … 282 282 283 283 $title = $post->post_title; 284 $cat = __('Category' ).': '.get_the_category_list(' » ', 'multiple',$id);284 $cat = __('Category', 'mi13-access-by-link') . ': ' . get_the_category_list(' » ', 'multiple',$id); 285 285 $thumbnail = get_the_post_thumbnail($id,'thumbnail'); 286 286 $html = $settings['html']; … … 298 298 $html = str_replace('$cat',$cat,$html); 299 299 $html = str_replace('$thumbnail',$thumbnail,$html); 300 if (preg_match_all('/\$meta\[(.+)\]/',$html,$matches,PREG_SET_ORDER)) {301 $meta = get_post_meta($id);302 foreach ($matches as $key) {303 if (isset($meta[$key[1]][0])) $html = str_replace('$meta['.$key[1].']',$meta[$key[1]][0],$html);304 else $html = str_replace('$meta['.$key[1].']','',$html);305 }306 }307 300 if ( $settings['header']=='1' ) get_header(); 308 301 echo $html; -
mi13-access-by-link/trunk/readme.txt
r3001558 r3001601 4 4 Requires at least: 4.7 5 5 Tested up to: 6.3.2 6 Stable tag: 1 6 Stable tag: 1.1 7 7 8 8 Доступ к Вашим постам (на утверждении) по ссылке … … 49 49 = 1 = 50 50 * fix bug. 51 = 1.1 = 52 * Доработан код. Удален пойск мета в тексте, так как для этого есть фильтры.
Note: See TracChangeset
for help on using the changeset viewer.