Plugin Directory

Changeset 2950144


Ignore:
Timestamp:
08/09/2023 08:21:46 AM (3 years ago)
Author:
lruizcode
Message:

Update to version 0.3 from GitHub

Location:
show-template-name
Files:
4 added
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • show-template-name/assets/icon.svg

    • Property svn:mime-type set to image/svg+xml
  • show-template-name/tags/0.3/readme.txt

    r2540422 r2950144  
    22Contributors: lruizcode
    33Tags: template, theme template
    4 Requires at least: 4.9
    5 Tested up to: 5.7.2
     4Requires at least: 5.2
     5Tested up to: 6.3
    66Requires PHP: 7.2
    7 Stable tag: 0.2
     7Stable tag: 0.3
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2626
    2727== Changelog ==
     28= 0.3 =
     29* Show in the top admin bar the name of the current template.
     30* Fix some PHP errors.
     31
    2832= 0.2 =
    2933* Filter by template name.
  • show-template-name/tags/0.3/show-template-name.php

    r2540422 r2950144  
    33 * Plugin Name: Show Template Name
    44 * Description: Plugin to see which template has assigned every page in the list.
    5  * Version: 0.2
     5 * Version: 0.3
    66 * Author: Luis Ruiz
    77 * Author URI: https://www.bubuku.com/
  • show-template-name/tags/0.3/src/admin/filter-action.php

    r2540422 r2950144  
    107107        }
    108108         
    109         if ( $screen->id == 'edit-page' ) {
     109        if ( is_object($screen) && $screen->id == 'edit-page' ) {
    110110            if ( isset($_GET['template_admin_filter'] ) && 'All' !== $_GET['template_admin_filter']  ) {
    111111                $template_id = sanitize_text_field($_GET['template_admin_filter']);
  • show-template-name/tags/0.3/src/class-plugin.php

    r2540422 r2950144  
    88   
    99    public const _CLASSES_ = __DIR__;
    10     public const CURRENT_VERSION = '0.2';
     10    public const CURRENT_VERSION = '0.3';
    1111
    1212    private const SUPPORTED_PHP_VERSION = '7.2.0';
     
    1414
    1515    public function __invoke() {
    16         if (! \is_admin()) {
    17             return;
    18         }
    1916
    2017        \define(__NAMESPACE__ . '\_PLUGIN_', dirname(__DIR__));
     
    3229    }
    3330
    34     final private function initialize(): void {
    35         require_once(self::_CLASSES_ . '/admin/filter-action.php');
     31    private function initialize(): void {
     32       
     33        if ( is_admin() ) {
     34            require_once(self::_CLASSES_ . '/admin/filter-action.php');
     35            if (class_exists('Bubuku\Plugins\ShowTemplateName\Admin\FilterAction')) {
     36                $filter_action_admin = new \Bubuku\Plugins\ShowTemplateName\Admin\FilterAction();
     37            }
    3638
    37         if (class_exists('Bubuku\Plugins\ShowTemplateName\Admin\FilterAction')) {
    38             $filter_action_admin = new \Bubuku\Plugins\ShowTemplateName\Admin\FilterAction();
     39        } else {
     40            require_once(self::_CLASSES_ . '/front/filter-action.php');
     41            if (class_exists('Bubuku\Plugins\ShowTemplateName\Front\FilterAction')) {
     42                $filter_action_admin = new \Bubuku\Plugins\ShowTemplateName\Front\FilterAction();
     43            }
    3944        }
    4045       
     
    4651     * @return void
    4752     */
    48     final private function uninstall(): void {
     53    private function uninstall(): void {
    4954        ( new Settings() )->unregister();
    5055    }
  • show-template-name/trunk/readme.txt

    r2540422 r2950144  
    22Contributors: lruizcode
    33Tags: template, theme template
    4 Requires at least: 4.9
    5 Tested up to: 5.7.2
     4Requires at least: 5.2
     5Tested up to: 6.3
    66Requires PHP: 7.2
    7 Stable tag: 0.2
     7Stable tag: 0.3
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2626
    2727== Changelog ==
     28= 0.3 =
     29* Show in the top admin bar the name of the current template.
     30* Fix some PHP errors.
     31
    2832= 0.2 =
    2933* Filter by template name.
  • show-template-name/trunk/show-template-name.php

    r2540422 r2950144  
    33 * Plugin Name: Show Template Name
    44 * Description: Plugin to see which template has assigned every page in the list.
    5  * Version: 0.2
     5 * Version: 0.3
    66 * Author: Luis Ruiz
    77 * Author URI: https://www.bubuku.com/
  • show-template-name/trunk/src/admin/filter-action.php

    r2540422 r2950144  
    107107        }
    108108         
    109         if ( $screen->id == 'edit-page' ) {
     109        if ( is_object($screen) && $screen->id == 'edit-page' ) {
    110110            if ( isset($_GET['template_admin_filter'] ) && 'All' !== $_GET['template_admin_filter']  ) {
    111111                $template_id = sanitize_text_field($_GET['template_admin_filter']);
  • show-template-name/trunk/src/class-plugin.php

    r2540422 r2950144  
    88   
    99    public const _CLASSES_ = __DIR__;
    10     public const CURRENT_VERSION = '0.2';
     10    public const CURRENT_VERSION = '0.3';
    1111
    1212    private const SUPPORTED_PHP_VERSION = '7.2.0';
     
    1414
    1515    public function __invoke() {
    16         if (! \is_admin()) {
    17             return;
    18         }
    1916
    2017        \define(__NAMESPACE__ . '\_PLUGIN_', dirname(__DIR__));
     
    3229    }
    3330
    34     final private function initialize(): void {
    35         require_once(self::_CLASSES_ . '/admin/filter-action.php');
     31    private function initialize(): void {
     32       
     33        if ( is_admin() ) {
     34            require_once(self::_CLASSES_ . '/admin/filter-action.php');
     35            if (class_exists('Bubuku\Plugins\ShowTemplateName\Admin\FilterAction')) {
     36                $filter_action_admin = new \Bubuku\Plugins\ShowTemplateName\Admin\FilterAction();
     37            }
    3638
    37         if (class_exists('Bubuku\Plugins\ShowTemplateName\Admin\FilterAction')) {
    38             $filter_action_admin = new \Bubuku\Plugins\ShowTemplateName\Admin\FilterAction();
     39        } else {
     40            require_once(self::_CLASSES_ . '/front/filter-action.php');
     41            if (class_exists('Bubuku\Plugins\ShowTemplateName\Front\FilterAction')) {
     42                $filter_action_admin = new \Bubuku\Plugins\ShowTemplateName\Front\FilterAction();
     43            }
    3944        }
    4045       
     
    4651     * @return void
    4752     */
    48     final private function uninstall(): void {
     53    private function uninstall(): void {
    4954        ( new Settings() )->unregister();
    5055    }
Note: See TracChangeset for help on using the changeset viewer.