Last active
August 7, 2020 15:59
-
-
Save codearryaas/2e24dc5737f3daaf71b7c611370bea07 to your computer and use it in GitHub Desktop.
WP React Plugin Test Addon Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP React Plugin Test Addon | |
* Plugin URI: https://racase.com.np/ | |
* Description: A test plugin addon to teach React on WordPress. | |
* Version: 1.0.0 | |
* Author: Rakesh Lawaju | |
* Author URI: https://racase.com.np/ | |
* Text Domain: wp-react-plugin-test | |
* Domain Path: /i18n/languages/ | |
* Requires at least: 5.2 | |
* Requires PHP: 7.0 | |
* | |
* @package WP React Plugin Test Addon | |
*/ | |
defined( 'ABSPATH' ) || exit; | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_FILE', __FILE__ ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_ABSPATH', dirname( __FILE__ ) . '/' ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_VERSION', '1.0.0' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP React Plugin Test Addon | |
* Plugin URI: https://racase.com.np/ | |
* Description: A test plugin addon to teach React on WordPress. | |
* Version: 1.0.0 | |
* Author: Rakesh Lawaju | |
* Author URI: https://racase.com.np/ | |
* Text Domain: wp-react-plugin-test | |
* Domain Path: /i18n/languages/ | |
* Requires at least: 5.2 | |
* Requires PHP: 7.0 | |
* | |
* @package WP React Plugin Test Addon | |
*/ | |
defined( 'ABSPATH' ) || exit; | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_FILE', __FILE__ ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_ABSPATH', dirname( __FILE__ ) . '/' ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); | |
define( 'WP_REACT_PLUGIN_TEST_ADDON_VERSION', '1.0.0' ); | |
add_action( 'admin_enqueue_scripts', 'wp_react_plugin_test_addon_assets' ); | |
function wp_react_plugin_test_addon_assets() { | |
$screen = get_current_screen(); | |
if( ! empty( $screen->base ) && 'toplevel_page_wp-react-plugin-test' === $screen->base ) { | |
$deps = include_once 'app/build/admin.asset.php'; | |
wp_enqueue_script( 'wp-react-addon-admin-script', plugin_dir_url( WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_FILE ) . '/app/build/admin.js', $deps['dependencies'], $deps['version'], true ); | |
wp_enqueue_style( 'wp-react-addon-style', plugin_dir_url( WP_REACT_PLUGIN_TEST_ADDON_PLUGIN_FILE ) . '/app/build/admin.css', array( 'wp-components' ), $deps['version'] ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP React Plugin Test Addon | |
* Plugin URI: https://racase.com.np/ | |
* Description: A test plugin addon to teach React on WordPress. | |
* Version: 1.0.0 | |
* Author: Rakesh Lawaju | |
* Author URI: https://racase.com.np/ | |
* Text Domain: wp-react-plugin-test | |
* Domain Path: /i18n/languages/ | |
* Requires at least: 5.2 | |
* Requires PHP: 7.0 | |
* | |
* @package WP React Plugin Test Addon | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment