From 4ad844826daf4de1d22a872f3b5fab110121fa4c Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Wed, 8 May 2024 02:57:42 -0400 Subject: [PATCH] fixed - WPCS errors and warnings --- archive.php | 66 ++++----- comments.php | 35 ++++- functions.php | 53 ++++--- header.php | 33 +++-- inc/admin-branding-ed.php | 20 ++- inc/author-box.php | 2 +- inc/class-gutenberg-loader.php | 28 +++- inc/comments.php | 4 +- inc/fonts.php | 8 +- inc/helper-functions.php | 131 ++++++++++-------- inc/layouts.php | 37 +++-- inc/login-logo.php | 4 +- inc/loop.php | 63 ++++----- inc/map-block-functionality.php | 81 +++++++---- inc/pwa.php | 12 -- inc/shared-counts.php | 2 +- inc/template-tags.php | 96 +++++++------ inc/tha-theme-hooks.php | 2 +- inc/wordpress-cleanup.php | 27 ++-- inc/wordpress-seo.php | 4 +- index.php | 8 +- single-slp_contacts.php | 38 ++--- .../blocks/calculator-form-cta/template.php | 21 +-- .../calculator-signup.php | 50 ++++--- .../blocks/columns-with-button/template.php | 19 ++- .../blocks/detailed-links/template.php | 27 ++-- .../doctor-mortgages-map-block.php | 19 ++- .../blocks/featured-in/featured-in.php | 23 +-- .../blocks/featured-institution/template.php | 65 ++++----- .../blocks/featured-post/template.php | 12 +- .../blocks/form-column/template.php | 27 ++-- .../image-text-columns-block/template.php | 23 +-- template-parts/blocks/link-tiles/template.php | 29 ++-- .../media-reviews-block/media-reviews.php | 29 ++-- .../media-reviews-global.php | 32 +++-- .../media-reviews-slider.php | 21 +-- .../podcast-trio-block/podcast-trio.php | 32 ++--- .../blocks/pricing-calculator/template.php | 41 +++--- .../blocks/query-loop/query-loop.php | 61 ++++---- .../recommended-posts-block/template.php | 12 +- .../blocks/resource-links-nav/template.php | 42 +++--- .../blocks/resource-links/resource-links.php | 112 ++++++--------- .../resources-loop-block/resources-loop.php | 57 ++++---- .../resources-loop-reverse.php | 60 ++++---- .../squared-image-content-callout.php | 20 +-- template-parts/blocks/tab-block/template.php | 33 ++--- .../blocks/tabbed-content/tabbed-content.php | 60 ++++---- .../blocks/table-of-contents/template.php | 10 +- .../blocks/team-hightlight/template.php | 22 +-- .../blocks/testimonial-slider/template.php | 36 ++--- .../blocks/vendor-information/template.php | 22 +-- .../blocks/vendor-repeater/template.php | 38 ++--- .../blocks/video-block/template.php | 28 ++-- .../blocks/video-carousel/template.php | 28 ++-- .../blocks/video-testimonials/template.php | 37 ++--- 55 files changed, 1013 insertions(+), 889 deletions(-) diff --git a/archive.php b/archive.php index 7b5adb5..43a2da2 100644 --- a/archive.php +++ b/archive.php @@ -28,7 +28,7 @@ function eqd_archive_body_class( $classes ) { function eqd_archive_header() { $title = false; - $subtitle = false; + $subtitle = false; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- Leaving for future use. $description = false; if ( is_author() ) { @@ -93,7 +93,7 @@ function eqd_archive_recommended_post() { name; + echo 'Recommended Resources for ' . esc_html( $term->name ); } else { echo 'Featured articles'; } @@ -105,13 +105,13 @@ function eqd_archive_recommended_post() { $args = array( 'post__in' => $post_recommened, 'post_type' => 'post', - 'orderby' => 'post__in', // This will preserve the order of IDs as you provided - 'posts_per_page' => -1, // Get all posts matching the criteria + 'orderby' => 'post__in', // phpcs:ignore WordPress.VIP.PostsPerPage.posts_per_page_posts_per_page -- This will preserve the order of IDs as you provided. + 'posts_per_page' => -1, // Get all posts matching the criteria. ); $the_query = new WP_Query( $args ); - // The Loop + // The Loop. if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); @@ -120,7 +120,7 @@ function eqd_archive_recommended_post() {
- +

@@ -151,10 +151,9 @@ function eqd_archive_recommended_post() { @@ -166,6 +165,11 @@ function eqd_archive_recommended_post() { } add_action( 'tha_content_before_container', 'eqd_archive_recommended_post' ); +/** + * Archive Recommended CTA. + * + * @return void + */ function eqd_archive_recommended_cta() { $term = get_queried_object(); $cta = get_field( 'cta', $term ); @@ -173,29 +177,29 @@ function eqd_archive_recommended_cta() { if ( $cta ) : if ( ! is_paged() ) : ?> -
-
- -
- <?php echo wp_kses_post( $cta['title'] ); ?> -
- - -
-

-
- -
-
- -
-
- -
-
+
+
+ +
+ <?php echo wp_kses_post( $cta['title'] ); ?> +
+ + +
+

+
+ +
+
+ +
+
+ +
+
$comment_id ) ); return ! empty( $children ); } +/** + * Add class to comment with children. + * + * @param array $classes The comment classes. + * @return array + */ function add_class_to_comment_with_children( $classes ) { global $comment; if ( has_children( $comment->comment_ID ) ) { @@ -32,7 +44,15 @@ function add_class_to_comment_with_children( $classes ) { add_filter( 'comment_class', 'add_class_to_comment_with_children' ); if ( ! function_exists( 'comments_callback' ) ) : - + + /** + * Comments callback. + * + * @param string $comment The comment. + * @param array $args The arguments. + * @param int $depth The depth. + * @return void + */ function comments_callback( $comment, $args, $depth ) { ?> @@ -41,19 +61,22 @@ function comments_callback( $comment, $args, $depth ) {
- +
- + - +
- comment_approved === '0' ) : ?> - + comment_approved ) : ?> + diff --git a/functions.php b/functions.php index 51026c7..7396081 100644 --- a/functions.php +++ b/functions.php @@ -313,17 +313,16 @@ function eqd_template_hierarchy( $template ) { * * @return array The modified query arguments. */ -function npp_custom_acf_post_object_query( $args, $field, $post_id ) { +function eqd_custom_acf_post_object_query( $args, $field, $post_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- ACF hook. // Check if the field being queried is named 'recommended_posts'. - if ( $field['name'] === 'recommended_posts' ) { + if ( 'recommended_posts' === $field['name'] ) { // Modify the query to search for post titles only. - $args['post_type'] = 'post'; - // $args['s'] = ''; // Clear any previous search query. + $args['post_type'] = 'post'; $args['search_columns'] = array( 'post_title' ); } return $args; } -add_filter( 'acf/fields/post_object/query', 'npp_custom_acf_post_object_query', 10, 3 ); +add_filter( 'acf/fields/post_object/query', 'eqd_custom_acf_post_object_query', 10, 3 ); /** * Filters the query arguments for the 'recommendedfeatured_posts' ACF Post Object field. @@ -336,7 +335,7 @@ function npp_custom_acf_post_object_query( $args, $field, $post_id ) { * * @return array Modified query arguments. */ -function npp_filter_post_object_query( $args, $field, $post_id ) { +function eqd_filter_post_object_query( $args, $field, $post_id ) { // Check if this is the specific field we want to modify. if ( 'recommendedfeatured_posts' === $field['name'] ) { @@ -347,7 +346,7 @@ function npp_filter_post_object_query( $args, $field, $post_id ) { // Check if term belongs to the specified taxonomies. if ( $term instanceof WP_Term && in_array( $term->taxonomy, array( 'category', 'post_tag', 'slp_occupation' ), true ) ) { - $args['tax_query'] = array( + $args['tax_query'] = array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query -- This is a necessary query. array( 'taxonomy' => $term->taxonomy, 'field' => 'term_id', @@ -361,30 +360,44 @@ function npp_filter_post_object_query( $args, $field, $post_id ) { return $args; } -add_filter( 'acf/fields/post_object/query', 'npp_filter_post_object_query', 10, 3 ); +add_filter( 'acf/fields/post_object/query', 'eqd_filter_post_object_query', 10, 3 ); -function modify_post_object_query( $args, $field, $post_id ) { - // Check if the parent block is 'acf/recommended-posts-block' - if ( isset( $field['parent'] ) && $field['parent'] === 'block_acf/recommended-posts-block' ) { - // If there's a search term, modify the query to search by title only +/** + * Modify the query for the 'recommended_posts' field to search by title only. + * + * @param array $args The original query arguments. + * @param array $field Information about the ACF field. + * @param int $post_id The ID of the current post being edited, if applicable. + * @return array + */ +function eqd_modify_post_object_query( $args, $field, $post_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + // Check if the parent block is 'acf/recommended-posts-block'. + if ( isset( $field['parent'] ) && 'block_acf/recommended-posts-block' === $field['parent'] ) { + // If there's a search term, modify the query to search by title only. if ( isset( $args['s'] ) ) { - // Set search term to a variable + // Set search term to a variable. $search_term = $args['s']; - // Modify the query - unset( $args['s'] ); // Remove default search - $args['post_title_like'] = $search_term; // Add title search + // Modify the query. + unset( $args['s'] ); // Remove default search. + $args['post_title_like'] = $search_term; // Add title search. } } - - // Return the modified arguments return $args; } -add_filter( 'acf/fields/post_object/query', 'modify_post_object_query', 10, 3 ); +add_filter( 'acf/fields/post_object/query', 'eqd_modify_post_object_query', 10, 3 ); +/** + * This function modifies the query for the 'recommended_posts' field to search by title only. + * + * @param string $where The original WHERE clause. + * @param object $wp_query The WP_Query object. + * @return string + */ function title_like_posts_where( $where, $wp_query ) { global $wpdb; - if ( $post_title_like = $wp_query->get( 'post_title_like' ) ) { + $post_title_like = $wp_query->get( 'post_title_like' ); + if ( $post_title_like ) { $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'' . esc_sql( $wpdb->esc_like( $post_title_like ) ) . '%\''; } return $where; diff --git a/header.php b/header.php index 76a8101..bd7677a 100644 --- a/header.php +++ b/header.php @@ -1,13 +1,13 @@ @@ -23,7 +23,7 @@ @@ -91,16 +91,16 @@
'slp_landing', 'post_status' => 'publish', 'numberposts' => 1, - 'meta_query' => array( + 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- Meta query is needed. array( 'key' => 'landing_page_url_text', 'value' => $page_slug, @@ -108,12 +108,11 @@ ), ), ); - $page = get_posts( $args ); - - // If the page exists, redirect or load the page - if ( $page ) { - $page_id = $page[0]->ID; + $landing_page = get_posts( $args ); + // If the page exists, redirect or load the page. + if ( $landing_page ) { + $page_id = $landing_page[0]->ID; $parameter_page = $page_id; } } @@ -126,7 +125,7 @@ ?>
- Get Help + Get Help
diff --git a/inc/admin-branding-ed.php b/inc/admin-branding-ed.php index 72a248f..12b005f 100644 --- a/inc/admin-branding-ed.php +++ b/inc/admin-branding-ed.php @@ -12,10 +12,10 @@ /** * Modify the admin footer text. * - * @return void + * @return mixed Footer text. */ function eqd_modify_footer_admin() { - echo 'Theme Development by Equalize Digital'; + return 'Theme Development by Equalize Digital'; } add_action( 'login_head', 'custom_loginlogo' ); @@ -110,7 +110,6 @@ function eqd_dashboard_widget_function() { echo '
  • Website equalizedigital.com
  • '; echo '
  • Email support@equalizedigital.com
  • '; echo '
  • Phone 512-942-5858
  • '; - /* echo '
  • Support FAQ & Hours
  • '; */ echo ''; echo '

    FOLLOW US

    '; echo ' @@ -153,15 +152,12 @@ function eqd_dashboard_rss() { } foreach ( $rss->get_items( 0, $items ) as $item ) { - $publisher = ''; - $site_link = ''; - $link = ''; - $content = ''; - $date = ''; - $link = esc_url( strip_tags( $item->get_link() ) ); - $title = esc_html( $item->get_title() ); - $content = $item->get_content(); - $content = wp_html_excerpt( $content, 200 ) . ' ...Keep Reading'; + $link = ''; + $content = ''; + $link = esc_url( wp_strip_all_tags( $item->get_link() ) ); + $title = esc_html( $item->get_title() ); + $content = $item->get_content(); + $content = wp_html_excerpt( $content, 200 ) . ' ...Keep Reading'; echo "
  • " . wp_kses_post( $title ) . "\n
    " . wp_kses_post( $content ) . "
    \n"; } diff --git a/inc/author-box.php b/inc/author-box.php index 47a901c..a8c80f4 100644 --- a/inc/author-box.php +++ b/inc/author-box.php @@ -21,7 +21,7 @@ function eqd_custom_author_url( $link, $author_id ) { } return $link; } -// add_filter( 'author_link', 'eqd_custom_author_url', 10, 2 ); // phpcs:ignore Squiz.PHP.CommentedOutCode.Found -- Uncomment this line to use the custom author url. +// add_filter( 'author_link', 'eqd_custom_author_url', 10, 2 ); phpcs:ignore Squiz.PHP.CommentedOutCode.Found -- Uncomment this line to use the custom author url. /** * Author archive avatar diff --git a/inc/class-gutenberg-loader.php b/inc/class-gutenberg-loader.php index 2f36a84..a4dbdcd 100644 --- a/inc/class-gutenberg-loader.php +++ b/inc/class-gutenberg-loader.php @@ -1,15 +1,30 @@ -'; else : - $output = '
    ' . __( 'No preview available', '' ) . '
    '; + $output = '
    ' . __( 'No preview available', 'eqd' ) . '
    '; endif; return apply_filters( 'get_preview_image', $output, $block_image, $block_name ); diff --git a/inc/comments.php b/inc/comments.php index c240d1f..d16ed23 100644 --- a/inc/comments.php +++ b/inc/comments.php @@ -49,12 +49,12 @@ function eqd_comment_navigation( $location = '' ) { * Staff comment class * * @param array $classes An array of comment classes. - * @param string $class A comma-separated list of additional classes added to the list. + * @param string $comment_class A comma-separated list of additional classes added to the list. * @param int $comment_id The comment ID. * @param WP_Comment $comment The comment object. * @param int|WP_Post $post_id The post ID or WP_Post object. */ -function eqd_staff_comment_class( $classes, $class, $comment_id, $comment, $post_id ) { +function eqd_staff_comment_class( $classes, $comment_class, $comment_id, $comment, $post_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- WP core hook. if ( empty( $comment->user_id ) ) { return $classes; } diff --git a/inc/fonts.php b/inc/fonts.php index 2cbcb88..c3e613c 100644 --- a/inc/fonts.php +++ b/inc/fonts.php @@ -38,7 +38,7 @@ function eqd_enqueue_frontend_fonts() { return; } - wp_enqueue_style( 'eqd-font', esc_url( $font_url ), array(), null, 'all' ); + wp_enqueue_style( 'eqd-font', esc_url( $font_url ), array(), null, 'all' ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- external resource. } add_action( 'wp_enqueue_scripts', 'eqd_enqueue_frontend_fonts' ); @@ -48,7 +48,7 @@ function eqd_enqueue_frontend_fonts() { function eqd_enqueue_backend_fonts() { $font_url = eqd_theme_fonts_url(); if ( ! empty( $font_url ) ) { - wp_enqueue_style( 'eqd-font', esc_url( $font_url ), array(), null, 'all' ); + wp_enqueue_style( 'eqd-font', esc_url( $font_url ), array(), null, 'all' ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- external resource. } } add_action( 'enqueue_block_editor_assets', 'eqd_enqueue_backend_fonts' ); @@ -89,7 +89,7 @@ function fontLoadedSuccess() {  
  • true ) ); // get all menus + // Ensure it targets the correct field key. + if ( 'field_64f21f700a2cd' === $field['key'] ) { + $menus = get_terms( 'nav_menu' ); foreach ( $menus as $menu ) { $field['choices'][ $menu->term_id ] = $menu->name; @@ -38,7 +39,7 @@ function load_menu_names_to_acf( $field ) { } /** - * Get the first term attached to post + * Get the first term attached to post. * * @param array $args Args. */ @@ -101,7 +102,7 @@ function eqd_first_term( $args = array() ) { } /** - * Conditional CSS Classes + * Conditional CSS Classes. * * @param string $base_classes classes always applied. * @param string $optional_class additional class applied if $conditional is true. @@ -113,7 +114,7 @@ function eqd_class( $base_classes, $optional_class, $conditional ) { } /** - * Background Image Style + * Background Image Style. * * @param int $image_id Image ID. * @param string $image_size Image Size. @@ -125,7 +126,7 @@ function eqd_bg_image_style( $image_id = false, $image_size = 'full' ) { } /** - * Get Icon + * Get Icon. * This function is in charge of displaying SVG icons across the site. * * Place each source in the /assets/icons/{group}/ directory. @@ -172,7 +173,7 @@ function eqd_icon( $atts = array() ) { // Display the icon directly. if ( true === $atts['force'] ) { - $icon = file_get_contents( $icon_path ); + $icon = file_get_contents( $icon_path ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown -- We're loading a local file. if ( false !== $atts['size'] ) { $repl = sprintf( ''; + $output = ''; return apply_filters( 'eqd_button', $output, $block ); } /** * Add the target attribute for links * - * @param string + * @param string $value The target attribute value. * @return void */ function slp_a_target( $value ) { if ( ! $value ) { return; } - return ' target="' . $value . '"'; } @@ -344,7 +346,7 @@ function slp_append_superscript( $content, $superscript_text ) { // Convert the superscript text to actual HTML tag. $superscript = '' . $superscript_text . ''; - // Use regex to match
    tags with potential white spaces and replace them with the superscript + // Use regex to match
    tags with potential white spaces and replace them with the superscript. $updated_content = preg_replace( '/\s*\s*/', $superscript . '
    ', $content ); // Additionally, add superscript to the end of the paragraph if needed. @@ -353,9 +355,13 @@ function slp_append_superscript( $content, $superscript_text ) { return $updated_content; } - - -function get_company_name_shortcode( $atts ) { +/** + * Get the company name from the landing page URL. + * + * @param array $atts Shortcode attributes. + * @return string Company name or fallback message. + */ +function eqd_get_company_name_shortcode( $atts ) { $fallback = shortcode_atts( array( 'fallback' => 'eee', @@ -364,18 +370,18 @@ function get_company_name_shortcode( $atts ) { ); - // Default message + // Default message. $message = esc_attr( $fallback['fallback'] ); - if ( isset( $_GET['landing_page'] ) ) { - $page_slug = sanitize_text_field( $_GET['landing_page'] ); + if ( isset( $_GET['landing_page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Using $_GET to retrieve the landing page URL. + $page_slug = sanitize_text_field( $_GET['landing_page'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Using $_GET to retrieve the landing page URL. - // Query the CPT for the company name using the 'page_slug' + // Query the CPT for the company name using the 'page_slug'. $args = array( 'post_type' => 'slp_landing', 'post_status' => 'publish', 'numberposts' => 1, - 'meta_query' => array( + 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- Meta query is necessary to retrieve the correct post. array( 'key' => 'landing_page_url_text', 'value' => $page_slug, @@ -385,42 +391,47 @@ function get_company_name_shortcode( $atts ) { ); $query = new WP_Query( $args ); - // If a post is found, retrieve the Company Name + // If a post is found, retrieve the Company Name. if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); - // Assuming the company name is stored in a custom field. Replace 'company_name' with your actual custom field key + // Assuming the company name is stored in a custom field. Replace 'company_name' with your actual custom field key. $company_name = get_post_meta( get_the_ID(), 'company_name', true ); if ( ! empty( $company_name ) ) { - $message = $company_name; // Set the message to the company name + $message = $company_name; // Set the message to the company name. } } - wp_reset_postdata(); // Reset post data + wp_reset_postdata(); // Reset post data. } } - // Return the company name or default message + // Return the company name or default message. return $message; } -add_shortcode( 'get_company_name', 'get_company_name_shortcode' ); +add_shortcode( 'get_company_name', 'eqd_get_company_name_shortcode' ); - -function generate_custom_booking_button_shortcode( $atts ) { - // Default URL for the booking button +/** + * Generate a custom booking button shortcode. + * + * @param array $atts Shortcode attributes. + * @return string HTML for the custom booking button. + */ +function generate_custom_booking_button_shortcode( $atts ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found, VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- $atts is used in the shortcode. + // Default URL for the booking button. $default_url = 'https://calendly.com/studentloanplanner-team'; - $button_url = $default_url; // Set the button URL to default initially + $button_url = $default_url; // Set the button URL to default initially. - // Check if the 'landing_page' URL parameter is present - if ( isset( $_GET['landing_page'] ) ) { - $page_slug = sanitize_text_field( $_GET['landing_page'] ); + // Check if the 'landing_page' URL parameter is present. + if ( isset( $_GET['landing_page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Using $_GET to retrieve the landing page URL. + $page_slug = sanitize_text_field( $_GET['landing_page'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Using $_GET to retrieve the landing page URL. - // Query the CPT for the booking link using the 'page_slug' + // Query the CPT for the booking link using the 'page_slug'. $args = array( 'post_type' => 'slp_landing', 'post_status' => 'publish', 'numberposts' => 1, - 'meta_query' => array( + 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- Meta query is necessary to retrieve the correct post. array( 'key' => 'landing_page_url_text', 'value' => $page_slug, @@ -430,44 +441,52 @@ function generate_custom_booking_button_shortcode( $atts ) { ); $query = new WP_Query( $args ); - // If a post is found, retrieve the Booking Link + // If a post is found, retrieve the Booking Link. if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); - // Assuming the booking link is stored in a custom field. Replace 'booking_link' with your actual custom field key + // Assuming the booking link is stored in a custom field. Replace 'booking_link' with your actual custom field key. $booking_link = get_post_meta( get_the_ID(), 'booking_link', true ); if ( ! empty( $booking_link ) ) { - $button_url = $booking_link; // Update the button URL to the custom link + $button_url = $booking_link; // Update the button URL to the custom link. } } - wp_reset_postdata(); // Reset post data + wp_reset_postdata(); // Reset post data. } } - // Generate the HTML for the button + // Generate the HTML for the button. $button_html = '
    '; - // Return the button HTML + // Return the button HTML. return $button_html; } add_shortcode( 'custom_booking_button', 'generate_custom_booking_button_shortcode' ); +/** + * Logo Setup + * + * @return void + */ function eqd_logo_setup() { $defaults = array( - 'height' => 70, // Set the desired height for the logo - 'width' => 240, // Set the desired width for the logo - 'flex-height' => true, // Allow flexible height - 'flex-width' => true, // Allow flexible width - 'header-text' => array( 'site-title', 'site-description' ), // Selectively hide or show site title and tagline + 'height' => 70, // Set the desired height for the logo. + 'width' => 240, // Set the desired width for the logo. + 'flex-height' => true, // Allow flexible height. + 'flex-width' => true, // Allow flexible width. + 'header-text' => array( 'site-title', 'site-description' ), // Selectively hide or show site title and tagline. ); add_theme_support( 'custom-logo', $defaults ); } add_action( 'after_setup_theme', 'eqd_logo_setup' ); -function enqueue_block_editor_assets_vc() { +/** + * Add custom image sizes + */ +function eqd_enqueue_block_editor_assets_vc() { wp_enqueue_style( 'swiper-css', 'https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css', array(), '11.0.0' ); } -add_action( 'enqueue_block_editor_assets', 'enqueue_block_editor_assets_vc' ); +add_action( 'enqueue_block_editor_assets', 'eqd_enqueue_block_editor_assets_vc' ); diff --git a/inc/layouts.php b/inc/layouts.php index 45356c1..745688c 100644 --- a/inc/layouts.php +++ b/inc/layouts.php @@ -39,7 +39,7 @@ function eqd_editor_layout_class( $classes ) { return $classes; } - $post_id = isset( $_GET['post'] ) ? intval( $_GET['post'] ) : false; + $post_id = isset( $_GET['post'] ) ? intval( $_GET['post'] ) : false; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No need to verify nonce here. $layout = eqd_page_layout( $post_id ); $classes .= ' ' . $layout . ' '; @@ -262,7 +262,7 @@ function eqd_page_layout( $id = false ) { 'cultivate_landing' => 'full-width-content', ); foreach ( $defaults as $post_type => $default_layout ) { - if ( ( $id && $post_type === get_post_type( $id ) ) || ( ! empty( $_GET['post_type'] ) && $post_type === $_GET['post_type'] ) ) { + if ( ( $id && get_post_type( $id ) === $post_type ) || ( ! empty( $_GET['post_type'] ) && $_GET['post_type'] === $post_type ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No need to verify nonce here. $layout = $default_layout; } } @@ -325,12 +325,9 @@ function eqd_single_fullwidth_content() { ' . get_the_modified_date( 'F j, Y' ) . ''; - $post_data = get_the_content( get_the_ID() ); + $post_data = get_the_content( get_the_ID() ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- Leaving for future use. ?> - meta->for_current_page()->estimated_reading_time_minutes, ' Min Read | '; - ?> - +
    - diff --git a/template-parts/blocks/featured-post/template.php b/template-parts/blocks/featured-post/template.php index 756a849..070e284 100644 --- a/template-parts/blocks/featured-post/template.php +++ b/template-parts/blocks/featured-post/template.php @@ -39,13 +39,13 @@ $category_ids = wp_get_post_categories( $post_select->ID ); -$dateObject = new DateTime( $post_select->post_date ); -$formattedDate = $dateObject->format( 'M d, Y' ); +$date_object = new DateTime( $post_select->post_date ); +$formatted_date = $date_object->format( 'M d, Y' ); -// Get the author ID from the post ID +// Get the author ID from the post ID. $author_id = get_post_field( 'post_author', $post_select->ID ); -// Get the author's display name +// Get the author's display name. $author_name = get_the_author_meta( 'display_name', $author_id ); // Get the author's avatar. You can adjust the size (e.g., 96 here) as needed. @@ -61,11 +61,11 @@ name . ' '; + echo esc_html( $category->name ) . ' '; } ?> -
    +

    post_title ); ?>

    diff --git a/template-parts/blocks/form-column/template.php b/template-parts/blocks/form-column/template.php index 841d7a9..826f0a1 100644 --- a/template-parts/blocks/form-column/template.php +++ b/template-parts/blocks/form-column/template.php @@ -1,6 +1,11 @@ -
    +
    -

    - +

    +
    - +
    -
    \ No newline at end of file +
    diff --git a/template-parts/blocks/image-text-columns-block/template.php b/template-parts/blocks/image-text-columns-block/template.php index 20a5157..bff0576 100644 --- a/template-parts/blocks/image-text-columns-block/template.php +++ b/template-parts/blocks/image-text-columns-block/template.php @@ -1,6 +1,11 @@ -
    +
    \ No newline at end of file diff --git a/template-parts/blocks/link-tiles/template.php b/template-parts/blocks/link-tiles/template.php index 844c57c..efd2494 100644 --- a/template-parts/blocks/link-tiles/template.php +++ b/template-parts/blocks/link-tiles/template.php @@ -1,12 +1,16 @@
    @@ -46,20 +45,20 @@ @@ -71,11 +70,11 @@ ?>
    @@ -128,7 +133,7 @@

    @@ -147,10 +152,8 @@ $read_more_link = get_field( 'read_more_link' ); if ( $read_more_link ) : ?> -
    + - - diff --git a/template-parts/blocks/media-reviews-global/media-reviews-global.php b/template-parts/blocks/media-reviews-global/media-reviews-global.php index 0a47fba..ddd5fb4 100644 --- a/template-parts/blocks/media-reviews-global/media-reviews-global.php +++ b/template-parts/blocks/media-reviews-global/media-reviews-global.php @@ -1,6 +1,11 @@ -
    +
    -

    +

    -
    +
    @@ -59,14 +64,14 @@ ?>
    - ID ); ?> - ID ); ?> + ID ) ); ?> + ID ) ); ?>
    @@ -55,29 +63,26 @@ - - - -
    - - - +
    - + - - +
    - -