* Plugin URI: <%= config[:uri] %> * Description: <%= config[:name].capitalize %> plugin created with Marv. * Version: 0.1 * Author: <%= config[:author] %> * Author URI: <%= config[:author_uri] %> * License: GPL2 */ // Block direct access if( ! defined( 'ABSPATH' ) ) exit; /** * Enqueue scripts and styles. */ function <%= project_id %>_styles_scripts() { // Styles add_action( 'wp_enqueue_scripts', '<%= project_id %>_register_styles' ); add_action( 'wp_enqueue_scripts', '<%= project_id %>_enqueue_styles' ); // Scripts add_action( 'wp_enqueue_scripts', '<%= project_id %>_register_scripts' ); add_action( 'wp_enqueue_scripts', '<%= project_id %>_enqueue_scripts' ); // Admin scripts add_action( 'admin_enqueue_scripts', '<%= project_id %>_register_admin_scripts' ); add_action( 'admin_enqueue_scripts', '<%= project_id %>_enqueue_admin_scripts' ); } add_action( 'init', '<%= project_id %>_styles_scripts' ); /** * Register styles. */ function <%= project_id %>_register_styles() { // Theme wp_register_style( 'plugin', get_stylesheet_directory_uri() . '/plugin.css', '', '', 'screen' ); } /** * Enqueue styles. */ function <%= project_id %>_enqueue_styles() { wp_enqueue_style( 'plugin' ); } /** * Register scripts */ function <%= project_id %>_register_scripts() { // Theme wp_register_script( 'plugin', get_stylesheet_directory_uri() . '/javascripts/plugin.js', array( 'jquery' ), '', true ); } /** * Enqueue scripts */ function <%= project_id %>_enqueue_scripts() { wp_enqueue_script( 'plugin' ); if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } /** * Register admin scripts */ function <%= project_id %>_register_admin_scripts() { // Admin wp_register_script( 'admin', get_stylesheet_directory_uri() . '/javascripts/admin.js', array( 'jquery' ), '', true ); } /** * Enqueue admin scripts */ function <%= project_id %>_enqueue_admin_scripts() { wp_enqueue_script( 'admin' ); } /** * Allow automatic updates */ add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' );