Skip to content

Question about is_admin #585

Open
Open
@xoex

Description

@xoex

I was looking at the code, asked myself, isn't it better to wrap admin hooks in is_admin() ?
for example in this code :

private function define_admin_hooks() {

		$plugin_admin = new Ghorekeshi_Admin( $this->get_plugin_name(), $this->get_version() );

		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
	}

If wrap inside code in a if (is_admin()) {} so we don't run administrative hooks when non-admin pages and posts are loaded?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions