Skip to content

Commit

Permalink
Merge pull request #269 from lloc/admin-checkout
Browse files Browse the repository at this point in the history
Using another action for Admin CSS and Scripts
  • Loading branch information
lloc authored Jan 7, 2024
2 parents 5629f6e + cd2626f commit 3250bc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions includes/MslsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function init() {
\lloc\Msls\ContentImport\Service::instance()->register();

if ( is_admin() ) {
add_action( 'admin_menu', [ $obj, 'admin_menu' ] );
add_action( 'admin_enqueue_scripts', [ $obj, 'custom_enqueue' ] );

add_action( 'admin_menu', [ MslsAdmin::class, 'init' ] );
add_action( 'load-post.php', [ MslsMetaBox::class, 'init' ] );
Expand Down Expand Up @@ -265,7 +265,7 @@ public function admin_bar_init() {
*
* @return boolean
*/
public function admin_menu() {
public function custom_enqueue() {
$ver = defined( 'MSLS_PLUGIN_VERSION' ) ? constant( 'MSLS_PLUGIN_VERSION' ) : false;
$postfix = defined( 'SCRIPT_DEBUG' ) && constant( 'SCRIPT_DEBUG' ) ? '' : '.min';

Expand Down
2 changes: 1 addition & 1 deletion tests/test-mslsplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function test_admin_menu(): void {
Functions\when( 'wp_enqueue_style' )->returnArg();
Functions\when( 'plugins_url' )->justReturn( 'https://lloc.de/wp-content/plugins' );

$this->assertIsBool( $this->get_test()->admin_menu() );
$this->assertIsBool( $this->get_test()->custom_enqueue() );
}

/**
Expand Down

0 comments on commit 3250bc3

Please sign in to comment.