Plugin Directory

Changeset 2556264

Timestamp:
06/30/2021 09:37:51 AM (3 years ago)
Author:
wpessential
Message:

modify hooks

Location:
wpessential
Files:
447 added
3 edited

Legend:

Unmodified
Added
Removed
  • wpessential/trunk/inc/Theme/Setup.php

    r2551814 r2556264  
    22
    33namespace WPEssential\Plugins\Theme;
    4 
    5 use WPEssential\Plugins\Utility\OptionsPannel;
    6 use WPEssential\Plugins\Utility\Tgm;
    74
    85final class Setup
     
    2320                        add_action( 'wp_body_open', 'wpe_header_template', 10 );
    2421                        self::theme_clases();
     22
    2523                        self::register();
    2624                        add_action( 'wp_footer', 'wpe_footer_template', 0 );
     
    6765    {
    6866        do_action( 'wpe_before_theme_setup' );
    69         Support::constructor();
    70         Images::constructor();
    71         Sidebars::constructor();
    72         Editor::constructor();
    73         Menus::constructor();
    74         if ( defined( 'WPE_TGM' ) && true === WPE_TGM ) {
    75             Tgm::constructor();
     67    }
     68
     69    public static function attach_actions ()
     70    {
     71        $action_list = apply_filters( 'wpe/theme/after_setup/hooks', [
     72            'Support'       => [ 'callback' => [ 'WPEssential\Plugins\Theme\Support', 'constructor' ], 'priority' => 10 ],
     73            'Images'        => [ 'callback' => [ 'WPEssential\Plugins\Theme\Images', 'constructor' ], 'priority' => 20 ],
     74            'Sidebars'      => [ 'callback' => [ 'WPEssential\Plugins\Theme\Sidebars', 'constructor' ], 'priority' => 30 ],
     75            'Editor'        => [ 'callback' => [ 'WPEssential\Plugins\Theme\Editor', 'constructor' ], 'priority' => 40 ],
     76            'Menus'         => [ 'callback' => [ 'WPEssential\Plugins\Theme\Menus', 'constructor' ], 'priority' => 50 ],
     77            'Tgm'           => [ 'callback' => [ 'WPEssential\Plugins\Utility\Tgm', 'constructor' ], 'priority' => 60 ],
     78            'OptionsPannel' => [ 'callback' => [ 'WPEssential\Plugins\Utility\OptionsPannel', 'constructor' ], 'priority' => 70 ],
     79            'Widgets'       => [ 'callback' => [ 'WPEssential\Plugins\Theme\Widgets', 'constructor' ], 'priority' => 80 ]
     80        ] );
     81
     82        $action_list = array_filter( $action_list );
     83        if ( ! empty( $action_list ) && $action_list ) {
     84            foreach ( $action_list as $key => $action ) {
     85                if ( ! wpe_array_get( $action, 'callback' ) && ! wpe_array_get( $action, 'priority' ) ) {
     86                    wp_die( __( "(wpe/theme/after_setup/hooks) => {$key} have no callback or priority", 'wpessential' ) );
     87                }
     88                add_action( 'wpe_before_theme_setup', wpe_array_get( $action, 'callback' ), wpe_array_get( $action, 'priority' ) );
     89            }
    7690        }
    77         OptionsPannel::constructor();
    78         Widgets::constructor();
    7991    }
    8092}
  • wpessential/trunk/readme.txt

    r2551871 r2556264  
    88WC requires at least: 4.0
    99WC tested up to: 5.0
    10 Stable tag: 1.0.0.00007
     10Stable tag: 1.0.0.0000
    1111License: GPL v2 or later
    1212License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5656== Changelog ==
    5757
     58
     59
     60
     61
     62
     63
     64
     65
    5866= 18/01/2021 1.0.0.00006 =
    5967- Fix errors.
  • wpessential/trunk/wpessential.php

    r2551814 r2556264  
    1313 * Plugin URI: https://wp.wpessential.org/plugins/wpessential/
    1414 * Author: WPEssential
    15  * Version: 1.0.0.00007
     15 * Version: 1.0.0.0000
    1616 * Author URI: https://wpessential.org/
    1717 * Text Domain: wpessential
Note: See TracChangeset for help on using the changeset viewer.