Added PuC for testing
This commit is contained in:
79
d5-admin-wp.php
Normal file
79
d5-admin-wp.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* @link https://design519.com
|
||||
* @since 1.0.0
|
||||
* @package D5_Admin_WP
|
||||
*
|
||||
* @wordpress-plugin
|
||||
* Plugin Name: D5 Admin WP
|
||||
* Plugin URI: TODO: Git link
|
||||
* Description: Common admin functions
|
||||
* Version: 1.0.0
|
||||
* Author: Dee Five
|
||||
* Author URI: https://design519.com/
|
||||
* License: GPL-2.0+
|
||||
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
* Text Domain: d5-admin-wp
|
||||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
// Prevent execution outside of WP environment
|
||||
defined('ABSPATH') or die("No direct access");
|
||||
|
||||
|
||||
// For easy retrieval of plugin URL and path throughout the plugin files
|
||||
if ( ! defined( 'D5AW_BASE_FILE' ) )
|
||||
define( 'D5AW_BASE_FILE', __FILE__ );
|
||||
if ( ! defined( 'D5AW_BASE_DIR' ) )
|
||||
define( 'D5AW_BASE_DIR', dirname( D5AW_BASE_FILE ) );
|
||||
if ( ! defined( 'D5AW_PLUGIN_URL' ) )
|
||||
define( 'D5AW_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||
|
||||
|
||||
// Includes
|
||||
|
||||
//require_once( 'inc/functions.php' );
|
||||
require 'plugin-update-checker.php';
|
||||
|
||||
// Styles and Scripts
|
||||
function register_d5aw_scripts() {
|
||||
|
||||
$scriptversion = filemtime( plugin_dir_path( __FILE__ ) . 'js/d5aw-scripts.js');
|
||||
$styleversion = filemtime( plugin_dir_path( __FILE__ ) . 'css/d5aw-style.css');
|
||||
|
||||
wp_enqueue_style( 'd5aw-main-style', plugins_url( '/css/d5aw-style.css' , __FILE__ ), array(), $styleversion );
|
||||
wp_register_script( 'd5aw-main-scripts', plugins_url( '/js/d5aw-scripts.js' , __FILE__ ), array(),$scriptversion, true );
|
||||
wp_enqueue_script( 'jquery' );
|
||||
wp_localize_script( 'd5aw-main-scripts', 'd5aw', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
|
||||
}
|
||||
|
||||
//add_action( 'wp_enqueue_scripts', 'register_d5aw_scripts' );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Updater Functions
|
||||
*
|
||||
* Uses: https://github.com/YahnisElsts/plugin-update-checker
|
||||
*
|
||||
* Requires PuC folder and vendor folder as well as
|
||||
* plugin-update-checker.php file
|
||||
*
|
||||
*/
|
||||
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
|
||||
'https://github.com/D5code/d5-admin-tools/',
|
||||
__FILE__,
|
||||
'd5-admin-tools'
|
||||
);
|
||||
|
||||
//Optional: If you're using a private repository, specify the access token like this:
|
||||
//$myUpdateChecker->setAuthentication('your-token-here');
|
||||
|
||||
//Optional: Set the branch that contains the stable release.
|
||||
$myUpdateChecker->setBranch( 'master' );
|
||||
|
||||
Reference in New Issue
Block a user