option_key.
*/
$contexts = apply_filters(
'noindex_seo_contexts',
array(
'single' => 'noindex_seo_single',
'page' => 'noindex_seo_page',
'privacy_policy' => 'noindex_seo_privacy_policy',
'attachment' => 'noindex_seo_attachment',
'category' => 'noindex_seo_category',
'tag' => 'noindex_seo_tag',
'author' => 'noindex_seo_author',
'post_type_archive' => 'noindex_seo_post_type_archive',
'date' => 'noindex_seo_date',
'day' => 'noindex_seo_day',
'month' => 'noindex_seo_month',
'year' => 'noindex_seo_year',
'archive' => 'noindex_seo_archive',
'search' => 'noindex_seo_search',
'error' => 'noindex_seo_error',
'front_page' => 'noindex_seo_front_page',
'home' => 'noindex_seo_home',
'singular' => 'noindex_seo_singular',
'paged' => 'noindex_seo_paged',
'preview' => 'noindex_seo_preview',
'customize_preview' => 'noindex_seo_customize_preview',
'time' => 'noindex_seo_time',
)
);
// Validate filtered contexts to prevent injection of invalid option names.
if ( is_array( $contexts ) ) {
foreach ( $contexts as $context => $option_key ) {
// Ensure option_key follows expected pattern.
if ( ! is_string( $option_key ) || 0 !== strpos( $option_key, 'noindex_seo_' ) ) {
unset( $contexts[ $context ] );
}
}
} else {
// If contexts is not an array after filtering, reset to defaults.
$contexts = array();
}
// PRIORITY 1: Check for per-post/page override (granular control).
// If granular control is enabled and we're on a singular post/page,
// check if there's an override for this specific content.
$granular_enabled = get_option( 'noindex_seo_config_granular', 0 );
if ( $granular_enabled && is_singular() ) {
$post_id = get_queried_object_id();
if ( $post_id ) {
$override = get_post_meta( $post_id, '_noindex_seo_override', true );
if ( $override ) {
// Collect active directives from post meta.
$post_directives = array();
$available_directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
foreach ( $available_directives as $directive ) {
$meta_value = get_post_meta( $post_id, '_noindex_seo_' . $directive, true );
// Explicitly check for 1 or '1' to avoid false positives with '0' string.
if ( 1 === absint( $meta_value ) ) {
$post_directives[] = $directive;
}
}
// Apply post-specific directives if any are enabled.
if ( ! empty( $post_directives ) ) {
$implementation_method = get_option( 'noindex_seo_config_method', 'meta' );
noindex_seo_metarobots( $implementation_method, $post_directives );
return; // Exit early - post meta takes precedence over global settings.
}
}
}
}
// PRIORITY 2: Apply global settings (existing behavior).
// Try to get the options from the transient.
$options = get_transient( 'noindex_seo_options' );
// Available directives.
$available_directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
if ( false === $options || empty( $options ) ) {
// Transient not set, retrieve options from the database.
$options = array();
foreach ( $contexts as $context => $option_key ) {
// Load all directives for each context.
foreach ( $available_directives as $directive ) {
$directive_key = str_replace( 'noindex', $directive, $option_key );
$options[ $directive_key ] = get_option( $directive_key, 0 );
}
}
// Set the transient for 1 hour to cache the options.
set_transient( 'noindex_seo_options', $options, HOUR_IN_SECONDS );
}
// Define current conditions, ordered from most specific to most general.
// Note on 'date' context: is_date() returns true for any date-based archive (day/month/year/time).
// In normal WordPress, if is_date() is true, at least one specific date function should also be true.
// However, this catch-all condition is kept for edge cases, custom implementations, or future
// WordPress versions that might introduce new date archive types not covered by the specific functions.
// While this condition may rarely (or never) be true in practice, it provides defensive coverage.
$current_conditions = array(
'single' => is_single(),
'page' => is_page(),
'attachment' => is_attachment(),
'privacy_policy' => is_privacy_policy(),
'category' => is_category(),
'tag' => is_tag(),
'author' => is_author(),
'post_type_archive' => is_post_type_archive(),
'day' => is_day(),
'month' => is_month(),
'year' => is_year(),
'time' => is_time(),
'date' => is_date() && ! ( is_day() || is_month() || is_year() || is_time() ), // Catch-all for date archives.
'archive' => is_archive() && ! ( is_category() || is_tag() || is_author() || is_post_type_archive() || is_date() ),
'search' => is_search(),
'error' => is_404(),
'front_page' => is_front_page() && ! is_paged() && ! is_home(),
'home' => is_home() && ! is_paged(),
'singular' => is_singular() && ! ( is_single() || is_page() || is_attachment() ),
'paged' => is_paged() && ! is_front_page() && ! is_home(),
'preview' => is_preview(),
'customize_preview' => is_customize_preview(),
);
// Get implementation method configuration.
$implementation_method = get_option( 'noindex_seo_config_method', 'meta' );
// Iterate through the contexts and collect active directives.
foreach ( $contexts as $context => $option_key ) {
if (
isset( $current_conditions[ $context ] ) &&
$current_conditions[ $context ]
) {
// Collect all active directives for this context.
$active_directives = array();
foreach ( $available_directives as $directive ) {
$directive_key = str_replace( 'noindex', $directive, $option_key );
if ( isset( $options[ $directive_key ] ) && (bool) $options[ $directive_key ] ) {
$active_directives[] = $directive;
}
}
// Apply directives if any are active.
if ( ! empty( $active_directives ) ) {
noindex_seo_metarobots( $implementation_method, $active_directives );
break; // Prevent multiple meta tags from being added.
}
}
}
unset( $contexts, $options, $current_conditions, $available_directives );
}
/**
* Checks if configuration migration is needed and executes it.
*
* This function runs on plugin load and checks the configuration version stored in the database.
* If the version is less than 2 (or doesn't exist), it migrates old single-directive options
* to the new multi-directive system introduced in version 2.0.
*
* @since 2.0.0
*
* @return void
*/
function noindex_seo_check_migration(): void {
$current_config_version = get_option( 'noindex_seo_config_version', 0 );
// Check if we need to migrate to version 2.
if ( $current_config_version < 2 ) {
noindex_seo_migrate_to_v2();
}
}
/**
* Migrates configuration from version 1.x to version 2.0.
*
* Version 1.x had single options per context (e.g., noindex_seo_attachment).
* Version 2.0 has 5 independent directives per context (e.g., noindex_seo_attachment,
* nofollow_seo_attachment, noarchive_seo_attachment, etc.).
*
* This function:
* 1. Reads existing noindex_seo_* options
* 2. Preserves their values (they're already in the correct format)
* 3. Initializes new directive options (nofollow, noarchive, nosnippet, noimageindex) to 0
* 4. Marks migration as complete by setting config version to 2
* 5. Clears the transient cache
*
* @since 2.0.0
*
* @return void
*/
function noindex_seo_migrate_to_v2(): void {
$contexts = array(
'error',
'archive',
'attachment',
'author',
'category',
'comment_feed',
'customize_preview',
'date',
'day',
'feed',
'front_page',
'home',
'month',
'page',
'paged',
'post_type_archive',
'preview',
'privacy_policy',
'robots',
'search',
'single',
'singular',
'tag',
'time',
'year',
);
$new_directives = array( 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
// For each context, initialize new directives to 0.
// The noindex directive already exists and will keep its value.
foreach ( $contexts as $context ) {
foreach ( $new_directives as $directive ) {
$option_key = $directive . '_seo_' . $context;
// Only set if it doesn't exist (shouldn't exist in v1.x).
if ( false === get_option( $option_key ) ) {
add_option( $option_key, 0 );
}
}
}
// Mark migration as complete.
update_option( 'noindex_seo_config_version', 2 );
// Clear transient cache.
delete_transient( 'noindex_seo_options' );
}
add_action( 'template_redirect', 'noindex_seo_show' );
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'noindex_seo_settings_link' );
add_action( 'admin_init', 'noindex_seo_register' );
add_action( 'admin_menu', 'noindex_seo_menu' );
add_action( 'admin_enqueue_scripts', 'noindex_seo_enqueue_admin_assets' );
add_action( 'plugins_loaded', 'noindex_seo_check_migration' );
/**
* Enqueues admin CSS and JavaScript assets.
*
* Loads the modern admin panel styles and interactive JavaScript only on the
* noindex SEO settings page for better performance.
*
* @since 2.0.0
*
* @param string $hook The current admin page hook.
* @return void
*/
function noindex_seo_enqueue_admin_assets( string $hook ): void {
// Only load on our settings page..
if ( 'settings_page_noindex_seo' !== $hook ) {
return;
}
// Enqueue admin CSS..
wp_enqueue_style(
'noindex-seo-admin',
plugins_url( 'assets/css/admin.css', __FILE__ ),
array(),
'2.0.0',
'all'
);
// Enqueue admin JavaScript..
wp_enqueue_script(
'noindex-seo-admin',
plugins_url( 'assets/js/admin.js', __FILE__ ),
array( 'jquery' ),
'2.0.0',
true
);
// Localize script with translations..
wp_localize_script(
'noindex-seo-admin',
'noindexSeoAdmin',
array(
'successMessage' => __( 'Settings saved successfully!', 'noindex-seo' ),
'expandAll' => __( 'Expand All', 'noindex-seo' ),
'collapseAll' => __( 'Collapse All', 'noindex-seo' ),
)
);
}
/**
* Enqueue Gutenberg sidebar panel assets.
*
* Loads the JavaScript for the native Gutenberg sidebar panel
* that allows editing robots directives in the Block Editor.
*
* @since 2.0.0
*
* @return void
*/
function noindex_seo_enqueue_editor_assets(): void {
// Check if granular control is enabled.
$granular_enabled = get_option( 'noindex_seo_config_granular', 0 );
if ( ! $granular_enabled ) {
return;
}
// Get the current screen.
$screen = get_current_screen();
// Only load in block editor for supported post types.
if ( ! $screen || ! $screen->is_block_editor() ) {
return;
}
// Enqueue editor sidebar script.
wp_enqueue_script(
'noindex-seo-editor-sidebar',
plugins_url( 'assets/js/editor-sidebar.js', __FILE__ ),
array(
'wp-plugins',
'wp-edit-post',
'wp-element',
'wp-components',
'wp-data',
'wp-i18n',
),
'2.0.0',
true
);
// Set up translations for the script.
wp_set_script_translations(
'noindex-seo-editor-sidebar',
'noindex-seo'
);
}
add_action( 'enqueue_block_editor_assets', 'noindex_seo_enqueue_editor_assets' );
/**
* Adds a "Settings" link to the plugin row actions on the Plugins admin screen.
*
* This function appends a direct link to the plugin's settings page within the list of action links
* shown for the plugin on the Plugins page (`/wp-admin/plugins.php`). This improves user accessibility
* by allowing quick access to the plugin's configuration page.
*
* Hooked to the {@see 'plugin_action_links_{plugin_basename}'} filter.
*
* @since 1.0.0
*
* @param array $links Array of existing action links for the plugin.
* @return array Modified array including the "Settings" link.
*/
function noindex_seo_settings_link( array $links ): array {
$settings_link = '' . esc_html__( 'Settings', 'noindex-seo' ) . '';
$links[] = $settings_link;
return $links;
}
/**
* Registers the "noindex SEO" settings page in the WordPress admin menu.
*
* This function adds an entry under the "Settings" menu in the WordPress admin area,
* which links to the plugin's main configuration page. The settings page is only accessible
* to users with the 'manage_options' capability.
*
* Internally uses {@see add_options_page()} to register the page.
*
* @since 1.0.0
*
* @return void
*/
function noindex_seo_menu(): void {
add_options_page(
__( 'noindex SEO', 'noindex-seo' ),
__( 'noindex SEO', 'noindex-seo' ),
'manage_options',
'noindex_seo',
'noindex_seo_admin'
);
}
/**
* Registers all settings used by the 'noindex SEO' plugin.
*
* This function registers individual options for each context and directive combination.
* Each context (e.g., single posts, category pages, archives, etc.) can have multiple
* directives (noindex, nofollow, noarchive, nosnippet, noimageindex) applied independently.
*
* Each setting is stored as an integer (0 or 1), where 1 indicates that the directive is enabled
* for that context.
*
* All settings are grouped under the option group 'noindexseo' and will be handled by the
* WordPress Settings API when the options form is submitted.
*
* Also registers the general configuration options.
* A transient cache is cleared upon update using the {@see 'update_option_noindexseo'} action.
*
* @since 1.0.0
* @since 2.0.0 Added support for multiple directives per context.
*
* @return void
*/
function noindex_seo_register(): void {
$contexts = array(
'error',
'archive',
'attachment',
'author',
'category',
'comment_feed',
'customize_preview',
'date',
'day',
'feed',
'front_page',
'home',
'month',
'page',
'paged',
'post_type_archive',
'preview',
'privacy_policy',
'robots',
'search',
'single',
'singular',
'tag',
'time',
'year',
);
$directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
// Register each directive for each context.
foreach ( $contexts as $context ) {
foreach ( $directives as $directive ) {
register_setting(
'noindexseo',
$directive . '_seo_' . $context,
array(
'type' => 'integer',
'default' => 0,
)
);
}
}
register_setting(
'noindexseo',
'noindex_seo_config_seoplugins',
array(
'type' => 'integer',
'default' => 0,
)
);
register_setting(
'noindexseo',
'noindex_seo_config_method',
array(
'type' => 'string',
'default' => 'meta',
'sanitize_callback' => function ( $value ): string {
return in_array( $value, array( 'meta', 'header', 'both' ), true ) ? $value : 'meta';
},
)
);
register_setting(
'noindexseo',
'noindex_seo_config_granular',
array(
'type' => 'integer',
'default' => 0,
)
);
// Hook to settings update to clear transient cache..
// Note: Hook receives $old_value and $value parameters but we don't need them.
add_action( 'update_option_noindexseo', 'noindex_seo_clear_transient', 10, 0 );
}
/**
* Clears the cached plugin settings stored in the transient.
*
* This function deletes the 'noindex_seo_options' transient to ensure that updated
* option values are fetched fresh from the database on the next request. It is typically
* triggered after the plugin settings are updated to prevent stale data from being used.
*
* Hooked to the {@see 'update_option_noindexseo'} action.
*
* @since 1.0.0
* @since 2.0.0 Added admin context verification for security.
*
* @return void
*/
function noindex_seo_clear_transient(): void {
// Verify we're in a valid admin context..
if ( ! is_admin() && ! wp_doing_ajax() ) {
return;
}
// Delete the transient cache..
delete_transient( 'noindex_seo_options' );
}
/**
* Detects potential conflicts with other SEO plugins and displays an admin notice.
*
* This function checks for the presence of known SEO plugins that may conflict with
* the functionality of 'noindex SEO'. If a conflicting plugin is active and the user
* has not opted to suppress warnings (via the 'noindex_seo_config_seoplugins' option),
* a dismissible admin notice is displayed to alert the site administrator.
*
* The list of conflicting plugins includes popular SEO tools such as Yoast SEO, Rank Math,
* SEOPress, and others. The check is performed using {@see is_plugin_active()}.
*
* Hooked to the {@see 'admin_init'} action.
*
* @since 1.1.0
*
* @return void
*/
function noindex_seo_detect_conflicts(): void {
$option_config_seoplugins = get_option( 'noindex_seo_config_seoplugins', 0 );
if ( ! absint( $option_config_seoplugins ) ) {
// Include the plugin.php file if the function is not available..
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// Define an associative array of conflicting plugins: slug/file => real plugin name..
$conflicting_plugins = array(
'all-in-one-seo-pack/all_in_one_seo_pack.php' => 'All in One SEO',
'premium-seo-pack/index.php' => 'Premium SEO Pack',
'seo-by-rank-math/rank-math.php' => 'Rank Math SEO',
'wp-seopress/seopress.php' => 'SEOPress',
'slim-seo/slim-seo.php' => 'Slim SEO',
'squirrly-seo/squirrly.php' => 'Squirrly SEO',
'autodescription/autodescription.php' => 'The SEO Framework',
'wordpress-seo/wp-seo.php' => 'Yoast SEO',
);
// Iterate through the conflicting plugins to check if any are active..
foreach ( $conflicting_plugins as $plugin_path => $plugin_name ) {
if ( is_plugin_active( $plugin_path ) ) {
// Add an admin notice if a conflicting plugin is active..
add_action(
'admin_notices',
function () use ( $plugin_name ) {
echo '
';
// translators: plugin name.
printf( esc_html__( 'noindex SEO has detected that %s is active. This may cause conflicts. Please configure the options accordingly.', 'noindex-seo' ), esc_html( $plugin_name ) );
echo '
';
}
);
break; // Stop checking after finding the first conflict.
}
}
}
}
add_action( 'admin_init', 'noindex_seo_detect_conflicts' );
/**
* Processes the form submission for the 'noindex SEO' plugin settings.
*
* This function handles the saving of plugin options submitted from the custom admin form.
* It first verifies the current user's capability and nonce for security. Then it resets all
* registered options to `0`, and selectively updates those submitted as checked in the form.
*
* Additionally, it updates the general configuration settings,
* clears the plugin's transient cache, and redirects back to the settings page.
*
* Hooked to the {@see 'admin_post_update_noindex_seo'} action.
*
* @since 1.2.0
* @since 2.0.0 Added support for multiple directives (noindex, nofollow, noarchive, nosnippet, noimageindex).
*
* @return void
*/
function noindex_seo_process_form(): void {
if ( ! current_user_can( 'manage_options' ) || ! check_admin_referer( 'update_noindex_seo_nonce' ) ) {
wp_die( esc_html__( 'Permission denied or invalid nonce.', 'noindex-seo' ) );
}
$contexts = array(
'error',
'archive',
'attachment',
'author',
'category',
'comment_feed',
'customize_preview',
'date',
'day',
'feed',
'front_page',
'home',
'month',
'page',
'paged',
'post_type_archive',
'preview',
'privacy_policy',
'robots',
'search',
'single',
'singular',
'tag',
'time',
'year',
);
$directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
// Get the implementation method to validate field compatibility.
$method_value = isset( $_POST['noindex_seo_config_method'] )
? sanitize_text_field( wp_unslash( $_POST['noindex_seo_config_method'] ) )
: 'meta';
// Validate method.
$method_value = in_array( $method_value, array( 'meta', 'header', 'both' ), true ) ? $method_value : 'meta';
// Fields that only work with HTTP headers.
$header_only_contexts = array( 'attachment', 'feed', 'comment_feed' );
$is_header_enabled = in_array( $method_value, array( 'header', 'both' ), true );
// Reset all options to 0 and process form data.
foreach ( $contexts as $context ) {
// Validate context is in our allowed list (defense in depth).
if ( ! in_array( $context, $contexts, true ) ) {
continue; // Skip invalid context.
}
foreach ( $directives as $directive ) {
// Validate directive is in our allowed list (defense in depth).
if ( ! in_array( $directive, $directives, true ) ) {
continue; // Skip invalid directive.
}
$option_key = $directive . '_seo_' . $context;
$option_value = isset( $_POST[ $option_key ] ) ? sanitize_text_field( wp_unslash( $_POST[ $option_key ] ) ) : '';
// Additional validation: only accept '1' or empty string.
if ( '' !== $option_value && '1' !== $option_value ) {
$option_value = ''; // Invalid value, treat as unchecked.
}
// Validate: header-only contexts require header implementation method.
if ( in_array( $context, $header_only_contexts, true ) && ! $is_header_enabled ) {
// Force to 0 - this context doesn't work with current method.
update_option( $option_key, 0 );
continue;
}
// Only set to 1 if the checkbox was actually checked (value should be "1").
if ( '1' === $option_value ) {
update_option( $option_key, 1 );
} else {
update_option( $option_key, 0 );
}
}
}
// Save general configuration option..
$config_value = isset( $_POST['noindex_seo_config_seoplugins'] )
? absint( $_POST['noindex_seo_config_seoplugins'] )
: 0;
// Ensure value is either 0 or 1..
$config_value = ( 1 === $config_value ) ? 1 : 0;
update_option( 'noindex_seo_config_seoplugins', $config_value );
// Save implementation method configuration (already validated above).
update_option( 'noindex_seo_config_method', $method_value );
// Save granular control configuration.
$granular_value = isset( $_POST['noindex_seo_config_granular'] )
? absint( $_POST['noindex_seo_config_granular'] )
: 0;
$granular_value = ( 1 === $granular_value ) ? 1 : 0;
update_option( 'noindex_seo_config_granular', $granular_value );
// Clear cache..
delete_transient( 'noindex_seo_options' );
wp_safe_redirect( admin_url( 'options-general.php?page=noindex_seo&updated=true' ) );
exit;
}
add_action( 'admin_post_update_noindex_seo', 'noindex_seo_process_form' );
/**
* Register post meta for REST API and Gutenberg support.
*
* Registers all robots directive post meta fields with REST API support
* to enable Gutenberg sidebar panel to read and write values.
*
* @since 2.0.0
*
* @return void
*/
function noindex_seo_register_post_meta(): void {
// Check if granular control is enabled.
$granular_enabled = get_option( 'noindex_seo_config_granular', 0 );
if ( ! $granular_enabled ) {
return;
}
// Get all public post types.
$post_types = get_post_types( array( 'public' => true ), 'names' );
// Meta fields to register.
$meta_fields = array(
'_noindex_seo_override',
'_noindex_seo_noindex',
'_noindex_seo_nofollow',
'_noindex_seo_noarchive',
'_noindex_seo_nosnippet',
'_noindex_seo_noimageindex',
);
// Register each meta field for each post type.
foreach ( $post_types as $post_type ) {
foreach ( $meta_fields as $meta_key ) {
register_post_meta(
$post_type,
$meta_key,
array(
'show_in_rest' => true,
'single' => true,
'type' => 'integer',
'default' => 0,
'auth_callback' => function () {
return current_user_can( 'edit_posts' );
},
)
);
}
}
}
add_action( 'init', 'noindex_seo_register_post_meta' );
/**
* Register meta boxes for granular per-post/page control.
*
* Only registers meta boxes if granular control is enabled in settings.
* Adds meta box to all public post types (posts, pages, custom post types).
*
* @since 2.0.0
*
* @return void
*/
function noindex_seo_add_meta_boxes(): void {
// Check if granular control is enabled.
$granular_enabled = get_option( 'noindex_seo_config_granular', 0 );
if ( ! $granular_enabled ) {
return;
}
// Get all public post types.
$post_types = get_post_types( array( 'public' => true ), 'names' );
// Add meta box to each public post type.
foreach ( $post_types as $post_type ) {
add_meta_box(
'noindex_seo_meta_box',
__( 'Search Engine Visibility', 'noindex-seo' ),
'noindex_seo_render_meta_box',
$post_type,
'side',
'default'
);
}
}
add_action( 'add_meta_boxes', 'noindex_seo_add_meta_boxes' );
/**
* Render the meta box content for per-post/page control.
*
* Displays a checkbox to override global settings and 5 directive checkboxes.
* Shows current global settings as reference.
*
* @since 2.0.0
*
* @param WP_Post $post The current post object.
* @return void
*/
function noindex_seo_render_meta_box( WP_Post $post ): void {
// Add nonce for security.
wp_nonce_field( 'noindex_seo_meta_box', 'noindex_seo_meta_box_nonce' );
// Get current post meta values.
$override = get_post_meta( $post->ID, '_noindex_seo_override', true );
$noindex = get_post_meta( $post->ID, '_noindex_seo_noindex', true );
$nofollow = get_post_meta( $post->ID, '_noindex_seo_nofollow', true );
$noarchive = get_post_meta( $post->ID, '_noindex_seo_noarchive', true );
$nosnippet = get_post_meta( $post->ID, '_noindex_seo_nosnippet', true );
$noimageindex = get_post_meta( $post->ID, '_noindex_seo_noimageindex', true );
// Get global settings for reference.
$global_directives = array();
$directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
// Determine which context applies to this post type.
$post_type = get_post_type( $post );
$context = ( 'page' === $post_type ) ? 'page' : 'single';
foreach ( $directives as $directive ) {
$option_key = $directive . '_seo_' . $context;
if ( get_option( $option_key, 0 ) ) {
$global_directives[] = $directive;
}
}
?>