Changeset 3213041
- Timestamp:
- 12/25/2024 04:27:08 PM (15 months ago)
- Location:
- gutensee
- Files:
-
- 92 added
- 8 edited
-
tags/1.0.4 (added)
-
tags/1.0.4/assets (added)
-
tags/1.0.4/assets/css (added)
-
tags/1.0.4/assets/css/all.css (added)
-
tags/1.0.4/assets/css/all.min.css (added)
-
tags/1.0.4/assets/css/animate.css (added)
-
tags/1.0.4/assets/css/editor.css (added)
-
tags/1.0.4/assets/css/font-awesome (added)
-
tags/1.0.4/assets/css/font-awesome/FontAwesome.otf (added)
-
tags/1.0.4/assets/css/font-awesome/css (added)
-
tags/1.0.4/assets/css/font-awesome/css/all.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/all.min.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/brands.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/brands.min.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/fontawesome.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/fontawesome.min.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/regular.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/regular.min.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/solid.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/solid.min.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/svg-with-js.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/svg-with-js.min.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/v4-shims.css (added)
-
tags/1.0.4/assets/css/font-awesome/css/v4-shims.min.css (added)
-
tags/1.0.4/assets/css/font-awesome/fontawesome-webfont.eot (added)
-
tags/1.0.4/assets/css/font-awesome/fontawesome-webfont.svg (added)
-
tags/1.0.4/assets/css/font-awesome/fontawesome-webfont.ttf (added)
-
tags/1.0.4/assets/css/font-awesome/fontawesome-webfont.woff (added)
-
tags/1.0.4/assets/css/font-awesome/fontawesome-webfont.woff2 (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-brands-400.eot (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-brands-400.svg (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-brands-400.ttf (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-brands-400.woff (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-brands-400.woff2 (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-regular-400.eot (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-regular-400.svg (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-regular-400.ttf (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-regular-400.woff (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-regular-400.woff2 (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-solid-900.eot (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-solid-900.svg (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-solid-900.ttf (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-solid-900.woff (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-solid-900.woff2 (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-v4compatibility.ttf (added)
-
tags/1.0.4/assets/css/font-awesome/webfonts/fa-v4compatibility.woff2 (added)
-
tags/1.0.4/assets/css/menu.css (added)
-
tags/1.0.4/assets/css/slick-theme.css (added)
-
tags/1.0.4/assets/css/slick.css (added)
-
tags/1.0.4/assets/css/style.css (added)
-
tags/1.0.4/assets/images (added)
-
tags/1.0.4/assets/images/dummy-image.png (added)
-
tags/1.0.4/assets/js (added)
-
tags/1.0.4/assets/js/editor.js (added)
-
tags/1.0.4/assets/js/font-awesome (added)
-
tags/1.0.4/assets/js/font-awesome/js (added)
-
tags/1.0.4/assets/js/font-awesome/js/brands.js (added)
-
tags/1.0.4/assets/js/font-awesome/js/brands.min.js (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-brands-400.ttf (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-brands-400.woff2 (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-regular-400.ttf (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-regular-400.woff2 (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-solid-900.ttf (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-solid-900.woff2 (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-v4compatibility.ttf (added)
-
tags/1.0.4/assets/js/font-awesome/webfonts/fa-v4compatibility.woff2 (added)
-
tags/1.0.4/assets/js/slick.js (added)
-
tags/1.0.4/assets/js/slick.min.js (added)
-
tags/1.0.4/build (added)
-
tags/1.0.4/build/index.asset.php (added)
-
tags/1.0.4/build/index.js (added)
-
tags/1.0.4/gutensee.php (added)
-
tags/1.0.4/inc (added)
-
tags/1.0.4/inc/blocks (added)
-
tags/1.0.4/inc/blocks/breadcrumbs.php (added)
-
tags/1.0.4/inc/blocks/contact-us.php (added)
-
tags/1.0.4/inc/blocks/latest-post.php (added)
-
tags/1.0.4/inc/blocks/navbar.php (added)
-
tags/1.0.4/inc/blocks/post-query.php (added)
-
tags/1.0.4/inc/blocks/topbar.php (added)
-
tags/1.0.4/inc/script.php (added)
-
tags/1.0.4/inc/templates (added)
-
tags/1.0.4/inc/templates/gutensee-template.html (added)
-
tags/1.0.4/inc/templates/gutensee-template.php (added)
-
tags/1.0.4/inc/templates/template.php (added)
-
tags/1.0.4/lang (added)
-
tags/1.0.4/lang/gutensee.pot (added)
-
tags/1.0.4/package-lock.json (added)
-
tags/1.0.4/package.json (added)
-
tags/1.0.4/readme.txt (added)
-
trunk/gutensee.php (modified) (3 diffs)
-
trunk/inc/blocks/breadcrumbs.php (modified) (2 diffs)
-
trunk/inc/blocks/contact-us.php (modified) (6 diffs)
-
trunk/inc/blocks/latest-post.php (modified) (29 diffs)
-
trunk/inc/blocks/navbar.php (modified) (11 diffs)
-
trunk/inc/blocks/post-query.php (modified) (26 diffs)
-
trunk/inc/blocks/topbar.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gutensee/trunk/gutensee.php
r3198319 r3213041 4 4 * Plugin URI: 5 5 * Description: Gutensee Plugin 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Requires at least: 5.3 8 8 * Requires PHP: 5.4 … … 15 15 * Domain Path: /lang 16 16 */ 17 18 17 if( !defined( 'ABSPATH' ) ) {exit(); } 19 define('GUTENSEE_ _VERSION', '1.0.3');18 define('GUTENSEE_VERSION', '1.0.4'); 20 19 define('GUTENSEE_PLUGIN_PATH',trailingslashit(plugin_dir_path(__FILE__))); 21 20 define('GUTENSEE_PLUGIN_URL',trailingslashit(plugins_url('/',__FILE__))); … … 110 109 } 111 110 add_action( 'wp_head', 'gutensee_add_template' ); 111 112 function gutensee_save_gravatar_to_media_library($gravatar_url) { 113 // Validate Gravatar URL 114 if (empty($gravatar_url) || !filter_var($gravatar_url, FILTER_VALIDATE_URL)) { 115 return new WP_Error('invalid_url', 'The provided Gravatar URL is not valid.'); 116 } 117 118 // Parse URL to get the filename 119 $parsed_url = wp_parse_url($gravatar_url); 120 $query_params = []; 121 if (!empty($parsed_url['query'])) { 122 parse_str($parsed_url['query'], $query_params); 123 } 124 $filename = sanitize_file_name(md5($gravatar_url) . '.jpg'); // Unique filename based on the URL 125 126 // Get the upload directory 127 $upload_dir = wp_upload_dir(); 128 $file_path = trailingslashit($upload_dir['path']) . $filename; 129 130 // Check if the file already exists 131 if (file_exists($file_path)) { 132 $attachment_id = attachment_url_to_postid($upload_dir['url'] . '/' . $filename); 133 if ($attachment_id) { 134 return $attachment_id; // Return existing attachment ID 135 } 136 } 137 138 // Fetch the image data 139 $response = wp_remote_get($gravatar_url); 140 if (is_wp_error($response)) { 141 return new WP_Error('fetch_error', 'Failed to fetch the Gravatar image.'); 142 } 143 144 $image_data = wp_remote_retrieve_body($response); 145 if (empty($image_data)) { 146 return new WP_Error('empty_image_data', 'The image data is empty.'); 147 } 148 149 // Load WP_Filesystem 150 if (empty($GLOBALS['wp_filesystem'])) { 151 require_once ABSPATH . 'wp-admin/includes/file.php'; 152 WP_Filesystem(); 153 } 154 155 global $wp_filesystem; 156 157 // Write image data to the file 158 if (!$wp_filesystem->put_contents($file_path, $image_data, FS_CHMOD_FILE)) { 159 return new WP_Error('file_write_error', 'Failed to write the image file.'); 160 } 161 162 // Check file type and prepare attachment data 163 $filetype = wp_check_filetype($filename, null); 164 $attachment_data = array( 165 'post_mime_type' => $filetype['type'], 166 'post_title' => sanitize_file_name($filename), 167 'post_content' => '', 168 'post_status' => 'inherit', 169 ); 170 171 // Insert attachment into the Media Library 172 $attachment_id = wp_insert_attachment($attachment_data, $file_path); 173 if (is_wp_error($attachment_id)) { 174 return $attachment_id; // Return error if failed 175 } 176 177 // Generate attachment metadata 178 require_once ABSPATH . 'wp-admin/includes/image.php'; 179 $attachment_metadata = wp_generate_attachment_metadata($attachment_id, $file_path); 180 wp_update_attachment_metadata($attachment_id, $attachment_metadata); 181 182 return $attachment_id; // Return attachment ID 183 } 184 -
gutensee/trunk/inc/blocks/breadcrumbs.php
r3175185 r3213041 53 53 $homeicon=($attributes['enableicon']==true)? '<i class="fa-solid fa-house"></i>' : ''; 54 54 $home=($attributes['enablehomebreadcumb']==true)? 'Home' : ''; 55 $output .= '<a class="breadcrumbs-icon" href="' . home_url() . '">'. $homeicon.'</a>';55 $output .= '<a class="breadcrumbs-icon" href="' . home_url() . '">'.wp_kses_post($homeicon).'</a>'; 56 56 $output .= '<a href="' . home_url() . '">'.$home.'</a>'; 57 57 … … 122 122 $output .= '</div>'; 123 123 $output .= '</div></div>'; 124 $output .= $attributes['addjs'];124 $output .=esc_html($attributes['addjs']); 125 125 return $output; 126 126 } -
gutensee/trunk/inc/blocks/contact-us.php
r3175185 r3213041 19 19 <div class="custom-contact-name"> 20 20 <div class="contact-form-field"> 21 <?php if($attributes['enablelabel']==true){?><label for="name"><?php echo esc_html($attributes['namelabel'] ,'gutensee'); ?></label><?php } ?>22 <input type="text" id="name" name="name" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['nameholder'] ,'gutensee'); ?>"<?php } ?> class="contact-form-input-field name" required><br>21 <?php if($attributes['enablelabel']==true){?><label for="name"><?php echo esc_html($attributes['namelabel']); ?></label><?php } ?> 22 <input type="text" id="name" name="name" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['nameholder']); ?>"<?php } ?> class="contact-form-input-field name" required><br> 23 23 </div> 24 24 </div> … … 28 28 <div class="custom-contact-email"> 29 29 <div class="contact-form-field"> 30 <?php if($attributes['enablelabel']==true){?><label for="email"><?php echo esc_html($attributes['emaillabel'] ,'gutensee'); ?></label><?php } ?>31 <input type="email" id="email" name="email" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['nameholder'] ,'gutensee'); ?>"<?php } ?> class="contact-form-input-field email " required><br>30 <?php if($attributes['enablelabel']==true){?><label for="email"><?php echo esc_html($attributes['emaillabel']); ?></label><?php } ?> 31 <input type="email" id="email" name="email" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['nameholder']); ?>"<?php } ?> class="contact-form-input-field email " required><br> 32 32 </div> 33 33 </div> … … 37 37 <div class="custom-contact-subject"> 38 38 <div class="contact-form-field"> 39 <?php if($attributes['enablelabel']==true){?><label for="subject"><?php echo esc_html($attributes['subjectlabel'] ,'gutensee'); ?></label><?php } ?>40 <input type="text" id="subject" name="subject" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['subjectholder'] ,'gutensee'); ?>"<?php } ?> class="contact-form-input-field subject" required><br>39 <?php if($attributes['enablelabel']==true){?><label for="subject"><?php echo esc_html($attributes['subjectlabel']); ?></label><?php } ?> 40 <input type="text" id="subject" name="subject" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['subjectholder']); ?>"<?php } ?> class="contact-form-input-field subject" required><br> 41 41 </div> 42 42 </div> … … 47 47 <div class="contact-form-field"> 48 48 <?php if($attributes['enablelabel']==true){?><label for="subject"><?php echo esc_html($attributes['mobilelabel'],'gutensee'); ?></label><?php } ?> 49 <input type="text" id="mobile" name="mobile" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['mobileholder'] ,'gutensee'); ?>"<?php } ?> class="contact-form-input-field mobile" required><br>49 <input type="text" id="mobile" name="mobile" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['mobileholder']); ?>"<?php } ?> class="contact-form-input-field mobile" required><br> 50 50 </div> 51 51 </div> … … 55 55 <div class="custom-contact-message"> 56 56 <div class="contact-form-field"> 57 <?php if($attributes['enablelabel']==true){?><label for="message"><?php echo esc_html($attributes['mesglabel'] ,'gutensee'); ?></label><?php } ?>58 <textarea rows="4" id="message" name="message" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['mesgholder'] ,'gutensee'); ?>"<?php } ?> class="contact-form-input-field message" required></textarea><br>57 <?php if($attributes['enablelabel']==true){?><label for="message"><?php echo esc_html($attributes['mesglabel']); ?></label><?php } ?> 58 <textarea rows="4" id="message" name="message" <?php if($attributes['enableplaceholder']==true){?>placeholder="<?php echo esc_attr($attributes['mesgholder']); ?>"<?php } ?> class="contact-form-input-field message" required></textarea><br> 59 59 </div> 60 60 </div> 61 61 <?php } ?> 62 62 <div class="custom-contact-button"> 63 <button type="submit" class="contact-form-button"><?php echo esc_html($attributes['btnlabel'] ,'gutensee'); ?></button>63 <button type="submit" class="contact-form-button"><?php echo esc_html($attributes['btnlabel']); ?></button> 64 64 </div> 65 65 </div> … … 133 133 134 134 // Email details 135 $to = get_option('admin_email');135 $to = esc_html(get_option('admin_email')); 136 136 $headers = array('Content-Type: text/html; charset=UTF-8'); 137 $mail_subject = "New Contact Message from $name";137 $mail_subject = "New Contact Message from ".esc_html($name).""; 138 138 139 139 // Create the message body with correct labels 140 $mail_body = "<strong>Name:</strong> $name<br/>";141 $mail_body .= "<strong>Email:</strong> $email<br/>";142 $mail_body .= "<strong>Subject:</strong> $subject<br/>";143 $mail_body .= "<strong>Mobile:</strong> $mobile<br/>";144 $mail_body .= "<strong>Message:</strong> $message<br/>";140 $mail_body = "<strong>Name:</strong>".esc_html($name)."<br/>"; 141 $mail_body .= "<strong>Email:</strong>".esc_html($email)."<br/>"; 142 $mail_body .= "<strong>Subject:</strong>".esc_html($subject)."<br/>"; 143 $mail_body .= "<strong>Mobile:</strong>".esc_html($mobile)."<br/>"; 144 $mail_body .= "<strong>Message:</strong>".esc_html($message)."<br/>"; 145 145 146 146 // Send the mail -
gutensee/trunk/inc/blocks/latest-post.php
r3192394 r3213041 80 80 } 81 81 82 83 $bordertop=(!empty($attributes['border']['top'])) ? $attributes['border']['top']['width'].' '. $attributes['border']['top']['style'].' '. $attributes['border']['top']['color'] : null;84 $borderright=(!empty($attributes['border']['right'])) ? $attributes['border']['right']['width'].' '. $attributes['border']['right']['style'].' '. $attributes['border']['right']['color'] : null;85 $borderbottom=(!empty($attributes['border']['bottom'])) ? $attributes['border']['bottom']['width'].' '. $attributes['border']['bottom']['style'].' '. $attributes['border']['bottom']['color'] : null;86 $borderleft=(!empty($attributes['border']['left'] )) ? $attributes['border']['left']['width'].' '. $attributes['border']['left']['style'].' '. $attributes['border']['left']['color'] : null;87 88 $navbordertop=(!empty($attributes['navborder']['top'])) ? $attributes['navborder']['top']['width'].' '. $attributes['navborder']['top']['style'].' '. $attributes['navborder']['top']['color'] : null;89 $navborderright=(!empty($attributes['navborder']['right'])) ? $attributes['navborder']['right']['width'].' '. $attributes['navborder']['right']['style'].' '. $attributes['navborder']['right']['color'] : null;90 $navborderbottom=(!empty($attributes['navborder']['bottom'])) ? $attributes['navborder']['bottom']['width'].' '. $attributes['navborder']['bottom']['style'].' '. $attributes['navborder']['bottom']['color'] : null;91 $navborderleft=(!empty($attributes['navborder']['left'] )) ? $attributes['navborder']['left']['width'].' '. $attributes['navborder']['left']['style'].' '. $attributes['navborder']['left']['color'] : null;92 93 $dotsbordertop=(!empty($attributes['dotsborder']['top'])) ? $attributes['dotsborder']['top']['width'].' '. $attributes['dotsborder']['top']['style'].' '. $attributes['dotsborder']['top']['color'] : null;94 $dotsborderright=(!empty($attributes['dotsborder']['right'])) ? $attributes['dotsborder']['right']['width'].' '. $attributes['dotsborder']['right']['style'].' '. $attributes['dotsborder']['right']['color'] : null;95 $dotsborderbottom=(!empty($attributes['dotsborder']['bottom'])) ? $attributes['dotsborder']['bottom']['width'].' '. $attributes['dotsborder']['bottom']['style'].' '. $attributes['dotsborder']['bottom']['color'] : null;96 $dotsborderleft=(!empty($attributes['dotsborder']['left'] )) ? $attributes['dotsborder']['left']['width'].' '. $attributes['dotsborder']['left']['style'].' '. $attributes['dotsborder']['left']['color'] : null;97 98 $featuredbordertop=(!empty($attributes['featuredborder']['top'])) ? $attributes['featuredborder']['top']['width'].' '. $attributes['featuredborder']['top']['style'].' '. $attributes['featuredborder']['top']['color'] : null;99 $featuredborderright=(!empty($attributes['featuredborder']['right'])) ? $attributes['featuredborder']['right']['width'].' '. $attributes['featuredborder']['right']['style'].' '. $attributes['featuredborder']['right']['color'] : null;100 $featuredborderbottom=(!empty($attributes['featuredborder']['bottom'])) ? $attributes['featuredborder']['bottom']['width'].' '. $attributes['featuredborder']['bottom']['style'].' '. $attributes['featuredborder']['bottom']['color'] : null;101 $featuredborderleft=(!empty($attributes['featuredborder']['left'] )) ? $attributes['featuredborder']['left']['width'].' '. $attributes['featuredborder']['left']['style'].' '. $attributes['featuredborder']['left']['color'] : null;102 103 $metabordertop=(!empty($attributes['metaborder']['top'])) ? $attributes['metaborder']['top']['width'].' '. $attributes['metaborder']['top']['style'].' '. $attributes['metaborder']['top']['color'] : null;104 $metaborderright=(!empty($attributes['metaborder']['right'])) ? $attributes['metaborder']['right']['width'].' '. $attributes['metaborder']['right']['style'].' '. $attributes['metaborder']['right']['color'] : null;105 $metaborderbottom=(!empty($attributes['metaborder']['bottom'])) ? $attributes['metaborder']['bottom']['width'].' '. $attributes['metaborder']['bottom']['style'].' '. $attributes['metaborder']['bottom']['color'] : null;106 $metaborderleft=(!empty($attributes['metaborder']['left'] )) ? $attributes['metaborder']['left']['width'].' '. $attributes['metaborder']['left']['style'].' '. $attributes['metaborder']['left']['color'] : null;107 108 $headingbordertop=(!empty($attributes['headingborder']['top'])) ? $attributes['headingborder']['top']['width'].' '. $attributes['headingborder']['top']['style'].' '. $attributes['headingborder']['top']['color'] : null;109 $headingborderright=(!empty($attributes['headingborder']['right'])) ? $attributes['headingborder']['right']['width'].' '. $attributes['headingborder']['right']['style'].' '. $attributes['headingborder']['right']['color'] : null;110 $headingborderbottom=(!empty($attributes['headingborder']['bottom'])) ? $attributes['headingborder']['bottom']['width'].' '. $attributes['headingborder']['bottom']['style'].' '. $attributes['headingborder']['bottom']['color'] : null;111 $headingborderleft=(!empty($attributes['headingborder']['left'] )) ? $attributes['headingborder']['left']['width'].' '. $attributes['headingborder']['left']['style'].' '. $attributes['headingborder']['left']['color'] : null;112 113 $contentbordertop=(!empty($attributes['contentborder']['top'] )) ? $attributes['contentborder']['top']['width'].' '. $attributes['contentborder']['top']['style'].' '. $attributes['contentborder']['top']['color'] : null;114 $contentborderright=(!empty($attributes['contentborder']['right'] )) ? $attributes['contentborder']['right']['width'].' '. $attributes['contentborder']['right']['style'].' '. $attributes['contentborder']['right']['color'] : null;115 $contentborderbottom=(!empty($attributes['contentborder']['bottom'] )) ? $attributes['contentborder']['bottom']['width'].' '. $attributes['contentborder']['bottom']['style'].' '. $attributes['contentborder']['bottom']['color'] : null;116 $contentborderleft=(!empty($attributes['contentborder']['left'] )) ? $attributes['contentborder']['left']['width'].' '. $attributes['contentborder']['left']['style'].' '. $attributes['contentborder']['left']['color'] : null;117 118 $buttonbordertop=(!empty($attributes['buttonborder']['top'])) ? $attributes['buttonborder']['top']['width'].' '. $attributes['buttonborder']['top']['style'].' '. $attributes['buttonborder']['top']['color'] : null;119 $buttonborderright=(!empty($attributes['buttonborder']['right'])) ? $attributes['buttonborder']['right']['width'].' '. $attributes['buttonborder']['right']['style'].' '. $attributes['buttonborder']['right']['color'] : null;120 $buttonborderbottom=(!empty($attributes['buttonborder']['bottom'])) ? $attributes['buttonborder']['bottom']['width'].' '. $attributes['buttonborder']['bottom']['style'].' '. $attributes['buttonborder']['bottom']['color'] : null;121 $buttonborderleft=(!empty($attributes['buttonborder']['left'] )) ? $attributes['buttonborder']['left']['width'].' '. $attributes['buttonborder']['left']['style'].' '. $attributes['buttonborder']['left']['color'] : null;122 123 $borderwidth=(!empty($attributes['border']['width']))? $attributes['border']['width'] :null;124 $borderstyle=(!empty($attributes['border']['style']))? $attributes['border']['style'] :null;125 $bordercolor=(!empty($attributes['border']['color']))? $attributes['border']['color'] :null;126 127 $navborderwidth=(!empty($attributes['navborder']['width']))? $attributes['navborder']['width'] :null;128 $navborderstyle=(!empty($attributes['navborder']['style']))? $attributes['navborder']['style'] :null;129 $navbordercolor=(!empty($attributes['navborder']['color']))? $attributes['navborder']['color'] :null;130 131 $dotsborderwidth=(!empty($attributes['dotsborder']['width']))? $attributes['dotsborder']['width'] :null;132 $dotsborderstyle=(!empty($attributes['dotsborder']['style']))? $attributes['dotsborder']['style'] :null;133 $dotsbordercolor=(!empty($attributes['dotsborder']['color']))? $attributes['dotsborder']['color'] :null;134 135 $featuredborderwidth=(!empty($attributes['featuredborder']['width']))? $attributes['featuredborder']['width'] :null;136 $featuredborderstyle=(!empty($attributes['featuredborder']['style']))? $attributes['featuredborder']['style'] :null;137 $featuredbordercolor=(!empty($attributes['featuredborder']['color']))? $attributes['featuredborder']['color'] :null;138 139 $metaborderwidth=(!empty($attributes['metaborder']['width']))? $attributes['metaborder']['width'] :null;140 $metaborderstyle=(!empty($attributes['metaborder']['style']))? $attributes['metaborder']['style'] :null;141 $metabordercolor=(!empty($attributes['metaborder']['color']))? $attributes['metaborder']['color'] :null;142 143 $headingborderwidth=(!empty($attributes['headingborder']['width']))? $attributes['headingborder']['width'] :null;144 $headingborderstyle=(!empty($attributes['headingborder']['style']))? $attributes['headingborder']['style'] :null;145 $headingbordercolor=(!empty($attributes['headingborder']['color']))? $attributes['headingborder']['color'] :null;146 147 $contentborderwidth=(!empty($attributes['contentborder']['width']))? $attributes['contentborder']['width'] :null;148 $contentborderstyle=(!empty($attributes['contentborder']['style']))? $attributes['contentborder']['style'] :null;149 $contentbordercolor=(!empty($attributes['contentborder']['color']))? $attributes['contentborder']['color'] :null;150 151 $buttonborderwidth=(!empty($attributes['buttonborder']['width']))? $attributes['buttonborder']['width'] :null;152 $buttonborderstyle=(!empty($attributes['buttonborder']['style']))? $attributes['buttonborder']['style'] :null;153 $buttonbordercolor=(!empty($attributes['buttonborder']['color']))? $attributes['buttonborder']['color'] :null;154 155 $ColumnClass='';156 $Rowclass='';157 switch($attributes['poststyle']){158 case 'grid-layout':159 $ColumnClass='block-col-'.$attributes['columnNumber'];160 $Rowclass='block-row';161 break;162 case 'list-layout':163 $ColumnClass='block-col-12';164 $Rowclass='block-row';165 break;166 case 'masonry-layout':167 $ColumnClass='masonry-column';168 $Rowclass='masonry-row masonry-layout-'.$attributes['columnNumber'];169 break;170 case 'cover-layout':171 $ColumnClass='block-col-'.$attributes['columnNumber'];172 $Rowclass='block-row';173 break;174 default:175 $ColumnClass='block-col-'.$attributes['columnNumber'];176 $Rowclass='block-row';177 break;178 }179 180 82 $list_items_markup .= $attributes['addcss']; 181 83 $list_items_markup .= $attributes['addjs']; 182 84 183 $list_items_markup .='<div id="'. $attributes['advid'].'"><div id="'.$uniqueid.'" class="post-query-loop '.$Rowclass.' single-item '.$uniqueid.' '.$attributes['addclass'].' '.$displayclass.' '. $animationclass.' '.$attributes['addclass'].'">';85 $list_items_markup .='<div id="'.esc_attr($attributes['advid']).'"><div id="'.esc_attr($uniqueid).'" class="post-query-loop '.esc_attr($Rowclass).' single-item '.esc_attr($uniqueid).' '.esc_attr($attributes['addclass']).' '.esc_attr($displayclass).' '. esc_attr($animationclass).' '.esc_attr($attributes['addclass']).'">'; 184 86 185 87 foreach ( $recent_posts as $post ) { … … 191 93 } 192 94 193 $post_content_class='';194 195 if ( $attributes['displayFeaturedImage'] && has_post_thumbnail( $post ) ){196 $post_content_class="post";197 }else{198 $post_content_class="post gutensee-remove-img";199 }200 95 $columnno=$attributes['columnNumber']; 201 $list_items_markup .= '<div class="'. $ColumnClass.'" id="'.$attributes["addid"].'">';96 $list_items_markup .= '<div class="'.esc_attr($ColumnClass).'" id="'.esc_attr($attributes["addid"]).'">'; 202 97 203 98 if($attributes['poststyle']=='grid-layout'){ … … 243 138 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 244 139 $list_items_markup .= '<div class="featured-image post-thumbnail"> 245 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>246 '. $image_markup.'140 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 141 '.wp_kses_post($image_markup).' 247 142 </div>'; 248 143 } … … 265 160 if ( ! empty( $author_display_name ) ) { 266 161 if($attributes['authortype']==='image'){ 267 $list_items_markup .= sprintf( 268 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 269 $byline 270 ); 162 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 163 if (is_wp_error($attachment_id)) { 164 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 165 } 166 else { 167 // Use wp_get_attachment_image to display the image 168 $list_items_markup .= sprintf( 169 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 170 esc_html($byline) 171 ); 172 } 271 173 }else{ 272 174 $list_items_markup .= sprintf( 273 175 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 274 $byline176 esc_html($byline) 275 177 ); 276 178 } … … 302 204 $list_items_markup .= sprintf( 303 205 '<span class="comments-link"><i class="far fa-comment"></i> <a href="%2$s/#comments">Comments(%1$s)</a></span>', 304 $commentcounts,206 esc_html($commentcounts), 305 207 esc_url( $post_link ) 306 208 ); … … 324 226 if ( $attributes['disablebtn'] !=false && $attributes['displayPostContentRadio'] === 'excerpt' ) { 325 227 $target=($attributes['opennewtab']) ?'_blank':'_self'; 326 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'.$target.'">'.$attributes['buttonlabel'].' <i class="fas fa-arrow-right"></i></a>';228 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'.$target.'">'.$attributes['buttonlabel'].' <i class="fas fa-arrow-right"></i></a>'; 327 229 } 328 230 … … 346 248 && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) { 347 249 348 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );250 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 349 251 350 252 if ( post_password_required( $post ) ) { … … 404 306 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 405 307 $list_items_markup .= '<div class="featured-image post-thumbnail"> 406 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>407 '. $image_markup.'308 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 309 '.wp_kses_post($image_markup).' 408 310 </div>'; 409 311 } … … 428 330 if ( ! empty( $author_display_name ) ) { 429 331 if($attributes['authortype']==='image'){ 430 $list_items_markup .= sprintf( 431 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 432 $byline 433 ); 332 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 333 if (is_wp_error($attachment_id)) { 334 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 335 } 336 else { 337 // Use wp_get_attachment_image to display the image 338 $list_items_markup .= sprintf( 339 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 340 esc_html($byline) 341 ); 342 } 434 343 }else{ 435 344 $list_items_markup .= sprintf( 436 345 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 437 $byline346 esc_html($byline) 438 347 ); 439 348 } … … 465 374 $list_items_markup .= sprintf( 466 375 '<span class="comments-link"><i class="far fa-comment"></i> <a href="%2$s/#comments">Comments(%1$s)</a></span>', 467 $commentcounts,376 esc_html($commentcounts), 468 377 esc_url( $post_link ) 469 378 ); … … 478 387 '<header class="post-entry-header"><h3 class="post-entry-title"><a class="wp-block-latest-posts__post-title" href="%1$s">%2$s</a></h3></header>', 479 388 esc_url( $post_link ), 480 $title389 esc_html($title) 481 390 ); 482 391 } … … 487 396 if ( $attributes['disablebtn'] !=false && $attributes['displayPostContentRadio'] === 'excerpt' ) { 488 397 $target=($attributes['opennewtab']) ?'_blank':'_self'; 489 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'. $target.'">'.$attributes['buttonlabel'].'<i class="fas fa-arrow-right"></i></a>';398 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'.esc_attr($target).'">'.esc_html($attributes['buttonlabel']).' <i class="fas fa-arrow-right"></i></a>'; 490 399 } 491 400 … … 501 410 $list_items_markup .= sprintf( 502 411 '<div class="post-entry-content wp-block-latest-posts__post-excerpt"><p class="spbb-entry-content">%1$s</p>%2$s</div>', 503 $trimmed_excerpt,504 $btn_markup412 esc_html($trimmed_excerpt), 413 wp_kses_post($btn_markup) 505 414 ); 506 415 } … … 509 418 && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) { 510 419 511 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );420 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 512 421 513 422 if ( post_password_required( $post ) ) { … … 572 481 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 573 482 $list_items_markup .= '<div class="featured-image post-thumbnail"> 574 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>575 '. $image_markup.'483 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 484 '.wp_kses_post($image_markup).' 576 485 </div>'; 577 486 } … … 594 503 if ( ! empty( $author_display_name ) ) { 595 504 if($attributes['authortype']==='image'){ 596 $list_items_markup .= sprintf( 597 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 598 $byline 599 ); 505 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 506 if (is_wp_error($attachment_id)) { 507 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 508 } 509 else { 510 // Use wp_get_attachment_image to display the image 511 $list_items_markup .= sprintf( 512 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 513 esc_html($byline) 514 ); 515 } 600 516 }else{ 601 517 $list_items_markup .= sprintf( 602 518 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 603 $byline519 esc_html($byline) 604 520 ); 605 521 } … … 631 547 $list_items_markup .= sprintf( 632 548 '<span class="comments-link"><i class="far fa-comment"></i> <a href="%2$s/#comments">Comments(%1$s)</a></span>', 633 $commentcounts,549 esc_html($commentcounts), 634 550 esc_url( $post_link ) 635 551 ); … … 644 560 '<header class="post-entry-header"><h3 class="post-entry-title"><a class="wp-block-latest-posts__post-title" href="%1$s">%2$s</a></h3></header>', 645 561 esc_url( $post_link ), 646 $title562 esc_html($title) 647 563 ); 648 564 } … … 653 569 if ( $attributes['disablebtn'] !=false && $attributes['displayPostContentRadio'] === 'excerpt' ) { 654 570 $target=($attributes['opennewtab']) ?'_blank':'_self'; 655 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'. $target.'">'.$attributes['buttonlabel'].'<i class="fas fa-arrow-right"></i></a>';571 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'.esc_attr($target).'">'.esc_html($attributes['buttonlabel']).' <i class="fas fa-arrow-right"></i></a>'; 656 572 } 657 573 … … 667 583 $list_items_markup .= sprintf( 668 584 '<div class="post-entry-content wp-block-latest-posts__post-excerpt"><p class="spbb-entry-content">%1$s</p>%2$s</div>', 669 $trimmed_excerpt,670 $btn_markup585 esc_html($trimmed_excerpt), 586 wp_kses_post($btn_markup) 671 587 ); 672 588 } … … 675 591 && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) { 676 592 677 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );593 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 678 594 679 595 if ( post_password_required( $post ) ) { … … 733 649 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 734 650 $list_items_markup .= '<div class="featured-image post-thumbnail"> 735 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>736 '. $image_markup.'651 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 652 '.wp_kses_post($image_markup).' 737 653 </div>'; 738 654 } … … 757 673 if ( ! empty( $author_display_name ) ) { 758 674 if($attributes['authortype']==='image'){ 759 $list_items_markup .= sprintf( 760 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 761 $byline 762 ); 675 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 676 if (is_wp_error($attachment_id)) { 677 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 678 } 679 else { 680 // Use wp_get_attachment_image to display the image 681 $list_items_markup .= sprintf( 682 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 683 esc_html($byline) 684 ); 685 } 763 686 }else{ 764 687 $list_items_markup .= sprintf( 765 688 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 766 $byline689 esc_html($byline) 767 690 ); 768 691 } … … 794 717 $list_items_markup .= sprintf( 795 718 '<span class="comments-link"><i class="far fa-comment"></i> <a href="%2$s/#comments">Comments(%1$s)</a></span>', 796 $commentcounts,719 esc_html($commentcounts), 797 720 esc_url( $post_link ) 798 721 ); … … 807 730 '<header class="post-entry-header"><h3 class="post-entry-title"><a class="wp-block-latest-posts__post-title" href="%1$s">%2$s</a></h3></header>', 808 731 esc_url( $post_link ), 809 $title732 esc_html($title) 810 733 ); 811 734 } … … 816 739 if ( $attributes['disablebtn'] !=false && $attributes['displayPostContentRadio'] === 'excerpt' ) { 817 740 $target=($attributes['opennewtab']) ?'_blank':'_self'; 818 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'. $target.'">'.$attributes['buttonlabel'].'<i class="fas fa-arrow-right"></i></a>';741 $btn_markup .='<a href="'.esc_url( $post_link ).'" class="more-link" target="'.esc_attr($target).'">'.esc_html($attributes['buttonlabel']).' <i class="fas fa-arrow-right"></i></a>'; 819 742 } 820 743 … … 830 753 $list_items_markup .= sprintf( 831 754 '<div class="post-entry-content wp-block-latest-posts__post-excerpt"><p class="spbb-entry-content">%1$s</p>%2$s</div>', 832 $trimmed_excerpt,833 $btn_markup755 esc_html($trimmed_excerpt), 756 wp_kses_post($btn_markup) 834 757 ); 835 758 } … … 838 761 && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) { 839 762 840 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );763 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 841 764 842 765 if ( post_password_required( $post ) ) { … … 887 810 } 888 811 889 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class) );812 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => esc_attr($class) ) ); 890 813 891 814 $list_items_markup .='</div></div>'; -
gutensee/trunk/inc/blocks/navbar.php
r3192394 r3213041 1068 1068 $bool = true; 1069 1069 //print_r($menu_items);die(); 1070 $frontpage_id = get_option( 'page_on_front');1071 $page_for_posts = get_option( 'page_for_posts');1070 $frontpage_id = esc_html(get_option( 'page_on_front' )); 1071 $page_for_posts = esc_html(get_option( 'page_for_posts' )); 1072 1072 // echo 'dev-'.$page_for_posts; 1073 1073 foreach( $menu_items as $menu_item ) { … … 1083 1083 $bool = true;$str2=''; 1084 1084 $active=(($submenu->object_id==get_the_id() && !is_front_page()) || ($submenu->title==is_category($submenu->object_id)) || ($submenu->object_id==$frontpage_id && is_front_page()) || ($submenu->object_id==$page_for_posts && is_home()) ) ? 'active' :''; 1085 $str2 .= '<a class="' . $submenu->object_id . ' nav-link" href="' . $submenu->url . '" >' . $submenu->title;1086 $parents = $submenu->ID;1085 $str2 .= '<a class="' . esc_attr($submenu->object_id) . ' nav-link" href="' . esc_url($submenu->url) . '" >' . esc_html($submenu->title); 1086 $parents = esc_html($submenu->ID); 1087 1087 $str=''; 1088 1088 $activert=''; … … 1097 1097 $active10=(($submenus1->object_id==get_the_id()) || ($submenus1->title==is_category($submenus1->object_id)) || ($submenus1->object_id==$frontpage_id && is_front_page()) || ($submenus1->object_id==$page_for_posts && is_home()) ) ? 'active' :''; 1098 1098 if( $submenus1->menu_item_parent == $parents1 ) { 1099 $str3 .= '<li class="3 menu-item menu-item-type-post_type menu-item-object-page '. $active10.' '. $submenus1->object_id .' '.get_the_id().'"><a class="nav-link" href="' . $submenus1->url . '" >' . $submenus1->title. '</a></li>';1099 $str3 .= '<li class="3 menu-item menu-item-type-post_type menu-item-object-page '.esc_attr($active10).' '. esc_attr($submenus1->object_id ).' '.get_the_id().'"><a class="nav-link" href="' .esc_url($submenus1->url) . '" >' . esc_html($submenus1->title) . '</a></li>'; 1100 1100 $activert10.=($active10==='active' ) ? 'active' :''; 1101 1101 } 1102 1102 } 1103 $def=($str3!='')?'<ul class="dropdown-menu 3">'. $str3.'</ul>':'';1103 $def=($str3!='')?'<ul class="dropdown-menu 3">'.esc_html($str3).'</ul>':''; 1104 1104 $activert.=($active1==='active' || $activert10==='active') ? 'active' :''; 1105 1105 1106 1106 if($def!=''){ 1107 $str .= '<li class="3 menu-item dropdown menu-item-type-post_type menu-item-object-page '. $activert10.' '.$active1.' '. $submenus->object_id .' '.get_the_id().'"><a class="nav-link" href="' . $submenus->url . '" >' . $submenus->title . '<i class="fas fa-caret-down"></i></a>'.$def.'</li>';1107 $str .= '<li class="3 menu-item dropdown menu-item-type-post_type menu-item-object-page '.esc_attr($activert10).' '.esc_attr($active1).' '. esc_attr($submenus->object_id) .' '.get_the_id().'"><a class="nav-link" href="' . esc_url($submenus->url) . '" >' . esc_html($submenus->title) . '<i class="fas fa-caret-down"></i></a>'.esc_html($def).'</li>'; 1108 1108 }else{ 1109 $str .= '<li class="3 menu-item menu-item-type-post_type menu-item-object-page '. $activert10.' '.$active1.' '. $submenus->object_id .' '.get_the_id().'"><a class="nav-link" href="' . $submenus->url . '" >' . $submenus->title. '</a></li>';1109 $str .= '<li class="3 menu-item menu-item-type-post_type menu-item-object-page '.esc_attr($activert10).' '.esc_attr($active1).' '. esc_attr($submenus->object_id).' '.get_the_id().'"><a class="nav-link" href="' . esc_url($submenus->url) . '" >' . esc_html($submenus->title) . '</a></li>'; 1110 1110 } 1111 1111 … … 1113 1113 } 1114 1114 if($str!=null){ 1115 $menu_array[] ='<li class="2 menu-item menu-item-has-children dropdown '. $active.' '.$activert.'">';1115 $menu_array[] ='<li class="2 menu-item menu-item-has-children dropdown '.esc_attr($active).' '.esc_attr($activert).'">'; 1116 1116 $menu_array[] .= $str2; 1117 1117 $menu_array[] .= '<i class="fas fa-caret-down"></i></a>'; … … 1135 1135 $active2=(($menu_item->object_id==get_the_id() && !is_front_page()) || ($menu_item->title==is_category($menu_item->object_id)) || ($menu_item->object_id==$frontpage_id && is_front_page()) || ($menu_item->object_id==$page_for_posts && is_home()) ) ? 'active' :''; 1136 1136 $menu_list .= '<li class="1 menu-item menu-item-has-children dropdown '.$active2.' '.$dractive.' '.$drpreactive.'">'; 1137 $menu_list .= '<a class="nav-link" href="'. $menu_item->url.'">'.$menu_item->title.'<i class="fas fa-caret-down"></i></a>';1137 $menu_list .= '<a class="nav-link" href="'.esc_url($menu_item->url).'">'.esc_html($menu_item->title).'<i class="fas fa-caret-down"></i></a>'; 1138 1138 1139 1139 $menu_list .= '<ul class="dropdown-menu">' ."\n"; … … 1145 1145 $active2=(($menu_item->object_id==get_the_id() && !is_front_page()) || ($menu_item->title==is_category($menu_item->object_id)) || ($menu_item->object_id==$frontpage_id && is_front_page()) || ($menu_item->object_id==$page_for_posts && is_home())) ? 'active' :''; 1146 1146 $menu_list .= '<li class=" 5 menu-item menu-item-type-post_type menu-item-object-page '.$active2.' '.$dractive.'">'; 1147 $menu_list .= '<a class="nav-link" href="'. $menu_item->url.'">' . $menu_item->title. '</a>';1147 $menu_list .= '<a class="nav-link" href="'.esc_url($menu_item->url).'">' . esc_html($menu_item->title) . '</a>'; 1148 1148 } 1149 1149 … … 1159 1159 $menu_list .='<li class="menu-item header-button"> 1160 1160 <a class="theme-btn btn-style-one nav-link" style="outline: none;"> 1161 <span class="txt">'. $attributes['btntext'].'</span>1161 <span class="txt">'.esc_html($attributes['btntext']).'</span> 1162 1162 </a> 1163 1163 </li>'; … … 1181 1181 } 1182 1182 } else { 1183 $menu_list = '<!-- no menu defined in location "'. $theme_location.'" -->';1183 $menu_list = '<!-- no menu defined in location "'.esc_html($theme_location).'" -->'; 1184 1184 } 1185 1185 … … 1198 1198 $displayclass=$displaydesktop.' '.$displaytablet.' '.$displaymobile; 1199 1199 1200 $bordertop=(!empty($attributes['border']['top'])) ? $attributes['border']['top']['width'].' '. $attributes['border']['top']['style'].' '. $attributes['border']['top']['color'] : null; 1201 $borderright=(!empty($attributes['border']['right'])) ? $attributes['border']['right']['width'].' '. $attributes['border']['right']['style'].' '. $attributes['border']['right']['color'] : null; 1202 $borderbottom=(!empty($attributes['border']['bottom'])) ? $attributes['border']['bottom']['width'].' '. $attributes['border']['bottom']['style'].' '. $attributes['border']['bottom']['color'] : null; 1203 $borderleft=(!empty($attributes['border']['left'] )) ? $attributes['border']['left']['width'].' '. $attributes['border']['left']['style'].' '. $attributes['border']['left']['color'] : null; 1204 1205 $menubordertop=(!empty($attributes['menuborder']['top'])) ? $attributes['menuborder']['top']['width'].' '. $attributes['menuborder']['top']['style'].' '. $attributes['menuborder']['top']['color'] : null; 1206 $menuborderright=(!empty($attributes['menuborder']['right'])) ? $attributes['menuborder']['right']['width'].' '. $attributes['menuborder']['right']['style'].' '. $attributes['menuborder']['right']['color'] : null; 1207 $menuborderbottom=(!empty($attributes['menuborder']['bottom'])) ? $attributes['menuborder']['bottom']['width'].' '. $attributes['menuborder']['bottom']['style'].' '. $attributes['menuborder']['bottom']['color'] : null; 1208 $menuborderleft=(!empty($attributes['menuborder']['left'] )) ? $attributes['menuborder']['left']['width'].' '. $attributes['menuborder']['left']['style'].' '. $attributes['menuborder']['left']['color'] : null; 1209 1210 $ddbordertop=(!empty($attributes['ddborder']['top'])) ? $attributes['ddborder']['top']['width'].' '. $attributes['ddborder']['top']['style'].' '. $attributes['ddborder']['top']['color'] : null; 1211 $ddborderright=(!empty($attributes['ddborder']['right'])) ? $attributes['ddborder']['right']['width'].' '. $attributes['ddborder']['right']['style'].' '. $attributes['ddborder']['right']['color'] : null; 1212 $ddborderbottom=(!empty($attributes['ddborder']['bottom'])) ? $attributes['ddborder']['bottom']['width'].' '. $attributes['ddborder']['bottom']['style'].' '. $attributes['ddborder']['bottom']['color'] : null; 1213 $ddborderleft=(!empty($attributes['ddborder']['left'] )) ? $attributes['ddborder']['left']['width'].' '. $attributes['ddborder']['left']['style'].' '. $attributes['ddborder']['left']['color'] : null; 1214 1215 $submenubordertop=(!empty($attributes['submenuborder']['top'])) ? $attributes['submenuborder']['top']['width'].' '. $attributes['submenuborder']['top']['style'].' '. $attributes['submenuborder']['top']['color'] : null; 1216 $submenuborderright=(!empty($attributes['submenuborder']['right'])) ? $attributes['submenuborder']['right']['width'].' '. $attributes['submenuborder']['right']['style'].' '. $attributes['submenuborder']['right']['color'] : null; 1217 $submenuborderbottom=(!empty($attributes['submenuborder']['bottom'])) ? $attributes['submenuborder']['bottom']['width'].' '. $attributes['submenuborder']['bottom']['style'].' '. $attributes['submenuborder']['bottom']['color'] : null; 1218 $submenuborderleft=(!empty($attributes['submenuborder']['left'] )) ? $attributes['submenuborder']['left']['width'].' '. $attributes['submenuborder']['left']['style'].' '. $attributes['submenuborder']['left']['color'] : null; 1219 1220 $togglebordertop=(!empty($attributes['toggleborder']['top'])) ? $attributes['toggleborder']['top']['width'].' '. $attributes['toggleborder']['top']['style'].' '. $attributes['toggleborder']['top']['color'] : null; 1221 $toggleborderright=(!empty($attributes['toggleborder']['right'])) ? $attributes['toggleborder']['right']['width'].' '. $attributes['toggleborder']['right']['style'].' '. $attributes['toggleborder']['right']['color'] : null; 1222 $toggleborderbottom=(!empty($attributes['toggleborder']['bottom'])) ? $attributes['toggleborder']['bottom']['width'].' '. $attributes['toggleborder']['bottom']['style'].' '. $attributes['toggleborder']['bottom']['color'] : null; 1223 $toggleborderleft=(!empty($attributes['toggleborder']['left'] )) ? $attributes['toggleborder']['left']['width'].' '. $attributes['toggleborder']['left']['style'].' '. $attributes['toggleborder']['left']['color'] : null; 1224 1225 $btnbordertop=(!empty($attributes['btnborder']['top'])) ? $attributes['btnborder']['top']['width'].' '. $attributes['btnborder']['top']['style'].' '. $attributes['btnborder']['top']['color'] : null; 1226 $btnborderright=(!empty($attributes['btnborder']['right'])) ? $attributes['btnborder']['right']['width'].' '. $attributes['btnborder']['right']['style'].' '. $attributes['btnborder']['right']['color'] : null; 1227 $btnborderbottom=(!empty($attributes['btnborder']['bottom'])) ? $attributes['btnborder']['btnbottom']['width'].' '. $attributes['btnborder']['bottom']['style'].' '. $attributes['btnborder']['bottom']['color'] : null; 1228 $btnborderleft=(!empty($attributes['btnborder']['left'] )) ? $attributes['border']['left']['width'].' '. $attributes['border']['left']['style'].' '. $attributes['btnborder']['left']['color'] : null; 1229 1230 $sbtnbordertop=(!empty($attributes['sbtnborder']['top'])) ? $attributes['sbtnborder']['top']['width'].' '. $attributes['sbtnborder']['top']['style'].' '. $attributes['sbtnborder']['top']['color'] : null; 1231 $sbtnborderright=(!empty($attributes['sbtnborder']['right'])) ? $attributes['sbtnborder']['right']['width'].' '. $attributes['sbtnborder']['right']['style'].' '. $attributes['sbtnborder']['right']['color'] : null; 1232 $sbtnborderbottom=(!empty($attributes['sbtnborder']['bottom'])) ? $attributes['sbtnborder']['bottom']['width'].' '. $attributes['sbtnborder']['bottom']['style'].' '. $attributes['sbtnborder']['bottom']['color'] : null; 1233 $sbtnborderleft=(!empty($attributes['sbtnborder']['left'] )) ? $attributes['sbtnborder']['left']['width'].' '. $attributes['sbtnborder']['left']['style'].' '. $attributes['sbtnborder']['left']['color'] : null; 1234 1235 $sformbordertop=(!empty($attributes['sformborder']['top'])) ? $attributes['sformborder']['top']['width'].' '. $attributes['sformborder']['top']['style'].' '. $attributes['sformborder']['top']['color'] : null; 1236 $sformborderright=(!empty($attributes['sformborder']['right'])) ? $attributes['sformborder']['right']['width'].' '. $attributes['sformborder']['right']['style'].' '. $attributes['sformborder']['right']['color'] : null; 1237 $sformborderbottom=(!empty($attributes['sformborder']['bottom'])) ? $attributes['sformborder']['bottom']['width'].' '. $attributes['sformborder']['bottom']['style'].' '. $attributes['sformborder']['bottom']['color'] : null; 1238 $sformborderleft=(!empty($attributes['sformborder']['left'] )) ? $attributes['sformborder']['left']['width'].' '. $attributes['sformborder']['left']['style'].' '. $attributes['sformborder']['left']['color'] : null; 1239 1240 1241 $iconbordertop=(!empty($attributes['iconborder']['top'])) ? $attributes['iconborder']['top']['width'].' '. $attributes['border']['top']['style'].' '. $attributes['iconborder']['top']['color'] : null; 1242 $iconborderright=(!empty($attributes['iconborder']['right'])) ? $attributes['iconborder']['right']['width'].' '. $attributes['iconborder']['right']['style'].' '. $attributes['iconborder']['right']['color'] : null; 1243 $iconborderbottom=(!empty($attributes['iconborder']['bottom'])) ? $attributes['iconborder']['bottom']['width'].' '. $attributes['iconborder']['bottom']['style'].' '. $attributes['iconborder']['iconbottom']['color'] : null; 1244 $iconborderleft=(!empty($attributes['iconborder']['left'] )) ? $attributes['iconborder']['left']['width'].' '. $attributes['iconborder']['left']['style'].' '. $attributes['iconborder']['left']['color'] : null; 1245 1246 $borderwidth=(!empty($attributes['border']['width']))? $attributes['border']['width'] :null; 1247 $borderstyle=(!empty($attributes['border']['style']))? $attributes['border']['style'] :null; 1248 $bordercolor=(!empty($attributes['border']['color']))? $attributes['border']['color'] :null; 1249 1250 $menuboxshadow=($attributes['boxshadow'] === true) ? ''.$attributes['vshadow'].'px '.$attributes['hshadow'].'px '.$attributes['blurshadow'].'px '.$attributes['shadowColor'].'' : ''; 1251 $smenuboxshadow=($attributes['sboxshadow'] === true) ? ''.$attributes['svshadow'].'px '.$attributes['shshadow'].'px '.$attributes['sblurshadow'].'px '.$attributes['sshadowColor'].'' : ''; 1252 $sbmenuboxshadow=($attributes['sbboxshadow'] === true) ? ''.$attributes['sbvshadow'].'px '.$attributes['sbhshadow'].'px '.$attributes['sbblurshadow'].'px '.$attributes['sbshadowColor'].'' : ''; 1253 1254 $list_items_markup .= $attributes['addcss']; 1200 $list_items_markup .= wp_kses_post($attributes['addcss']); 1255 1201 1256 1202 $alignmentClass = ($attributes['textAlignment'] != null) ? 'has-text-align-'.$attributes['textAlignment'].'' : ''; … … 1262 1208 $list_items_markup .= '<!-- Brand and toggle get grouped for better mobile display -->'; 1263 1209 $list_items_markup .= '<div class="gutensee-header">'; 1264 $list_items_markup .= '<button id="'. $uniqueid01.'" class="gutensee-toggle '.$uniqueid.' '.$attributes['toggleposition'].' '.$attributes['togglepositiontab'].' '.$attributes['togglepositionmob'].' '.$attributes['advclass'].'" data-toggle="collapse" type="button" aria-controls="menu" aria-expanded="false">';1210 $list_items_markup .= '<button id="'.esc_attr($uniqueid01).'" class="gutensee-toggle '.esc_attr($uniqueid).' '.esc_attr($attributes['toggleposition']).' '.esc_attr($attributes['togglepositiontab']).' '.esc_attr($attributes['togglepositionmob']).' '.esc_attr($attributes['advclass']).'" data-toggle="collapse" type="button" aria-controls="menu" aria-expanded="false">'; 1265 1211 $list_items_markup .= '<i class="fas fa-bars"></i>'; 1266 1212 $list_items_markup .= '</button></div>'; 1267 1213 $list_items_markup .= '<!-- Collect the nav links, forms, and other content for toggling -->'; 1268 $list_items_markup .= '<div class="collapse gutensee-collapse '. $uniqueid.'" id="custom-collapse">';1269 $list_items_markup .= '<div class="gutensee-blocks-menu navigation '. $alignmentClass.' '.$displayclass.' '.$attributes['addclass'].'" id="'.$uniqueid.'">';1214 $list_items_markup .= '<div class="collapse gutensee-collapse '.esc_attr($uniqueid).'" id="custom-collapse">'; 1215 $list_items_markup .= '<div class="gutensee-blocks-menu navigation '.esc_attr($alignmentClass).' '.esc_attr($displayclass).' '.esc_attr($attributes['addclass']).'" id="'.esc_attr($uniqueid).'">'; 1270 1216 $list_items_markup .= $menu_list; 1271 1217 $list_items_markup .= '</div>'; … … 1274 1220 $list_items_markup .= '</nav></div>'; 1275 1221 } 1276 $list_items_markup .= $attributes['addjs'];1222 $list_items_markup .=wp_kses_post($attributes['addjs']); 1277 1223 return $list_items_markup; 1278 1224 } -
gutensee/trunk/inc/blocks/post-query.php
r3192394 r3213041 63 63 64 64 $animationclass='wow animated '.$attributes['durations'].' '.$attributes['animation']; 65 66 67 $bordertop=(!empty($attributes['border']['top'])) ? $attributes['border']['top']['width'].' '. $attributes['border']['top']['style'].' '. $attributes['border']['top']['color'] : null;68 $borderright=(!empty($attributes['border']['right'])) ? $attributes['border']['right']['width'].' '. $attributes['border']['right']['style'].' '. $attributes['border']['right']['color'] : null;69 $borderbottom=(!empty($attributes['border']['bottom'])) ? $attributes['border']['bottom']['width'].' '. $attributes['border']['bottom']['style'].' '. $attributes['border']['bottom']['color'] : null;70 $borderleft=(!empty($attributes['border']['left'] )) ? $attributes['border']['left']['width'].' '. $attributes['border']['left']['style'].' '. $attributes['border']['left']['color'] : null;71 72 $navbordertop=(!empty($attributes['navborder']['top'])) ? $attributes['navborder']['top']['width'].' '. $attributes['navborder']['top']['style'].' '. $attributes['navborder']['top']['color'] : null;73 $navborderright=(!empty($attributes['navborder']['right'])) ? $attributes['navborder']['right']['width'].' '. $attributes['navborder']['right']['style'].' '. $attributes['navborder']['right']['color'] : null;74 $navborderbottom=(!empty($attributes['navborder']['bottom'])) ? $attributes['navborder']['bottom']['width'].' '. $attributes['navborder']['bottom']['style'].' '. $attributes['navborder']['bottom']['color'] : null;75 $navborderleft=(!empty($attributes['navborder']['left'] )) ? $attributes['navborder']['left']['width'].' '. $attributes['navborder']['left']['style'].' '. $attributes['navborder']['left']['color'] : null;76 77 $dotsbordertop=(!empty($attributes['dotsborder']['top'])) ? $attributes['dotsborder']['top']['width'].' '. $attributes['dotsborder']['top']['style'].' '. $attributes['dotsborder']['top']['color'] : null;78 $dotsborderright=(!empty($attributes['dotsborder']['right'])) ? $attributes['dotsborder']['right']['width'].' '. $attributes['dotsborder']['right']['style'].' '. $attributes['dotsborder']['right']['color'] : null;79 $dotsborderbottom=(!empty($attributes['dotsborder']['bottom'])) ? $attributes['dotsborder']['bottom']['width'].' '. $attributes['dotsborder']['bottom']['style'].' '. $attributes['dotsborder']['bottom']['color'] : null;80 $dotsborderleft=(!empty($attributes['dotsborder']['left'] )) ? $attributes['dotsborder']['left']['width'].' '. $attributes['dotsborder']['left']['style'].' '. $attributes['dotsborder']['left']['color'] : null;81 82 $featuredbordertop=(!empty($attributes['featuredborder']['top'])) ? $attributes['featuredborder']['top']['width'].' '. $attributes['featuredborder']['top']['style'].' '. $attributes['featuredborder']['top']['color'] : null;83 $featuredborderright=(!empty($attributes['featuredborder']['right'])) ? $attributes['featuredborder']['right']['width'].' '. $attributes['featuredborder']['right']['style'].' '. $attributes['featuredborder']['right']['color'] : null;84 $featuredborderbottom=(!empty($attributes['featuredborder']['bottom'])) ? $attributes['featuredborder']['bottom']['width'].' '. $attributes['featuredborder']['bottom']['style'].' '. $attributes['featuredborder']['bottom']['color'] : null;85 $featuredborderleft=(!empty($attributes['featuredborder']['left'] )) ? $attributes['featuredborder']['left']['width'].' '. $attributes['featuredborder']['left']['style'].' '. $attributes['featuredborder']['left']['color'] : null;86 87 $metabordertop=(!empty($attributes['metaborder']['top'])) ? $attributes['metaborder']['top']['width'].' '. $attributes['metaborder']['top']['style'].' '. $attributes['metaborder']['top']['color'] : null;88 $metaborderright=(!empty($attributes['metaborder']['right'])) ? $attributes['metaborder']['right']['width'].' '. $attributes['metaborder']['right']['style'].' '. $attributes['metaborder']['right']['color'] : null;89 $metaborderbottom=(!empty($attributes['metaborder']['bottom'])) ? $attributes['metaborder']['bottom']['width'].' '. $attributes['metaborder']['bottom']['style'].' '. $attributes['metaborder']['bottom']['color'] : null;90 $metaborderleft=(!empty($attributes['metaborder']['left'] )) ? $attributes['metaborder']['left']['width'].' '. $attributes['metaborder']['left']['style'].' '. $attributes['metaborder']['left']['color'] : null;91 92 $headingbordertop=(!empty($attributes['headingborder']['top'])) ? $attributes['headingborder']['top']['width'].' '. $attributes['headingborder']['top']['style'].' '. $attributes['headingborder']['top']['color'] : null;93 $headingborderright=(!empty($attributes['headingborder']['right'])) ? $attributes['headingborder']['right']['width'].' '. $attributes['headingborder']['right']['style'].' '. $attributes['headingborder']['right']['color'] : null;94 $headingborderbottom=(!empty($attributes['headingborder']['bottom'])) ? $attributes['headingborder']['bottom']['width'].' '. $attributes['headingborder']['bottom']['style'].' '. $attributes['headingborder']['bottom']['color'] : null;95 $headingborderleft=(!empty($attributes['headingborder']['left'] )) ? $attributes['headingborder']['left']['width'].' '. $attributes['headingborder']['left']['style'].' '. $attributes['headingborder']['left']['color'] : null;96 97 $contentbordertop=(!empty($attributes['contentborder']['top'] )) ? $attributes['contentborder']['top']['width'].' '. $attributes['contentborder']['top']['style'].' '. $attributes['contentborder']['top']['color'] : null;98 $contentborderright=(!empty($attributes['contentborder']['right'] )) ? $attributes['contentborder']['right']['width'].' '. $attributes['contentborder']['right']['style'].' '. $attributes['contentborder']['right']['color'] : null;99 $contentborderbottom=(!empty($attributes['contentborder']['bottom'] )) ? $attributes['contentborder']['bottom']['width'].' '. $attributes['contentborder']['bottom']['style'].' '. $attributes['contentborder']['bottom']['color'] : null;100 $contentborderleft=(!empty($attributes['contentborder']['left'] )) ? $attributes['contentborder']['left']['width'].' '. $attributes['contentborder']['left']['style'].' '. $attributes['contentborder']['left']['color'] : null;101 102 $buttonbordertop=(!empty($attributes['buttonborder']['top'])) ? $attributes['buttonborder']['top']['width'].' '. $attributes['buttonborder']['top']['style'].' '. $attributes['buttonborder']['top']['color'] : null;103 $buttonborderright=(!empty($attributes['buttonborder']['right'])) ? $attributes['buttonborder']['right']['width'].' '. $attributes['buttonborder']['right']['style'].' '. $attributes['buttonborder']['right']['color'] : null;104 $buttonborderbottom=(!empty($attributes['buttonborder']['bottom'])) ? $attributes['buttonborder']['bottom']['width'].' '. $attributes['buttonborder']['bottom']['style'].' '. $attributes['buttonborder']['bottom']['color'] : null;105 $buttonborderleft=(!empty($attributes['buttonborder']['left'] )) ? $attributes['buttonborder']['left']['width'].' '. $attributes['buttonborder']['left']['style'].' '. $attributes['buttonborder']['left']['color'] : null;106 107 $borderwidth=(!empty($attributes['border']['width']))? $attributes['border']['width'] :null;108 $borderstyle=(!empty($attributes['border']['style']))? $attributes['border']['style'] :null;109 $bordercolor=(!empty($attributes['border']['color']))? $attributes['border']['color'] :null;110 111 $navborderwidth=(!empty($attributes['navborder']['width']))? $attributes['navborder']['width'] :null;112 $navborderstyle=(!empty($attributes['navborder']['style']))? $attributes['navborder']['style'] :null;113 $navbordercolor=(!empty($attributes['navborder']['color']))? $attributes['navborder']['color'] :null;114 115 $dotsborderwidth=(!empty($attributes['dotsborder']['width']))? $attributes['dotsborder']['width'] :null;116 $dotsborderstyle=(!empty($attributes['dotsborder']['style']))? $attributes['dotsborder']['style'] :null;117 $dotsbordercolor=(!empty($attributes['dotsborder']['color']))? $attributes['dotsborder']['color'] :null;118 119 $featuredborderwidth=(!empty($attributes['featuredborder']['width']))? $attributes['featuredborder']['width'] :null;120 $featuredborderstyle=(!empty($attributes['featuredborder']['style']))? $attributes['featuredborder']['style'] :null;121 $featuredbordercolor=(!empty($attributes['featuredborder']['color']))? $attributes['featuredborder']['color'] :null;122 123 $metaborderwidth=(!empty($attributes['metaborder']['width']))? $attributes['metaborder']['width'] :null;124 $metaborderstyle=(!empty($attributes['metaborder']['style']))? $attributes['metaborder']['style'] :null;125 $metabordercolor=(!empty($attributes['metaborder']['color']))? $attributes['metaborder']['color'] :null;126 127 $headingborderwidth=(!empty($attributes['headingborder']['width']))? $attributes['headingborder']['width'] :null;128 $headingborderstyle=(!empty($attributes['headingborder']['style']))? $attributes['headingborder']['style'] :null;129 $headingbordercolor=(!empty($attributes['headingborder']['color']))? $attributes['headingborder']['color'] :null;130 131 $contentborderwidth=(!empty($attributes['contentborder']['width']))? $attributes['contentborder']['width'] :null;132 $contentborderstyle=(!empty($attributes['contentborder']['style']))? $attributes['contentborder']['style'] :null;133 $contentbordercolor=(!empty($attributes['contentborder']['color']))? $attributes['contentborder']['color'] :null;134 135 $buttonborderwidth=(!empty($attributes['buttonborder']['width']))? $attributes['buttonborder']['width'] :null;136 $buttonborderstyle=(!empty($attributes['buttonborder']['style']))? $attributes['buttonborder']['style'] :null;137 $buttonbordercolor=(!empty($attributes['buttonborder']['color']))? $attributes['buttonborder']['color'] :null;138 65 139 66 $ColumnClass=''; … … 162 89 } 163 90 164 $list_items_markup .= $attributes['addcss'];165 166 $list_items_markup .='<div id="'. $attributes['advid'].'"><div id="'.$uniqueid.'" class="post-query-loop '.$Rowclass.' single-item '.$uniqueid.' '.$attributes['addclass'].' '.$displayclass.' '. $animationclass.' '.$attributes['advclass'].'">';91 $list_items_markup .= wp_kses_post($attributes['addcss']); 92 93 $list_items_markup .='<div id="'.esc_attr($attributes['advid']).'"><div id="'.esc_attr($uniqueid).'" class="post-query-loop '.esc_attr($Rowclass).' single-item '.esc_attr($uniqueid).' '.esc_attr($attributes['addclass']).' '.esc_attr($displayclass).' '. esc_attr($animationclass).' '.esc_attr($attributes['advclass']).'">'; 167 94 168 95 foreach ( $recent_posts as $post ) { … … 174 101 } 175 102 176 $post_content_class='';177 178 if ( $attributes['displayFeaturedImage'] && has_post_thumbnail( $post ) ){179 $post_content_class="post";180 }else{181 $post_content_class="post gutensee-remove-img";182 }183 103 $columnno=$attributes['columnNumber']; 184 104 $list_items_markup .= '<div class="'.$ColumnClass.'" id="'.$attributes["addid"].'">'; … … 225 145 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 226 146 $list_items_markup .= '<div class="featured-image post-thumbnail"> 227 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>228 '. $image_markup.'147 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 148 '.wp_kses_post($image_markup).' 229 149 </div>'; 230 150 } … … 247 167 if ( ! empty( $author_display_name ) ) { 248 168 if($attributes['authortype']==='image'){ 249 $list_items_markup .= sprintf( 250 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 251 $byline 252 ); 169 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 170 if (is_wp_error($attachment_id)) { 171 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 172 } 173 else { 174 // Use wp_get_attachment_image to display the image 175 $list_items_markup .= sprintf( 176 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 177 esc_html($byline) 178 ); 179 } 253 180 }else{ 254 181 $list_items_markup .= sprintf( 255 182 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 256 $byline183 esc_html($byline) 257 184 ); 258 185 } … … 284 211 $list_items_markup .= sprintf( 285 212 '<span class="comments-link"><i class="far fa-comment"></i> <a href="%2$s/#comments">Comments(%1$s)</a></span>', 286 $commentcounts,213 esc_html($commentcounts), 287 214 esc_url( $post_link ) 288 215 ); … … 297 224 '<header class="post-entry-header"><h3 class="post-entry-title"><a class="wp-block-latest-posts__post-title" href="%1$s">%2$s</a></h3></header>', 298 225 esc_url( $post_link ), 299 $title226 esc_html($title) 300 227 ); 301 228 } … … 320 247 $list_items_markup .= sprintf( 321 248 '<div class="post-entry-content wp-block-latest-posts__post-excerpt"><p class="spbb-entry-content 1">%1$s</p>%2$s</div>', 322 $trimmed_excerpt,323 $btn_markup249 esc_html($trimmed_excerpt), 250 wp_kses_post($btn_markup) 324 251 ); 325 252 } … … 327 254 else{ 328 255 329 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );256 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 330 257 331 258 if ( post_password_required( $post ) ) { … … 386 313 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 387 314 $list_items_markup .= '<div class="featured-image post-thumbnail"> 388 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>389 '. $image_markup.'315 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 316 '.wp_kses_post($image_markup).' 390 317 </div>'; 391 318 } … … 410 337 if ( ! empty( $author_display_name ) ) { 411 338 if($attributes['authortype']==='image'){ 412 $list_items_markup .= sprintf( 413 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 414 $byline 415 ); 339 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 340 if (is_wp_error($attachment_id)) { 341 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 342 } 343 else { 344 // Use wp_get_attachment_image to display the image 345 $list_items_markup .= sprintf( 346 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 347 esc_html($byline) 348 ); 349 } 416 350 }else{ 417 351 $list_items_markup .= sprintf( 418 352 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 419 $byline353 esc_html($byline) 420 354 ); 421 355 } … … 447 381 $list_items_markup .= sprintf( 448 382 '<span class="comments-link"><i class="far fa-comment"></i> <a href="%2$s/#comments">Comments(%1$s)</a></span>', 449 $commentcounts,383 esc_html($commentcounts), 450 384 esc_url( $post_link ) 451 385 ); … … 483 417 $list_items_markup .= sprintf( 484 418 '<div class="post-entry-content wp-block-latest-posts__post-excerpt"><p class="spbb-entry-content 1">%1$s</p>%2$s</div>', 485 $trimmed_excerpt,486 $btn_markup419 esc_html($trimmed_excerpt), 420 wp_kses_post($btn_markup) 487 421 ); 488 422 } … … 490 424 else{ 491 425 492 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );426 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 493 427 if ( post_password_required( $post ) ) { 494 428 $post_content = esc_html__( 'This content is password protected.' ,'gutensee'); … … 551 485 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 552 486 $list_items_markup .= '<div class="featured-image post-thumbnail"> 553 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>554 '. $image_markup.'487 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 488 '.wp_kses_post($image_markup).' 555 489 </div>'; 556 490 } … … 572 506 if ( ! empty( $author_display_name ) ) { 573 507 if($attributes['authortype']==='image'){ 574 $list_items_markup .= sprintf( 575 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 576 $byline 577 ); 508 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 509 if (is_wp_error($attachment_id)) { 510 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 511 } 512 else { 513 // Use wp_get_attachment_image to display the image 514 $list_items_markup .= sprintf( 515 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 516 esc_html($byline) 517 ); 518 } 578 519 }else{ 579 520 $list_items_markup .= sprintf( 580 521 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 581 $byline522 esc_html($byline) 582 523 ); 583 524 } … … 622 563 '<header class="post-entry-header"><h3 class="post-entry-title"><a class="wp-block-latest-posts__post-title" href="%1$s">%2$s</a></h3></header>', 623 564 esc_url( $post_link ), 624 $title565 esc_html($title) 625 566 ); 626 567 } … … 645 586 $list_items_markup .= sprintf( 646 587 '<div class="post-entry-content wp-block-latest-posts__post-excerpt"><p class="spbb-entry-content 1">%1$s</p>%2$s</div>', 647 $trimmed_excerpt,648 $btn_markup588 esc_html($trimmed_excerpt), 589 wp_kses_post($btn_markup) 649 590 ); 650 591 } … … 652 593 else{ 653 594 654 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );595 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 655 596 656 597 if ( post_password_required( $post ) ) { … … 711 652 $opacity= ($attributes['bgImageOverlay']) ? $attributes['bgOverlayOpacity'] : ''; 712 653 $list_items_markup .= '<div class="featured-image post-thumbnail"> 713 <div class="overlay" style="background-color:'. $backgroundColor.';opacity:'.$opacity.'"></div>714 '. $image_markup.'654 <div class="overlay" style="background-color:'.esc_attr($backgroundColor).';opacity:'.esc_attr($opacity).'"></div> 655 '.wp_kses_post($image_markup).' 715 656 </div>'; 716 657 } … … 735 676 if ( ! empty( $author_display_name ) ) { 736 677 if($attributes['authortype']==='image'){ 737 $list_items_markup .= sprintf( 738 '<span class="author"><img width="1060" height="766" src="'.$author_display_url.'" class="img-fluid" alt="user-1"><a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 739 $byline 740 ); 678 $attachment_id = gutensee_save_gravatar_to_media_library($author_display_url); 679 if (is_wp_error($attachment_id)) { 680 echo esc_html('Error: ' . $attachment_id->get_error_message(),'gutensee'); 681 } 682 else { 683 // Use wp_get_attachment_image to display the image 684 $list_items_markup .= sprintf( 685 '<span class="author">'.wp_get_attachment_image($attachment_id, 'thumbnail', false, array('class' => 'img-fluid', 'alt' => esc_attr($title),'width' => '1060', 'height'=> '766',)).'<a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 686 esc_html($byline) 687 ); 688 } 741 689 }else{ 742 690 $list_items_markup .= sprintf( 743 691 '<span class="author"><i class="fa-regular fa-user"></i> <a href="'.esc_url( $author_display_link).'">%1$s</a></span>', 744 $byline692 esc_html($byline) 745 693 ); 746 694 } … … 785 733 '<header class="post-entry-header"><h3 class="post-entry-title"><a class="wp-block-latest-posts__post-title" href="%1$s">%2$s</a></h3></header>', 786 734 esc_url( $post_link ), 787 $title735 esc_html($title) 788 736 ); 789 737 } … … 808 756 $list_items_markup .= sprintf( 809 757 '<div class="post-entry-content wp-block-latest-posts__post-excerpt"><p class="spbb-entry-content 1">%1$s</p>%2$s</div>', 810 $trimmed_excerpt,811 $btn_markup758 esc_html($trimmed_excerpt), 759 wp_kses_post($btn_markup) 812 760 ); 813 761 } … … 815 763 else{ 816 764 817 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset') );765 $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, esc_html(get_option( 'blog_charset' )) ); 818 766 819 767 if ( post_password_required( $post ) ) { … … 849 797 } 850 798 $list_items_markup .= '</div>'; 851 } 852 853 $navright=''; 854 $navleft=''; 855 if($attributes['navicon'] === 'angle'){ 856 $navleft='fas fa-chevron-left'; 857 $navright='fas fa-chevron-right'; 858 } 859 else if($attributes['navicon'] === 'doubleangle'){ 860 $navleft='fa-solid fa-angles-left'; 861 $navright='fa-solid fa-angles-right'; 862 } 863 else if($attributes['navicon'] === 'arrow'){ 864 $navleft='fa fa-arrow-left'; 865 $navright='fa fa-arrow-right'; 866 } 867 else if($attributes['navicon'] === 'longarrow'){ 868 $navleft='fa fa-arrow-left-long'; 869 $navright='fa fa-arrow-right-long'; 870 } 871 872 $navl="<button class='slide-nav nav-left ".$navleft."'></button>"; 873 $navr="<button class='slide-nav nav-right ".$navright."' ></button>"; 874 $infinite=($attributes['infiniteloop']===true)?'true':'false'; 875 $nav=($attributes['displaynav']===true)?'true':'false'; 876 $dot=($attributes['displaydots']===true)?'true':'false'; 877 $autoplay=($attributes['autoplay']===true)?'true':'false'; 878 799 } 879 800 880 801 remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length__premium_only', 20 ); … … 902 823 $list_items_markup .='</div></div>'; 903 824 904 $list_items_markup .= $attributes['addjs'];825 $list_items_markup .=wp_kses_post($attributes['addjs']); 905 826 906 827 return $list_items_markup; -
gutensee/trunk/inc/blocks/topbar.php
r3175185 r3213041 11 11 $alignmentClass = ($attributes['textAlignment'] != null) ? 'has-text-align-'.$attributes['textAlignment'] : ''; 12 12 13 $bordertop=(!empty($attributes['border']['top'])) ? $attributes['border']['top']['width'].' '. $attributes['border']['top']['style'].' '. $attributes['border']['top']['color'] : null;14 $borderright=(!empty($attributes['border']['right'])) ? $attributes['border']['right']['width'].' '. $attributes['border']['right']['style'].' '. $attributes['border']['right']['color'] : null;15 $borderbottom=(!empty($attributes['border']['bottom'])) ? $attributes['border']['bottom']['width'].' '. $attributes['border']['bottom']['style'].' '. $attributes['border']['bottom']['color'] : null;16 $borderleft=(!empty($attributes['border']['left'] )) ? $attributes['border']['left']['width'].' '. $attributes['border']['left']['style'].' '. $attributes['border']['left']['color'] : null;17 18 $iconbordertop=(!empty($attributes['iconborder']['top'])) ? $attributes['iconborder']['top']['width'].' '. $attributes['iconborder']['top']['style'].' '. $attributes['iconborder']['top']['color'] : null;19 $iconborderright=(!empty($attributes['iconborder']['right'])) ? $attributes['iconborder']['right']['width'].' '. $attributes['iconborder']['right']['style'].' '. $attributes['iconborder']['right']['color'] : null;20 $iconborderbottom=(!empty($attributes['iconborder']['bottom'])) ? $attributes['iconborder']['bottom']['width'].' '. $attributes['iconborder']['bottom']['style'].' '. $attributes['iconborder']['bottom']['color'] : null;21 $iconborderleft=(!empty($attributes['iconborder']['left'] )) ? $attributes['iconborder']['left']['width'].' '. $attributes['iconborder']['left']['style'].' '. $attributes['iconborder']['left']['color'] : null;22 23 $textbordertop=(!empty($attributes['textborder']['top'])) ? $attributes['textborder']['top']['width'].' '. $attributes['textborder']['top']['style'].' '. $attributes['textborder']['top']['color'] : null;24 $textborderright=(!empty($attributes['textborder']['right'])) ? $attributes['textborder']['right']['width'].' '. $attributes['textborder']['right']['style'].' '. $attributes['textborder']['right']['color'] : null;25 $textborderbottom=(!empty($attributes['textborder']['bottom'])) ? $attributes['textborder']['bottom']['width'].' '. $attributes['textborder']['bottom']['style'].' '. $attributes['textborder']['bottom']['color'] : null;26 $textborderleft=(!empty($attributes['textborder']['left'] )) ? $attributes['textborder']['left']['width'].' '. $attributes['textborder']['left']['style'].' '. $attributes['textborder']['left']['color'] : null;27 28 29 13 $dateFormat = isset($attributes['dateFormat']) ? $attributes['dateFormat'] : 'MM/DD/YYYY'; 30 14 $timeFormat = isset($attributes['timeFormat']) ? $attributes['timeFormat'] : 'HH:mm:ss'; … … 38 22 $query = new WP_Query($args); 39 23 40 $list_items_markup .= $attributes['addcss'];24 $list_items_markup .=wp_kses_post($attributes['addcss']); 41 25 42 26 // Format the date based on selected format … … 80 64 switch ($attributes['topbartypes']) { 81 65 case 'date': 82 $content='<div><span class="date"><i class="'. $attributes['topbaricon'].'"></i>'.$displayDateValue.'</span></div>';66 $content='<div><span class="date"><i class="'.esc_attr($attributes['topbaricon']).'"></i>'.esc_html($displayDateValue).'</span></div>'; 83 67 break; 84 68 case 'time': 85 $content='<div><i class="'. $attributes['topbaricon'].'"></i><span class="display-time" data-time-format="'.$timeFormat.'">'.$displayTimeValue.'</span></div>';69 $content='<div><i class="'.esc_attr($attributes['topbaricon']).'"></i><span class="display-time" data-time-format="'.$timeFormat.'">'.esc_html($displayTimeValue).'</span></div>'; 86 70 break; 87 71 case 'post': 88 $content .='<div class="slick-slider '. $attributes['uniqueid'].'">';72 $content .='<div class="slick-slider '.esc_attr($attributes['uniqueid']).'">'; 89 73 if ($query->have_posts()) { 90 74 while ($query->have_posts()) { 91 75 $query->the_post(); 92 $content .='<div class="slide '. $alignmentClass.'"><span class="slide-heading"><a href="'.get_the_permalink().'"><i class="'.$attributes['topbaricon'].'"}></i>'.get_the_title().'</a></span></div>';76 $content .='<div class="slide '.esc_attr($alignmentClass).'"><span class="slide-heading"><a href="'.esc_url(get_the_permalink()).'"><i class="'.esc_attr($attributes['topbaricon']).'"}></i>'.esc_url(get_the_title()).'</a></span></div>'; 93 77 } 94 78 } … … 97 81 break; 98 82 case 'custom': 99 $content='<div><span><a href="'. $attributes['textlink'].'" target="'.$topbartarget.'"><i class="'.$attributes['topbaricon'].'"></i>'.$attributes['text'].'</a></span></div>';83 $content='<div><span><a href="'.esc_url($attributes['textlink']).'" target="'.esc_attr($topbartarget).'"><i class="'.esc_attr($attributes['topbaricon']).'"></i>'.esc_html($attributes['text']).'</a></span></div>'; 100 84 break; 101 85 default: … … 104 88 } 105 89 106 $list_items_markup .= '<div id="'. $attributes['advid'].'"><div class="gutensee-topbar '.$displayclass.' '.$animationclass.' '.$alignmentClass.' '.$attributes['advclass'].'" id="'.$attributes['uniqueid'].'">'.$content.'</div></div>';90 $list_items_markup .= '<div id="'.esc_attr($attributes['advid']).'"><div class="gutensee-topbar '.esc_attr($displayclass).' '.esc_attr($animationclass).' '.esc_attr($alignmentClass).' '.esc_attr($attributes['advclass']).'" id="'.esc_attr($attributes['uniqueid']).'">'.wp_kses_post($content).'</div></div>'; 107 91 108 $list_items_markup .= $attributes['addjs'];92 $list_items_markup .=wp_kses_post($attributes['addjs']); 109 93 110 94 return $list_items_markup; -
gutensee/trunk/readme.txt
r3198319 r3213041 5 5 Requires at least: 5.3 6 6 Tested up to: 6.7.1 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later … … 48 48 == Changelog == 49 49 50 @Version 1.0.4 51 * Fixed reviewer issues. 52 50 53 @Version 1.0.3 51 54 * Fixed reviewer issues.
Note: See TracChangeset
for help on using the changeset viewer.