Plugin Directory

Changeset 2965072


Ignore:
Timestamp:
09/11/2023 04:26:54 AM (2 years ago)
Author:
daomapsieucap
Message:

Update to version 3.1.2 from GitHub

Location:
fiber-admin
Files:
2 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • fiber-admin/tags/3.1.2/changelog.txt

    r2962849 r2965072  
    11== 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`.
    29
    310= 3.1.1 =
  • fiber-admin/tags/3.1.2/fiberadmin.php

    r2962849 r2965072  
    44 * Plugin URI:        https://wordpress.org/plugins/fiber-admin/
    55 * Description:       💈 Bring multiple customization features to make your own WordPress admin.
    6  * Version:           3.1.1
     6 * Version:           3.1.2
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.0
     
    138138add_action('admin_head', 'fiad_admin_additional_css');
    139139function fiad_admin_additional_css(){
    140     $page_csm_ids = fiad_get_page_template_ids("csm", true, true);
     140    $page_csm_ids = fiad_get_csm_pages();
    141141    if($page_csm_ids){
    142142        $extra_styles = '<style>';
  • fiber-admin/tags/3.1.2/includes/csm-mode.php

    r2962829 r2965072  
    2222        add_filter('fiad_csm_extra_js', [$this, 'fiad_csm_extra_js']);
    2323        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 back
    2524       
    2625        // customize edit page
     
    8887    }
    8988   
    90     //todo: show admin bar
    91     /*
    92      * This is a temporary solution since enqueue admin-bar assets not working
    93      */
    94     public function fiad_csm_hide_admin_bar(){
    95         return !fiad_is_preview() && fiad_is_admin_user_role();
    96     }
    97    
    9889    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            ];
    10595            foreach($page_titles as $mode => $title){
    10696                $content_url         = FIBERADMIN_ASSETS_URL . 'csm/' . $mode . '.html';
     
    163153            <tr>
    164154                <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>
    179171                </td>
    180172                <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>
    195189                </td>
    196190            </tr>
     
    223217            wp_enqueue_media();
    224218            wp_enqueue_script('fiber-admin');
    225             wp_enqueue_style('fiad-csm-css', FIBERADMIN_ASSETS_URL . 'css/fiber-csm.css', false, FIBERADMIN_VERSION);
    226219        }
    227220    }
  • fiber-admin/tags/3.1.2/includes/helpers.php

    r2962829 r2965072  
    167167}
    168168
    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 
    194169if(!function_exists('fiad_is_preview')){
    195170    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();
    197174    }
    198175}
     
    215192       
    216193        return $template == FIBERADMIN_CSM_TEMPLATE;
    217   }
    218 }
    219  
     194    }
     195}
     196
    220197if(!function_exists('fiad_get_file_upload_path')){
    221198    function fiad_get_file_upload_path($url){
     
    223200    }
    224201}
     202
     203if(!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  
    55Tested up to: 6.3.1
    66Requires PHP: 7.0
    7 Stable tag: 3.1.1
     7Stable tag: 3.1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4747== Changelog ==
    4848
    49 = 3.1.1 =
    50 *Release Date - 05 September 2023*
     49= 3.1.2 =
     50*Release Date - 11 September 2023*
    5151
    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  
    11== 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`.
    29
    310= 3.1.1 =
  • fiber-admin/trunk/fiberadmin.php

    r2962849 r2965072  
    44 * Plugin URI:        https://wordpress.org/plugins/fiber-admin/
    55 * Description:       💈 Bring multiple customization features to make your own WordPress admin.
    6  * Version:           3.1.1
     6 * Version:           3.1.2
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.0
     
    138138add_action('admin_head', 'fiad_admin_additional_css');
    139139function fiad_admin_additional_css(){
    140     $page_csm_ids = fiad_get_page_template_ids("csm", true, true);
     140    $page_csm_ids = fiad_get_csm_pages();
    141141    if($page_csm_ids){
    142142        $extra_styles = '<style>';
  • fiber-admin/trunk/includes/csm-mode.php

    r2962829 r2965072  
    2222        add_filter('fiad_csm_extra_js', [$this, 'fiad_csm_extra_js']);
    2323        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 back
    2524       
    2625        // customize edit page
     
    8887    }
    8988   
    90     //todo: show admin bar
    91     /*
    92      * This is a temporary solution since enqueue admin-bar assets not working
    93      */
    94     public function fiad_csm_hide_admin_bar(){
    95         return !fiad_is_preview() && fiad_is_admin_user_role();
    96     }
    97    
    9889    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            ];
    10595            foreach($page_titles as $mode => $title){
    10696                $content_url         = FIBERADMIN_ASSETS_URL . 'csm/' . $mode . '.html';
     
    163153            <tr>
    164154                <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>
    179171                </td>
    180172                <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>
    195189                </td>
    196190            </tr>
     
    223217            wp_enqueue_media();
    224218            wp_enqueue_script('fiber-admin');
    225             wp_enqueue_style('fiad-csm-css', FIBERADMIN_ASSETS_URL . 'css/fiber-csm.css', false, FIBERADMIN_VERSION);
    226219        }
    227220    }
  • fiber-admin/trunk/includes/helpers.php

    r2962829 r2965072  
    167167}
    168168
    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 
    194169if(!function_exists('fiad_is_preview')){
    195170    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();
    197174    }
    198175}
     
    215192       
    216193        return $template == FIBERADMIN_CSM_TEMPLATE;
    217   }
    218 }
    219  
     194    }
     195}
     196
    220197if(!function_exists('fiad_get_file_upload_path')){
    221198    function fiad_get_file_upload_path($url){
     
    223200    }
    224201}
     202
     203if(!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  
    55Tested up to: 6.3.1
    66Requires PHP: 7.0
    7 Stable tag: 3.1.1
     7Stable tag: 3.1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4747== Changelog ==
    4848
    49 = 3.1.1 =
    50 *Release Date - 05 September 2023*
     49= 3.1.2 =
     50*Release Date - 11 September 2023*
    5151
    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.