Changeset 2965072
- Timestamp:
- 09/11/2023 04:26:54 AM (2 years ago)
- Location:
- fiber-admin
- Files:
-
- 2 deleted
- 10 edited
- 1 copied
-
tags/3.1.2 (copied) (copied from fiber-admin/trunk)
-
tags/3.1.2/assets/css/fiber-csm.css (deleted)
-
tags/3.1.2/changelog.txt (modified) (1 diff)
-
tags/3.1.2/fiberadmin.php (modified) (2 diffs)
-
tags/3.1.2/includes/csm-mode.php (modified) (4 diffs)
-
tags/3.1.2/includes/helpers.php (modified) (3 diffs)
-
tags/3.1.2/readme.txt (modified) (2 diffs)
-
trunk/assets/css/fiber-csm.css (deleted)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/fiberadmin.php (modified) (2 diffs)
-
trunk/includes/csm-mode.php (modified) (4 diffs)
-
trunk/includes/helpers.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fiber-admin/tags/3.1.2/changelog.txt
r2962849 r2965072 1 1 == Changelog == 2 3 = 3.1.2 = 4 *Release Date - 11 September 2023* 5 6 * Fixed: Fix wrong CSM mode make draft preview blank page. 7 * Fixed: Fix CSM meta boxes didn't work. 8 * Fixed: Remove unused constant `PAGE_TYPE`. 2 9 3 10 = 3.1.1 = -
fiber-admin/tags/3.1.2/fiberadmin.php
r2962849 r2965072 4 4 * Plugin URI: https://wordpress.org/plugins/fiber-admin/ 5 5 * Description: 💈 Bring multiple customization features to make your own WordPress admin. 6 * Version: 3.1. 16 * Version: 3.1.2 7 7 * Requires at least: 5.2 8 8 * Requires PHP: 7.0 … … 138 138 add_action('admin_head', 'fiad_admin_additional_css'); 139 139 function fiad_admin_additional_css(){ 140 $page_csm_ids = fiad_get_ page_template_ids("csm", true, true);140 $page_csm_ids = fiad_get_csm_pages(); 141 141 if($page_csm_ids){ 142 142 $extra_styles = '<style>'; -
fiber-admin/tags/3.1.2/includes/csm-mode.php
r2962829 r2965072 22 22 add_filter('fiad_csm_extra_js', [$this, 'fiad_csm_extra_js']); 23 23 add_filter('template_include', [$this, 'fiad_csm_load_template']); 24 //add_filter('show_admin_bar', [$this, 'fiad_csm_hide_admin_bar']); //todo: find way to enqueue admin-bar back25 24 26 25 // customize edit page … … 88 87 } 89 88 90 //todo: show admin bar91 /*92 * This is a temporary solution since enqueue admin-bar assets not working93 */94 public function fiad_csm_hide_admin_bar(){95 return !fiad_is_preview() && fiad_is_admin_user_role();96 }97 98 89 public function fiad_create_default_csm_page($value){ 99 $csm_mode = fiad_get_csm_mode_option('mode'); 100 $page_titles = [ 101 'coming-soon' => 'Coming Soon', 102 'maintenance' => 'Maintenance', 103 ]; 104 if(!$csm_mode){ 90 if(!fiad_get_csm_pages()){ 91 $page_titles = [ 92 'coming-soon' => 'Coming Soon', 93 'maintenance' => 'Maintenance', 94 ]; 105 95 foreach($page_titles as $mode => $title){ 106 96 $content_url = FIBERADMIN_ASSETS_URL . 'csm/' . $mode . '.html'; … … 163 153 <tr> 164 154 <td> 165 <h4>Logo</h4> 166 <div class="fiber-admin-preview"> 167 <img src="<?php echo esc_url($csm_logo); ?>" 168 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 169 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 170 </div> 171 <div class="fiber-admin-metabox--upload"> 172 <label> 173 <input class="regular-text" type="text" name="fiad_csm_content[logo]" 174 placeholder="<?php echo __('Input / Choose your Logo image', 'fiber-admin'); ?>" 175 value="<?php echo esc_url($csm_logo); ?>"/> 176 </label> 177 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 178 </div> 155 <fieldset> 156 <h4>Logo</h4> 157 <div class="fiber-admin-preview"> 158 <img src="<?php echo esc_url($csm_logo); ?>" 159 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 160 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 161 </div> 162 <div class="fiber-admin-metabox--upload"> 163 <label> 164 <input class="regular-text" type="text" name="fiad_csm_content[logo]" 165 placeholder="<?php echo __('Input / Choose your Logo image', 'fiber-admin'); ?>" 166 value="<?php echo esc_url($csm_logo); ?>"/> 167 </label> 168 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 169 </div> 170 </fieldset> 179 171 </td> 180 172 <td> 181 <h4>Background image</h4> 182 <div class="fiber-admin-preview"> 183 <img src="<?php echo esc_url($csm_background); ?>" 184 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 185 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 186 </div> 187 <div class="fiber-admin-metabox--upload"> 188 <label> 189 <input class="regular-text" type="text" name="fiad_csm_content[background]" 190 placeholder="<?php echo __('Input / Choose your Background image', 'fiber-admin'); ?>" 191 value="<?php echo esc_url($csm_background); ?>"/> 192 </label> 193 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 194 </div> 173 <fieldset> 174 <h4>Background image</h4> 175 <div class="fiber-admin-preview"> 176 <img src="<?php echo esc_url($csm_background); ?>" 177 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 178 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 179 </div> 180 <div class="fiber-admin-metabox--upload"> 181 <label> 182 <input class="regular-text" type="text" name="fiad_csm_content[background]" 183 placeholder="<?php echo __('Input / Choose your Background image', 'fiber-admin'); ?>" 184 value="<?php echo esc_url($csm_background); ?>"/> 185 </label> 186 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 187 </div> 188 </fieldset> 195 189 </td> 196 190 </tr> … … 223 217 wp_enqueue_media(); 224 218 wp_enqueue_script('fiber-admin'); 225 wp_enqueue_style('fiad-csm-css', FIBERADMIN_ASSETS_URL . 'css/fiber-csm.css', false, FIBERADMIN_VERSION);226 219 } 227 220 } -
fiber-admin/tags/3.1.2/includes/helpers.php
r2962829 r2965072 167 167 } 168 168 169 if(!function_exists('fiad_get_page_template_ids')){170 function fiad_get_page_template_ids($template_name, $return_array = false, $suppress_filters = false){171 if($template_name){172 $args = [173 'post_type' => PAGE_TYPE,174 'posts_per_page' => - 1,175 'meta_key' => '_wp_page_template',176 'meta_value' => $template_name . '.php',177 'fields' => 'ids',178 'suppress_filters' => $suppress_filters,179 ];180 $template_query = new WP_Query($args);181 wp_reset_postdata();182 183 if($template_query->have_posts()){184 $pages = $template_query->posts;185 186 return $return_array ? $pages : $pages[0];187 }188 }189 190 return $return_array ? [] : null;191 }192 }193 194 169 if(!function_exists('fiad_is_preview')){ 195 170 function fiad_is_preview(){ 196 return sanitize_title(fiad_array_key_exists('preview', $_GET)); 171 $id = intval(fiad_array_key_exists('id', $_GET)); 172 173 return in_array($id, fiad_get_csm_pages()) && is_preview(); 197 174 } 198 175 } … … 215 192 216 193 return $template == FIBERADMIN_CSM_TEMPLATE; 217 }218 } 219 194 } 195 } 196 220 197 if(!function_exists('fiad_get_file_upload_path')){ 221 198 function fiad_get_file_upload_path($url){ … … 223 200 } 224 201 } 202 203 if(!function_exists('fiad_get_csm_pages')){ 204 function fiad_get_csm_pages(){ 205 $args = [ 206 'post_type' => 'page', 207 'post_status' => 'publish', 208 'posts_per_page' => - 1, 209 'meta_key' => '_wp_page_template', 210 'meta_value' => FIBERADMIN_CSM_TEMPLATE, 211 'fields' => 'ids', 212 'suppress_filters' => false, 213 ]; 214 $template_query = new WP_Query($args); 215 wp_reset_postdata(); 216 217 if($template_query->have_posts()){ 218 return $template_query->posts; 219 } 220 221 return []; 222 } 223 } -
fiber-admin/tags/3.1.2/readme.txt
r2962849 r2965072 5 5 Tested up to: 6.3.1 6 6 Requires PHP: 7.0 7 Stable tag: 3.1. 17 Stable tag: 3.1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 == Changelog == 48 48 49 = 3.1. 1=50 *Release Date - 05September 2023*49 = 3.1.2 = 50 *Release Date - 11 September 2023* 51 51 52 * Fixed: Disable dev mode. 53 * Changed: Update WordPress tested version. 52 * Fixed: Fix wrong CSM mode make draft preview blank page. 53 * Fixed: Fix CSM meta boxes didn't work. 54 * Fixed: Remove unused constant `PAGE_TYPE`. -
fiber-admin/trunk/changelog.txt
r2962849 r2965072 1 1 == Changelog == 2 3 = 3.1.2 = 4 *Release Date - 11 September 2023* 5 6 * Fixed: Fix wrong CSM mode make draft preview blank page. 7 * Fixed: Fix CSM meta boxes didn't work. 8 * Fixed: Remove unused constant `PAGE_TYPE`. 2 9 3 10 = 3.1.1 = -
fiber-admin/trunk/fiberadmin.php
r2962849 r2965072 4 4 * Plugin URI: https://wordpress.org/plugins/fiber-admin/ 5 5 * Description: 💈 Bring multiple customization features to make your own WordPress admin. 6 * Version: 3.1. 16 * Version: 3.1.2 7 7 * Requires at least: 5.2 8 8 * Requires PHP: 7.0 … … 138 138 add_action('admin_head', 'fiad_admin_additional_css'); 139 139 function fiad_admin_additional_css(){ 140 $page_csm_ids = fiad_get_ page_template_ids("csm", true, true);140 $page_csm_ids = fiad_get_csm_pages(); 141 141 if($page_csm_ids){ 142 142 $extra_styles = '<style>'; -
fiber-admin/trunk/includes/csm-mode.php
r2962829 r2965072 22 22 add_filter('fiad_csm_extra_js', [$this, 'fiad_csm_extra_js']); 23 23 add_filter('template_include', [$this, 'fiad_csm_load_template']); 24 //add_filter('show_admin_bar', [$this, 'fiad_csm_hide_admin_bar']); //todo: find way to enqueue admin-bar back25 24 26 25 // customize edit page … … 88 87 } 89 88 90 //todo: show admin bar91 /*92 * This is a temporary solution since enqueue admin-bar assets not working93 */94 public function fiad_csm_hide_admin_bar(){95 return !fiad_is_preview() && fiad_is_admin_user_role();96 }97 98 89 public function fiad_create_default_csm_page($value){ 99 $csm_mode = fiad_get_csm_mode_option('mode'); 100 $page_titles = [ 101 'coming-soon' => 'Coming Soon', 102 'maintenance' => 'Maintenance', 103 ]; 104 if(!$csm_mode){ 90 if(!fiad_get_csm_pages()){ 91 $page_titles = [ 92 'coming-soon' => 'Coming Soon', 93 'maintenance' => 'Maintenance', 94 ]; 105 95 foreach($page_titles as $mode => $title){ 106 96 $content_url = FIBERADMIN_ASSETS_URL . 'csm/' . $mode . '.html'; … … 163 153 <tr> 164 154 <td> 165 <h4>Logo</h4> 166 <div class="fiber-admin-preview"> 167 <img src="<?php echo esc_url($csm_logo); ?>" 168 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 169 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 170 </div> 171 <div class="fiber-admin-metabox--upload"> 172 <label> 173 <input class="regular-text" type="text" name="fiad_csm_content[logo]" 174 placeholder="<?php echo __('Input / Choose your Logo image', 'fiber-admin'); ?>" 175 value="<?php echo esc_url($csm_logo); ?>"/> 176 </label> 177 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 178 </div> 155 <fieldset> 156 <h4>Logo</h4> 157 <div class="fiber-admin-preview"> 158 <img src="<?php echo esc_url($csm_logo); ?>" 159 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 160 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 161 </div> 162 <div class="fiber-admin-metabox--upload"> 163 <label> 164 <input class="regular-text" type="text" name="fiad_csm_content[logo]" 165 placeholder="<?php echo __('Input / Choose your Logo image', 'fiber-admin'); ?>" 166 value="<?php echo esc_url($csm_logo); ?>"/> 167 </label> 168 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 169 </div> 170 </fieldset> 179 171 </td> 180 172 <td> 181 <h4>Background image</h4> 182 <div class="fiber-admin-preview"> 183 <img src="<?php echo esc_url($csm_background); ?>" 184 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 185 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 186 </div> 187 <div class="fiber-admin-metabox--upload"> 188 <label> 189 <input class="regular-text" type="text" name="fiad_csm_content[background]" 190 placeholder="<?php echo __('Input / Choose your Background image', 'fiber-admin'); ?>" 191 value="<?php echo esc_url($csm_background); ?>"/> 192 </label> 193 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 194 </div> 173 <fieldset> 174 <h4>Background image</h4> 175 <div class="fiber-admin-preview"> 176 <img src="<?php echo esc_url($csm_background); ?>" 177 alt="<?php echo esc_attr(get_bloginfo('name')); ?>" 178 width="<?php echo get_option('thumbnail_size_w'); ?>"/> 179 </div> 180 <div class="fiber-admin-metabox--upload"> 181 <label> 182 <input class="regular-text" type="text" name="fiad_csm_content[background]" 183 placeholder="<?php echo __('Input / Choose your Background image', 'fiber-admin'); ?>" 184 value="<?php echo esc_url($csm_background); ?>"/> 185 </label> 186 <button class="button fiber-admin-upload"><?php echo __('Select Image', 'fiber-admin'); ?></button> 187 </div> 188 </fieldset> 195 189 </td> 196 190 </tr> … … 223 217 wp_enqueue_media(); 224 218 wp_enqueue_script('fiber-admin'); 225 wp_enqueue_style('fiad-csm-css', FIBERADMIN_ASSETS_URL . 'css/fiber-csm.css', false, FIBERADMIN_VERSION);226 219 } 227 220 } -
fiber-admin/trunk/includes/helpers.php
r2962829 r2965072 167 167 } 168 168 169 if(!function_exists('fiad_get_page_template_ids')){170 function fiad_get_page_template_ids($template_name, $return_array = false, $suppress_filters = false){171 if($template_name){172 $args = [173 'post_type' => PAGE_TYPE,174 'posts_per_page' => - 1,175 'meta_key' => '_wp_page_template',176 'meta_value' => $template_name . '.php',177 'fields' => 'ids',178 'suppress_filters' => $suppress_filters,179 ];180 $template_query = new WP_Query($args);181 wp_reset_postdata();182 183 if($template_query->have_posts()){184 $pages = $template_query->posts;185 186 return $return_array ? $pages : $pages[0];187 }188 }189 190 return $return_array ? [] : null;191 }192 }193 194 169 if(!function_exists('fiad_is_preview')){ 195 170 function fiad_is_preview(){ 196 return sanitize_title(fiad_array_key_exists('preview', $_GET)); 171 $id = intval(fiad_array_key_exists('id', $_GET)); 172 173 return in_array($id, fiad_get_csm_pages()) && is_preview(); 197 174 } 198 175 } … … 215 192 216 193 return $template == FIBERADMIN_CSM_TEMPLATE; 217 }218 } 219 194 } 195 } 196 220 197 if(!function_exists('fiad_get_file_upload_path')){ 221 198 function fiad_get_file_upload_path($url){ … … 223 200 } 224 201 } 202 203 if(!function_exists('fiad_get_csm_pages')){ 204 function fiad_get_csm_pages(){ 205 $args = [ 206 'post_type' => 'page', 207 'post_status' => 'publish', 208 'posts_per_page' => - 1, 209 'meta_key' => '_wp_page_template', 210 'meta_value' => FIBERADMIN_CSM_TEMPLATE, 211 'fields' => 'ids', 212 'suppress_filters' => false, 213 ]; 214 $template_query = new WP_Query($args); 215 wp_reset_postdata(); 216 217 if($template_query->have_posts()){ 218 return $template_query->posts; 219 } 220 221 return []; 222 } 223 } -
fiber-admin/trunk/readme.txt
r2962849 r2965072 5 5 Tested up to: 6.3.1 6 6 Requires PHP: 7.0 7 Stable tag: 3.1. 17 Stable tag: 3.1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 == Changelog == 48 48 49 = 3.1. 1=50 *Release Date - 05September 2023*49 = 3.1.2 = 50 *Release Date - 11 September 2023* 51 51 52 * Fixed: Disable dev mode. 53 * Changed: Update WordPress tested version. 52 * Fixed: Fix wrong CSM mode make draft preview blank page. 53 * Fixed: Fix CSM meta boxes didn't work. 54 * Fixed: Remove unused constant `PAGE_TYPE`.
Note: See TracChangeset
for help on using the changeset viewer.