' . "\n"; $out .= 'jQuery(function($) {' . "\n"; $out .= '$(' . '\'' . '.entry-content a' . '\'' . ').has(' . '\'' . 'img' . '\'' . ').attr(' . '\'' . HOOK . '\'' . ', ' . '\'' . GALLERY . '[' . $page . ']\'' . ');'. "\n"; $out .= '});' . "\n"; $out .= '' . "\n"; echo $out; } function Artwork_Gallery_footer_script() { $settings = array( 'animation_speed' => 'normal' ); $PreOut = '' . "\n"; echo $PreOut; foreach($settings as $key => $value) { echo $key.": '". $value . "', "; } echo $PostOut; } /*Add Date, Medium nad Dimensions to media uploader*/ function be_attachment_field_credit( $form_fields, $post ) { $form_fields['artwork-date'] = array( 'label' => 'Date', 'input' => 'text', 'value' => get_post_meta( $post->ID, 'artwork_date', true ), 'helps' => 'The date of the project', ); $form_fields['artwork-medium'] = array( 'label' => 'Medium', 'input' => 'text', 'value' => get_post_meta( $post->ID, 'artwork_medium', true ), 'helps' => 'Medium of the artwork', ); $form_fields['artwork-dimensions'] = array( 'label' => 'Dimensions', 'input' => 'text', 'value' => get_post_meta( $post->ID, 'artwork_dimensions', true ), 'helps' => 'The dimensions, format: height vs. width', ); // Set up options $args = array( 'exclude' => '', 'sort_order' => 'ASC', ); // $args = array( 'exclude' => '9,22,7', ); $pages = get_pages($args); // Get currently selected value $selected = get_post_meta( $post->ID, 'which_gallery', true ); // If no selected value, default to 'No' if( !isset( $selected ) ) $selected = '0'; // Display each option foreach ( $pages as $page ) { $checked = ''; $css_id = 'which-gallery-option-' . $page->ID; if ( $selected == $page->ID ) { $checked = " checked='checked'"; } $html = ""; // Display the default none option if ($page === end($pages)){ $html .= "