Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function meteor_field_cb($fields){
- foreach ( $fields as $field ) {
- register_setting( $field['section'], $field['uid'] );
- $output = '<div class="meteor-plugin-options">';
- $output .= '<div class="meteor-option-label-div"><label for="' . $field['uid'] . '">' . $field['label'] . '</label></div>';
- if ( $field['type'] === 'submit' ) {
- $output .= '<div class="meteor-option-input-div"><input type="submit" class="meteor-db-option-btn" name="' . $field['uid'] . '" id="' . $field['uid'] . '" value="'.$field['value'].'"> </div><p class="meteor-option-help">' . $field['helper'] . '</p>';
- }
- if ( $field['type'] === 'checkbox' ) {
- $output .= '<div class="meteor-option-input-div"><label class="toggle-check"><input class="toggle-check-input" type="checkbox" name="' . $field['uid'] . '" id="' . $field['uid'] . '"> <span class="toggle-check-text"></span></label></div><p class="meteor-option-help">' . $field['helper'] . '</p>';
- }
- if ( $field['type'] === 'text' ) {
- $output .= '<div class="meteor-option-input-div"><input type="text" name="' . $field['uid'] . '" id="' . $field['uid'] . '" value="' . $field['default'] . '"></div><p class="meteor-option-help">' . $field['helper'] . '</p>';
- }
- if ( $field['tool'] === true ) {
- $query_images_args = array(
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'post_status' => 'inherit',
- 'posts_per_page' => - 1,
- );
- $output .= '<div class="meteor-images-wrap">';
- $query_images = new WP_Query( $query_images_args );
- $images = array();
- $output .= '<div class="meteor-quick-actions"><a class="meteor-image-log meteor-btn" href="">View Full Log</a></div>';
- $output .= '<div class="meteor-inner-title-holder"><h4 class="meteor-optimizer-inner--title">Image</h4><h4 class="meteor-optimizer-inner--title">URL</h4><h4 class="meteor-optimizer-inner--title">Reduction</h4></div>';
- foreach ( $query_images->posts as $image ) {
- $images[] = wp_get_attachment_url( $image->ID );
- foreach ( $images as $image ) {
- $output .= '<div class="meteor-image-layout"><div class="meteor-inner-image-title"><img src="' . $image . '" alt="meteor image"></div><div class="meteor-inner-image-url"><a href="' . $image . '">' . $image . '</a> </div>';
- $output .= '<div class="meteor-inner-optimized-result"><h4 class="meteor-optimizer-inner-reduction-title">- 172Kb</h4></div>';
- $output .= '</div>';
- }
- }
- $output .= '</div>';
- }
- $output .= '</div>';
- echo $output;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement