Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request avillegasn#2 from davilera/plugin-data-fix
Browse files Browse the repository at this point in the history
Plugin Data is available in both the front-end and the admin area.
  • Loading branch information
avillegasn authored Mar 29, 2019
2 parents e0c414b + 71e512f commit a665c36
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wp-beb.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function init_options() {

public function init_hooks() {

add_action( 'admin_init', [ $this, 'admin_init' ] );
add_action( 'init', [ $this, 'plugin_data_init' ] );

// Works only if Gutenberg is available.
if ( function_exists( 'register_block_type' ) ) {
Expand Down Expand Up @@ -135,16 +135,16 @@ public function enqueue_block_editor_assets() {

}//end enqueue_block_editor_assets()

public function admin_init() {
public function plugin_data_init() {

// Get current plugin data.
$data = get_plugin_data( __FILE__ );
$this->plugin_name = $data['Name'];
$this->plugin_version = $data['Version'];
$data = get_file_data( __FILE__, [ 'Plugin Name', 'Version' ], 'plugin' );

$this->plugin_name = $data[0];
$this->plugin_version = $data[1];
$this->plugin_slug = plugin_basename( __FILE__, '.php' );
$this->plugin_name_sanitized = basename( __FILE__, '.php' );

}//end admin_init()
}//end plugin_data_init()

public function admin_menu() {

Expand Down

0 comments on commit a665c36

Please sign in to comment.