From dd68cd6049ca3ba3378710b9ad684f7515c103e1 Mon Sep 17 00:00:00 2001 From: Benjamin Gaussorgues Date: Wed, 14 Oct 2026 14:48:08 +0200 Subject: [PATCH 1/3] chore(ci): add validation workflows Signed-off-by: Benjamin Gaussorgues --- .github/workflows/fixup.yml | 36 ++++ .github/workflows/lint-php-cs.yml | 50 ++++++ .github/workflows/lint-php-cs.yml.patch | 21 +++ .github/workflows/psalm.yml | 54 ++++++ .github/workflows/psalm.yml.patch | 13 ++ .github/workflows/sync-workflow-templates.yml | 167 ++++++++++++++++++ psalm.xml | 1 + 7 files changed, 342 insertions(+) create mode 100644 .github/workflows/fixup.yml create mode 100644 .github/workflows/lint-php-cs.yml create mode 100644 .github/workflows/lint-php-cs.yml.patch create mode 100644 .github/workflows/psalm.yml create mode 100644 .github/workflows/psalm.yml.patch create mode 100644 .github/workflows/sync-workflow-templates.yml diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml new file mode 100644 index 0000000..69da2bb --- /dev/null +++ b/.github/workflows/fixup.yml @@ -0,0 +1,36 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Block fixup and squash commits + +on: + pull_request: + types: [opened, ready_for_review, reopened, synchronize] + +permissions: + contents: read + +concurrency: + group: fixup-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + commit-message-check: + if: github.event.pull_request.draft == false + + permissions: + pull-requests: write + name: Block fixup and squash commits + + runs-on: ubuntu-latest-low + + steps: + - name: Run check + uses: skjnldsv/block-fixup-merge-action@c138ea99e45e186567b64cf065ce90f7158c236a # v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 0000000..0f61391 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,50 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Lint php-cs + +on: pull_request + +permissions: + contents: read + +concurrency: + group: lint-php-cs-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up php8.4 + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: 8.4 + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove nextcloud/ocp + run: | + composer remove nextcloud/ocp --dev --no-scripts + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Lint + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/.github/workflows/lint-php-cs.yml.patch b/.github/workflows/lint-php-cs.yml.patch new file mode 100644 index 0000000..0ea732e --- /dev/null +++ b/.github/workflows/lint-php-cs.yml.patch @@ -0,0 +1,21 @@ +diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml +index 06d0842..0f61391 100644 +--- a/.github/workflows/lint-php-cs.yml ++++ b/.github/workflows/lint-php-cs.yml +@@ -29,14 +29,10 @@ jobs: + with: + persist-credentials: false + +- - name: Get php version +- id: versions +- uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3 +- +- - name: Set up php${{ steps.versions.outputs.php-min }} ++ - name: Set up php8.4 + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: +- php-version: ${{ steps.versions.outputs.php-min }} ++ php-version: 8.4 + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml new file mode 100644 index 0000000..dc2507c --- /dev/null +++ b/.github/workflows/psalm.yml @@ -0,0 +1,54 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Static analysis + +on: pull_request + +concurrency: + group: psalm-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + static-analysis: + runs-on: ubuntu-latest + + name: static-psalm-analysis + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Check enforcement of minimum PHP version 8.4 in psalm.xml + run: grep 'phpVersion="8.4"' psalm.xml + + - name: Set up php8.4 + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: 8.4 + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development + # Temporary workaround for missing pcntl_* in PHP 8.3 + ini-values: disable_functions= + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove nextcloud/ocp + run: | + composer remove nextcloud/ocp --dev --no-scripts + + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + + - name: Run coding standards check + run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github diff --git a/.github/workflows/psalm.yml.patch b/.github/workflows/psalm.yml.patch new file mode 100644 index 0000000..ef2d5d5 --- /dev/null +++ b/.github/workflows/psalm.yml.patch @@ -0,0 +1,13 @@ +diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml +index d232cef..dc2507c 100644 +--- a/.github/workflows/psalm.yml ++++ b/.github/workflows/psalm.yml +@@ -50,8 +50,5 @@ jobs: + - name: Install composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + +- - name: Install nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} +- run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies +- + - name: Run coding standards check + run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github diff --git a/.github/workflows/sync-workflow-templates.yml b/.github/workflows/sync-workflow-templates.yml new file mode 100644 index 0000000..5d84aec --- /dev/null +++ b/.github/workflows/sync-workflow-templates.yml @@ -0,0 +1,167 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +# This workflow will update all workflow templates +# Additionally it will reapply `workflow.yml.patch` files after syncing and only then commit the result +name: Update workflows +on: + workflow_dispatch: + schedule: + - cron: "45 22 * * 6" + +permissions: + contents: read + +jobs: + dispatch: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + branches: + - ${{ github.event.repository.default_branch }} + - 'stable35' + - 'stable34' + - 'stable33' + + name: Update workflows in ${{ matrix.branches }} + + permissions: + contents: write + pull-requests: write + + steps: + - name: Check actor permission + uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 + with: + require: admin + + - name: Checkout workflow repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + path: source + repository: nextcloud/.github + + - name: Checkout app + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + path: target + ref: ${{ matrix.branches }} + + - name: Check for active merge freeze + id: freeze + env: + BRANCH_NAME: ${{ matrix.branches }} + run: | + if [[ ! -f target/.github/workflows/block-merge-freeze.yml ]]; then + echo 'No block-merge-freeze workflow, continuing' + exit 0 + fi + if [[ "$BRANCH_NAME" == 'main' || "$BRANCH_NAME" == 'master' ]]; then + SERVER_REF='master' + elif [[ "$BRANCH_NAME" =~ ^stable[0-9]+$ ]]; then + SERVER_REF="$BRANCH_NAME" + else + echo 'Not based on master/main/stable*, so skipping freeze check' + exit 0 + fi + curl -sf "https://raw.githubusercontent.com/nextcloud/server/$SERVER_REF/version.php" --output version.php + if grep 'OC_VersionString' version.php | grep -q -i -E '(\.0\.0 RC[3-9]|\.[1-9][0-9]* RC)'; then + echo "Merge freeze is active for $SERVER_REF, skipping" + echo 'active=true' >> $GITHUB_OUTPUT + fi + rm version.php + + - name: Copy all workflow templates + if: steps.freeze.outputs.active != 'true' + run: | + echo 'SUMMARY<> $GITHUB_ENV + draft_only=0 + for workflow in ./source/workflow-templates/*.yml; do + echo "❓ Looking for $workflow" + if [ -f "$workflow" ]; then + filename=$(basename "$workflow") + target_file="./target/.github/workflows/$filename" + + # Only copy if the file exists in the target repository + if [ -f "$target_file" ]; then + if [ -f "./target/.github/actions-lock.txt" ]; then + locked_version=$(grep " $filename" ./target/.github/actions-lock.txt | cat) + else + echo "# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors" >> ./target/.github/actions-lock.txt + echo "# SPDX-License""-Identifier: MIT" >> ./target/.github/actions-lock.txt + locked_version="" + fi + locked_version=$(echo $locked_version | cut -f 1 -d " ") + new_version=$(md5sum $workflow | cut -f 1 -d " ") + + # Only update if the action changes + if [[ "$locked_version" != "$new_version" ]]; then + echo "ℹ️ Locked version: $locked_version" + echo "ℹ️ Current version: $new_version" + echo "🆙 Updating existing workflow: $filename" + echo "- 🆙 Updated [$filename](https://github.com/nextcloud/.github/commits/master/workflow-templates/$filename)" >> $GITHUB_ENV + + cp "$workflow" "$target_file" + + # Apply patch if one exists + if [ -f "$target_file.patch" ]; then + echo "🩹 Applying patch" + cd ./target + set +e + patch -p1 < ".github/workflows/$filename.patch" + patch_worked=$? + set -e + cd - + if [[ "$patch_worked" == "0" ]]; then + echo " - Patch applied" >> $GITHUB_ENV + else + echo " - [ ] ❌ Patch failed" >> $GITHUB_ENV + draft_only=1 + fi + fi + + if [[ "$locked_version" != "" ]]; then + sed -i "s/$locked_version $filename/$new_version $filename/" ./target/.github/actions-lock.txt + else + echo "$new_version $filename" >> ./target/.github/actions-lock.txt + fi + else + echo "✅ Skipping $filename: already up to date" + fi + else + echo "⏭️ Skipping $filename: does not exist in target repository" + fi + fi + done + echo 'EOF' >> $GITHUB_ENV + echo "DRAFT_ONLY=${draft_only}" >> $GITHUB_ENV + + - name: Create Pull Request + if: steps.freeze.outputs.active != 'true' + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + with: + token: ${{ secrets.COMMAND_BOT_WORKFLOWS }} + commit-message: 'ci(actions): Update workflow templates from organization template repository' + committer: GitHub + author: nextcloud-command + path: target + signoff: true + branch: 'automated/noid/${{ matrix.branches }}-update-workflows' + title: '[${{ matrix.branches }}] ci(actions): Update workflow templates from organization template repository' + draft: ${{ env.DRAFT_ONLY == 1 }} + add-paths: .github/workflows/*.yml,.github/actions-lock.txt + body: | + Automated update of all workflow templates from [nextcloud/.github](https://github.com/nextcloud/.github) + ${{ env.SUMMARY }} + labels: | + dependencies + 3. to review diff --git a/psalm.xml b/psalm.xml index a2702a9..458a680 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,5 +1,6 @@ Date: Mon, 19 Oct 2026 12:03:25 +0200 Subject: [PATCH 2/3] fix: resolve psalm errors Signed-off-by: Pet M. --- archive.php | 5 +- blocks/benefits3.php | 1 - blocks/blog-list.php | 6 +- blocks/carousel_slider.php | 5 -- blocks/case-study.php | 8 +-- blocks/contact.php | 1 - blocks/data-sheet.php | 6 +- blocks/faq.php | 2 +- blocks/hosting.php | 1 - blocks/hosting2.php | 1 - blocks/img-cols.php | 4 +- blocks/industries.php | 1 - blocks/nc_videos_tabs.php | 12 +--- blocks/podcast.php | 1 - blocks/promo.php | 25 +++------ blocks/release-changelog.php | 1 - blocks/signup.php | 10 ++-- blocks/simple_slider.php | 2 +- blocks/squote2.php | 1 - blocks/testimonial.php | 1 - blocks/webinar_promo.php | 5 +- blocks/whitepaper-list.php | 2 - blocks/whitepaper.php | 6 +- footer.php | 5 +- functions.php | 105 ++++++++++++++++++++--------------- header.php | 2 - lib/signup.php | 12 ++-- plugins.stub.php | 26 +++++++++ psalm.xml | 19 +++++++ search.php | 7 +-- single.php | 4 +- 31 files changed, 146 insertions(+), 141 deletions(-) create mode 100644 plugins.stub.php diff --git a/archive.php b/archive.php index b0a3de2..7b2e8f7 100644 --- a/archive.php +++ b/archive.php @@ -42,7 +42,7 @@ $webinar = false; if (get_post_type() == 'event') { - $cat = wp_get_object_terms(get_the_ID(), 'event_categories', []); + $cat = wp_get_object_terms((int)get_the_ID(), 'event_categories', []); if ($cat) { foreach ($cat as $c) { if ($c->term_id == 250) { // event_categories Webinars @@ -73,7 +73,8 @@ } if (get_post_type() == 'event') { - $cat_id = get_queried_object()->term_id; + $queried_object = get_queried_object(); + $cat_id = $queried_object instanceof WP_Term ? $queried_object->term_id : null; } ?> diff --git a/blocks/benefits3.php b/blocks/benefits3.php index 1ca1534..010e1b4 100644 --- a/blocks/benefits3.php +++ b/blocks/benefits3.php @@ -5,7 +5,6 @@ $id = get_field('section_id'); $title = get_field('title'); $text = get_field('text'); -$link = get_field('link'); ?>
diff --git a/blocks/blog-list.php b/blocks/blog-list.php index 13c8110..f5da8f2 100644 --- a/blocks/blog-list.php +++ b/blocks/blog-list.php @@ -15,7 +15,7 @@ if (isset($_GET['webinars'])) { - if (strip_tags($_GET['webinars']) == 'upcoming') { + if (is_string($_GET['webinars']) && strip_tags($_GET['webinars']) == 'upcoming') { echo __('Upcoming webinars', 'nextcloud'); } else { echo __('Webinar recordings', 'nextcloud'); @@ -70,7 +70,7 @@ ] ]; - if (strip_tags($_GET['webinars']) == 'upcoming') { + if (is_string($_GET['webinars']) && strip_tags($_GET['webinars']) == 'upcoming') { $args['meta_query'] = [ [ @@ -82,7 +82,7 @@ ]; $args['order'] = 'DESC'; - } elseif (strip_tags($_GET['webinars']) == 'past') { + } elseif (is_string($_GET['webinars']) && strip_tags($_GET['webinars']) == 'past') { $args['meta_query'] = [ 'relation' => 'AND', diff --git a/blocks/carousel_slider.php b/blocks/carousel_slider.php index 7c1ca1b..c494c10 100644 --- a/blocks/carousel_slider.php +++ b/blocks/carousel_slider.php @@ -3,11 +3,6 @@ * Carousel Slider block template */ $id = get_field('id'); -$autoplay_options = get_field_object('autoplay'); -$autoplay = $autoplay_options['value']; -if (!$autoplay) { - $autoplay = 'false'; -} $boxed_layout_options = get_field_object('boxed_layout'); $boxed_layout = $boxed_layout_options['value']; diff --git a/blocks/case-study.php b/blocks/case-study.php index d66c91c..fc04641 100644 --- a/blocks/case-study.php +++ b/blocks/case-study.php @@ -39,16 +39,12 @@ foreach ($studies as $study) { $post_id = $study->ID; - $link = get_the_permalink($post_id); + $link = (string)get_the_permalink($post_id); $featured_image = get_the_post_thumbnail($post_id, 'large', [ 'class' => 'feat_img' ]); - $img = wp_get_attachment_url(get_post_thumbnail_id($post_id) ?: 0) ?: ''; $header = get_the_title($post_id); $ex = get_the_excerpt($post_id); - $custom_field = get_field('field_name', $post_id); - $att = get_field('attachment', $post_id); - $str = substr($att, 38); echo '
'; echo '
'; //echo '
'; @@ -63,7 +59,7 @@ } echo ''; echo '
'; diff --git a/blocks/contact.php b/blocks/contact.php index 4827aca..8e5494f 100644 --- a/blocks/contact.php +++ b/blocks/contact.php @@ -5,7 +5,6 @@ $id = get_field('section_id'); $title = get_field('title'); $text = get_field('text'); -$playground = str_contains(get_permalink() ?: '', 'playground'); ?>
diff --git a/blocks/data-sheet.php b/blocks/data-sheet.php index 880d7c5..a6e6689 100644 --- a/blocks/data-sheet.php +++ b/blocks/data-sheet.php @@ -31,13 +31,11 @@ echo '
'; foreach ($studies as $study) { $post_id = $study->ID; - $link = get_the_permalink($study->ID); + $link = (string)get_the_permalink($study->ID); $featured_image = get_the_post_thumbnail($post_id, 'large', [ 'class' => 'feat_img' ]); - $img = wp_get_attachment_url(get_post_thumbnail_id($study->ID) ?: 0) ?: ''; $header = get_the_title($study->ID); $ex = get_the_excerpt($study->ID); - $custom_field = get_field('field_name', $study->ID); $att = get_field('attachment', $study->ID); echo '
'; echo '
'; @@ -53,7 +51,7 @@ } echo ''; echo '
'; diff --git a/blocks/faq.php b/blocks/faq.php index a9cba04..fffea6e 100644 --- a/blocks/faq.php +++ b/blocks/faq.php @@ -19,7 +19,7 @@ echo '
'; echo '
'; $count = count(get_field('faq')); - $half = ceil($count / 2); + $half = (int)ceil($count / 2); $i = 0; while (have_rows('faq')) : the_row(); $q = get_sub_field('question'); diff --git a/blocks/hosting.php b/blocks/hosting.php index e39553f..27fe1b0 100644 --- a/blocks/hosting.php +++ b/blocks/hosting.php @@ -23,7 +23,6 @@ echo '
'; while (have_rows('columns')) { the_row(); - $header = get_sub_field('the_title'); $cont = get_sub_field('the_text'); $link = get_sub_field('link'); echo '
'; diff --git a/blocks/hosting2.php b/blocks/hosting2.php index 9f76dc7..325e530 100644 --- a/blocks/hosting2.php +++ b/blocks/hosting2.php @@ -23,7 +23,6 @@ echo '
'; while (have_rows('columns')) { the_row(); - $header = get_sub_field('the_title'); $cont = get_sub_field('the_text'); $link = get_sub_field('link'); echo '
'; diff --git a/blocks/img-cols.php b/blocks/img-cols.php index 50941c2..732beb5 100644 --- a/blocks/img-cols.php +++ b/blocks/img-cols.php @@ -35,8 +35,8 @@ while (have_rows('column')) { the_row(); $img_id = get_sub_field('column_image'); - $img2 = wp_get_attachment_image($img_id, 'full', '', [ 'class' => 'img-responsive' ]); - $img_url = wp_get_attachment_image_url($img_id, 'full'); + $img2 = wp_get_attachment_image($img_id, 'full', false, [ 'class' => 'img-responsive' ]); + $img_url = (string)wp_get_attachment_image_url($img_id, 'full'); $text = get_sub_field('column_text'); if ($count == '1') { echo '
'; diff --git a/blocks/industries.php b/blocks/industries.php index 049ab7f..8c4f377 100644 --- a/blocks/industries.php +++ b/blocks/industries.php @@ -10,7 +10,6 @@ $columns = get_field('no_of_columns'); $css = get_field('custom_css_classes'); -$col_class = ''; if ($columns == 4) { $col_class = 'col-lg-3'; } elseif ($columns == 3) { diff --git a/blocks/nc_videos_tabs.php b/blocks/nc_videos_tabs.php index 050f768..5e2747c 100644 --- a/blocks/nc_videos_tabs.php +++ b/blocks/nc_videos_tabs.php @@ -28,15 +28,11 @@ the_row(); $id = get_sub_field('id'); - $icon = get_sub_field('icon'); //$title = str_replace('
', '\n', get_sub_field( 'title' )); - $title = str_replace('\n', '
', get_sub_field('title')); + $title = str_replace('\n', '
', (string)get_sub_field('title')); $description = get_sub_field('description'); - $video_url = get_sub_field('video_url'); - $video_preview_image = get_sub_field('video_preview_image'); $link = get_sub_field('link'); - $custom_css = ''; ?> @@ -130,13 +126,9 @@ the_row(); $id = get_sub_field('id'); - $icon = get_sub_field('icon'); - $title = str_replace('\n', '', get_sub_field('title')); - $description = get_sub_field('description'); + $title = str_replace('\n', '', (string)get_sub_field('title')); $video_url = get_sub_field('video_url'); $video_preview_image = get_sub_field('video_preview_image'); - $link = get_sub_field('link'); - $custom_css = ''; echo ' diff --git a/blocks/squote2.php b/blocks/squote2.php index c948173..11f0a2b 100644 --- a/blocks/squote2.php +++ b/blocks/squote2.php @@ -6,7 +6,6 @@ $quote = get_field('quote'); $img = get_field('image'); $text = get_field('text'); -$pos = get_field('position'); $link = get_field('link'); ?>
diff --git a/blocks/testimonial.php b/blocks/testimonial.php index 4985694..81e81e8 100644 --- a/blocks/testimonial.php +++ b/blocks/testimonial.php @@ -4,7 +4,6 @@ */ $id = get_field('section_id'); $title = get_field('title'); -$link = get_field('link'); ?>
diff --git a/blocks/webinar_promo.php b/blocks/webinar_promo.php index 1cb2eed..b65f522 100644 --- a/blocks/webinar_promo.php +++ b/blocks/webinar_promo.php @@ -15,13 +15,10 @@ $popup_content = get_field('popup_content'); $custom_css_classes = get_field('custom_css_classes'); $expiration = get_field('expiration_date'); +$show_promo = true; if ($expiration) { $expiration_ts = strtotime($expiration); $now = time(); -} - -$show_promo = true; -if ($expiration) { if ($expiration_ts < $now) { $show_promo = false; } diff --git a/blocks/whitepaper-list.php b/blocks/whitepaper-list.php index 9c07515..a39727b 100644 --- a/blocks/whitepaper-list.php +++ b/blocks/whitepaper-list.php @@ -2,7 +2,6 @@ /* * Whitepaper Blog Posts Block Template. */ -$id = get_field('section_id'); $title = get_field('title'); $subtext = get_field('subtext'); ?> @@ -35,7 +34,6 @@ 'order' => 'DSC', ]); foreach ($onepost as $onepostsingle) { - $img = wp_get_attachment_url(get_post_thumbnail_id($onepostsingle->ID) ?: 0) ?: ''; $title = $onepostsingle->post_title; $date = (string)get_the_date('F d, Y', $onepostsingle->ID); $cat = get_the_category($onepostsingle->ID); diff --git a/blocks/whitepaper.php b/blocks/whitepaper.php index cc7674f..03eead0 100644 --- a/blocks/whitepaper.php +++ b/blocks/whitepaper.php @@ -31,14 +31,12 @@ echo '
'; foreach ($studies as $study) { $post_id = $study->ID; - $link = get_the_permalink($study->ID); + $link = (string)get_the_permalink($study->ID); //$img = wp_get_attachment_url(get_post_thumbnail_id($post_id) ?: 0) ?: ''; $featured_image = get_the_post_thumbnail($post_id, 'large', [ 'class' => 'feat_img' ]); - $img = wp_get_attachment_url(get_post_thumbnail_id($study->ID) ?: 0) ?: ''; $header = get_the_title($study->ID); $ex = get_the_excerpt($study->ID); - $custom_field = get_field('field_name', $study->ID); $att = get_field('attachment', $study->ID); echo '
'; echo '
'; @@ -55,7 +53,7 @@ } echo ''; echo '
'; diff --git a/footer.php b/footer.php index d3cd119..beea946 100644 --- a/footer.php +++ b/footer.php @@ -3,9 +3,6 @@ * The template for displaying the footer */ -if (function_exists('get_field')) { - $flogo = get_field('footer_logo', 'options'); -} ?>