Complete the code to define the main plugin file header.
<?php
/*
Plugin Name: [1]
*/
The plugin header must include the Plugin Name to identify the plugin.
Complete the code to enqueue a stylesheet in the plugin.
<?php
function my_plugin_styles() {
wp_enqueue_style('[1]', plugin_dir_url(__FILE__) . 'css/style.css');
}
add_action('wp_enqueue_scripts', 'my_plugin_styles');The first argument of wp_enqueue_style is a unique handle for the stylesheet.
Fix the error in the plugin main file to prevent direct access.
<?php if (!defined('[1]')) { exit; } // Plugin code continues here
Checking if ABSPATH is defined prevents direct access to the plugin file.
Fill both blanks to register a shortcode in the plugin.
<?php function [1]() { return 'Hello, World!'; } add_shortcode('[2]', '[1]');
The function name and shortcode tag must match correctly to register the shortcode.
Fill both blanks to create a plugin activation hook.
<?php function [1]() { // Activation code here } register_activation_hook(__FILE__, '[1]'); add_action('[2]', '[1]');
The activation function name is used in both register_activation_hook and add_action with the correct hook.
